use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testBelonging.
@Test
public void testBelonging() {
String formula = "1 : {1}";
BoolExpr constraint = translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.SATISFIABLE, check);
}
use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testBelonging2.
@Test
public void testBelonging2() {
String formula = "x: {1}";
BoolExpr constraint = translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.SATISFIABLE, check);
}
use of com.microsoft.z3.BoolExpr 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 com.microsoft.z3.BoolExpr 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 com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.
the class TestUsingZ3 method check.
public void check(Status satisfiable, String formula) {
BoolExpr constraint = translatePredicate(formula, z3Context);
// create scope just for current constraint
z3Solver.push();
z3Solver.add(constraint);
Status check = z3Solver.check();
// clean solver stack
z3Solver.pop();
assertEquals(satisfiable, check);
}
Aggregations