use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testCartesianProductUnsat.
@Test
public void testCartesianProductUnsat() {
String formula = "{1}*{2}={(1,3)}";
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.UNSATISFIABLE, check);
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testAdditionFormula.
@Test
public void testAdditionFormula() {
String formula = "x : 2 .. 3";
// getting the translated z3 representation of the formula
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.SATISFIABLE, check);
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class TestUsingZ3 method checkLaw.
protected void checkLaw(String law) {
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(law, z3Context);
z3Solver.push();
z3Solver.add(z3Context.mkNot(constraint));
Status check = z3Solver.check();
z3Solver.pop();
assertEquals(Status.UNSATISFIABLE, check);
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class QuantifiedFormulaEvaluationTest method testFailUniversalFormula.
@Test
public void testFailUniversalFormula() {
String formula = "!(x).(x=5)";
// getting the translated z3 representation of the formula
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.UNSATISFIABLE, check);
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class QuantifiedFormulaEvaluationTest method testUniversalExistentialFormula.
@Test
public void testUniversalExistentialFormula() {
String formula = "#(y).(y:NATURAL & !(x).(x*y=y))";
// getting the translated z3 representation of the formula
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.SATISFIABLE, check);
}
Aggregations