use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testBelonging.
@Test
public void testBelonging() {
String formula = "1 : {1}";
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 SetFormulaEvaluationTest method testNoProperSubset2.
@Test
public void testNoProperSubset2() {
String formula = "{1} /<<: {1,2}";
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 testSetExtensionFormulaWithSetVarModel.
@Test
public void testSetExtensionFormulaWithSetVarModel() {
String formula = "{1,2} = x";
// getting the translated z3 representation of the formula
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
Expr x = z3Context.mkArrayConst("x", z3Context.mkIntSort(), z3Context.mkBoolSort());
assertEquals(Status.SATISFIABLE, check);
assertEquals("(store (store ((as const (Array Int Bool)) false) 1 true) 2 true)", z3Solver.getModel().eval(x, true).toString());
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testSetExtensionFormulaWithSingleVarModel.
@Test
public void testSetExtensionFormulaWithSingleVarModel() {
String formula = "{1,2} = {2,x}";
// getting the translated z3 representation of the formula
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
Expr x = z3Context.mkIntConst("x");
assertEquals(Status.SATISFIABLE, check);
assertEquals(z3Context.mkInt(1), z3Solver.getModel().eval(x, true));
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project bmoth by hhu-stups.
the class SetFormulaEvaluationTest method testBelonging3.
@Test
public void testBelonging3() {
String formula = "1 : {2,3}";
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(formula, z3Context);
z3Solver.add(constraint);
Status check = z3Solver.check();
assertEquals(Status.UNSATISFIABLE, check);
}
Aggregations