use of com.rockwellcollins.atc.tcg.lustre.visitors.GenerateUfcObligationsVisitor in project AGREE by loonwerks.
the class StandaloneTcg method main.
public static void main(String[] args) throws IOException {
// Parse command line arguments
final Arguments appArgs = Arguments.parse(args);
if (appArgs == null) {
System.err.println("Usage: java -jar tcg.jar [options] <input_filename> <output_filename>");
System.err.println("Options:");
System.err.println(Arguments.OPTION_GENERATE_BOUNDARY_VALUE_TESTS + " Enables generation of boundary value tests.");
return;
}
// Parse the lustre file
final LustreLexer lexer = new LustreLexer(new ANTLRFileStream(appArgs.inputFilename));
final CommonTokenStream tokens = new CommonTokenStream(lexer);
final LustreParser parser = new LustreParser(tokens);
final Program program = new LustreToAstVisitor().program(parser.program());
// Process it
final GenerateUfcObligationsVisitor visitor = new GenerateUfcObligationsVisitor(program, null);
visitor.setGenerateAssumptionObligations(false);
visitor.setGenerateEqObligations(false);
visitor.setGenerateGuaranteeObligations(false);
visitor.setGenerateBoundaryValueTests(appArgs.enableBoundaryValueTests);
visitor.setGeneratePropertyObligations(true);
program.accept(visitor);
// Construct the new program
final Program outProgram = visitor.constructNewProgram();
// Write output
try (PrintWriter out = new PrintWriter(appArgs.outputFilename)) {
out.println(outProgram);
}
}
use of com.rockwellcollins.atc.tcg.lustre.visitors.GenerateUfcObligationsVisitor in project AGREE by loonwerks.
the class VerifyHandler method constructUfcProgram.
private Program constructUfcProgram(Program program, TcgRenaming renaming) {
System.out.println("building ufc obligations...");
GenerateUfcObligationsVisitor ufcGenerator = new GenerateUfcObligationsVisitor(program, renaming);
ufcGenerator.setGenerateAssumptionObligations(TcgPreferenceUtils.getGenerateTestsForAssumptions());
ufcGenerator.setGenerateEqObligations(TcgPreferenceUtils.getGenerateTestsForEquations());
ufcGenerator.setGenerateBoundaryValueTests(TcgPreferenceUtils.getPerformBoundaryValueChecks());
ufcGenerator.traverse();
return ufcGenerator.constructNewProgram();
}
Aggregations