use of de.bmoth.backend.z3.MachineToZ3Translator in project bmoth by hhu-stups.
the class InitialStateExistsChecker method doInitialStateExistsCheck.
static InitialStateExistsCheckingResult doInitialStateExistsCheck(MachineNode machine) {
Context ctx = new Context();
Solver solver = Z3SolverFactory.getZ3Solver(ctx);
MachineToZ3Translator machineTranslator = new MachineToZ3Translator(machine, ctx);
final BoolExpr invariant = machineTranslator.getInitialValueConstraint();
solver.add(invariant);
Status check = solver.check();
return new InitialStateExistsCheckingResult(check);
}
use of de.bmoth.backend.z3.MachineToZ3Translator in project bmoth by hhu-stups.
the class InvariantSatisfiabilityChecker method doInvariantSatisfiabilityCheck.
static InvariantSatisfiabilityCheckingResult doInvariantSatisfiabilityCheck(MachineNode machine) {
Context ctx = new Context();
Solver solver = Z3SolverFactory.getZ3Solver(ctx);
MachineToZ3Translator machineTranslator = new MachineToZ3Translator(machine, ctx);
final BoolExpr invariant = machineTranslator.getInvariantConstraint();
solver.add(invariant);
Status check = solver.check();
return new InvariantSatisfiabilityCheckingResult(check);
}
use of de.bmoth.backend.z3.MachineToZ3Translator in project bmoth by hhu-stups.
the class MachineTranslatorTest method init.
@Before
public void init() {
String machine = "MACHINE SimpleMachine\n";
machine += "VARIABLES x\n";
machine += "INVARIANT x : INTEGER &\n";
machine += "\tx**2 = x*x \n";
machine += "INITIALISATION x := -3\n";
machine += "OPERATIONS\n";
machine += "\tIncX = SELECT x < 50 THEN x := x+1 END\n";
machine += "END";
translator = new MachineToZ3Translator(parseMachine(machine), new Context());
}