Search in sources :

Example 21 with BoolExpr

use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testCartesianProduct.

@Test
public void testCartesianProduct() {
    String formula = "{1}*{2}={(1,2)}";
    // getting the translated z3 representation of the formula
    BoolExpr constraint = translatePredicate(formula, z3Context);
    z3Solver.add(constraint);
    Status check = z3Solver.check();
    assertEquals(Status.SATISFIABLE, check);
}
Also used : Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Test(org.junit.Test)

Example 22 with BoolExpr

use of com.microsoft.z3.BoolExpr 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 = translatePredicate(formula, z3Context);
    z3Solver.add(constraint);
    Status check = z3Solver.check();
    assertEquals(Status.UNSATISFIABLE, check);
}
Also used : Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Test(org.junit.Test)

Example 23 with BoolExpr

use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testnoSubset2.

@Test
public void testnoSubset2() {
    String formula = "{1} /<: {2,3}";
    BoolExpr constraint = translatePredicate(formula, z3Context);
    z3Solver.add(constraint);
    Status check = z3Solver.check();
    assertEquals(Status.SATISFIABLE, check);
}
Also used : Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Test(org.junit.Test)

Example 24 with BoolExpr

use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testStrictSubset2.

@Test
public void testStrictSubset2() {
    String formula = "{1} <<: {1}";
    BoolExpr constraint = translatePredicate(formula, z3Context);
    z3Solver.add(constraint);
    Status check = z3Solver.check();
    assertEquals(Status.UNSATISFIABLE, check);
}
Also used : Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Test(org.junit.Test)

Example 25 with BoolExpr

use of com.microsoft.z3.BoolExpr in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testBelonging3.

@Test
public void testBelonging3() {
    String formula = "1 : {2,3}";
    BoolExpr constraint = translatePredicate(formula, z3Context);
    z3Solver.add(constraint);
    Status check = z3Solver.check();
    assertEquals(Status.UNSATISFIABLE, check);
}
Also used : Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Test(org.junit.Test)

Aggregations

BoolExpr (com.microsoft.z3.BoolExpr)141 Status (com.microsoft.z3.Status)55 Test (org.junit.Test)51 ArithExpr (com.microsoft.z3.ArithExpr)27 GraphEdge (org.batfish.symbolic.GraphEdge)25 Context (com.microsoft.z3.Context)24 HashMap (java.util.HashMap)22 Expr (com.microsoft.z3.Expr)21 Set (java.util.Set)20 Collectors (java.util.stream.Collectors)18 BitVecExpr (com.microsoft.z3.BitVecExpr)17 Event (dartagnan.program.Event)17 MemEvent (dartagnan.program.MemEvent)17 Program (dartagnan.program.Program)16 Map (java.util.Map)16 Local (dartagnan.program.Local)15 ArrayList (java.util.ArrayList)15 BatfishException (org.batfish.common.BatfishException)14 Graph (org.batfish.symbolic.Graph)14 com.microsoft.z3 (com.microsoft.z3)12