use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testFailAdditionFormula.
@Test
public void testFailAdditionFormula() {
String formula = "x : 2 .. 3 & x > 3";
// 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 SetFormulaEvaluationTest method testIntersection.
@Test
public void testIntersection() {
String formula = "{1,2} /\\ {2,3} = {2}";
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 Issue76Test method testOperatorPrecedence.
@Test
@Ignore
public void testOperatorPrecedence() {
String satFormula1 = "TRUE or (FALSE & FALSE)";
String satFormula2 = "TRUE or FALSE & FALSE";
Status check;
BoolExpr satExpr1 = FormulaToZ3Translator.translatePredicate(satFormula1, z3Context);
BoolExpr satExpr2 = FormulaToZ3Translator.translatePredicate(satFormula2, z3Context);
z3Solver.add(satExpr1);
check = z3Solver.check();
assertEquals(Status.SATISFIABLE, check);
z3Solver.add(satExpr2);
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 QuantifiedFormulaEvaluationTest method testExistentialFormula.
@Test
public void testExistentialFormula() {
String formula = "#(x).(x=2)";
// 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 QuantifiedFormulaEvaluationTest method testFailUniversalExistentialFormula.
@Test
public void testFailUniversalExistentialFormula() {
String formula = "#(y).(y:NATURAL & !(x).(x=y))";
// 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);
}
Aggregations