Search in sources :

Example 51 with Status

use of su.litvak.chromecast.api.v2.Status in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testDifference.

@Test
public void testDifference() {
    String formula = "{1,2}\\{2,3} = {1}";
    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 52 with Status

use of su.litvak.chromecast.api.v2.Status in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testNoProperSubset3.

@Test
public void testNoProperSubset3() {
    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 53 with Status

use of su.litvak.chromecast.api.v2.Status in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testUnion.

@Test
public void testUnion() {
    String formula = "{1,2} \\/ {2,3} = {2}";
    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 54 with Status

use of su.litvak.chromecast.api.v2.Status in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testStrictSubset3.

@Test
public void testStrictSubset3() {
    String formula = "{1} <<: {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 55 with Status

use of su.litvak.chromecast.api.v2.Status in project bmoth by hhu-stups.

the class SetFormulaEvaluationTest method testNotBelonging2.

@Test
public void testNotBelonging2() {
    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)

Aggregations

Status (com.microsoft.z3.Status)61 BoolExpr (com.microsoft.z3.BoolExpr)55 Test (org.junit.Test)48 Context (com.microsoft.z3.Context)11 Expr (com.microsoft.z3.Expr)10 Solver (com.microsoft.z3.Solver)6 Model (com.microsoft.z3.Model)4 BatfishException (org.batfish.common.BatfishException)4 HeaderSpace (org.batfish.datamodel.HeaderSpace)4 IpWildcard (org.batfish.datamodel.IpWildcard)4 Fixedpoint (com.microsoft.z3.Fixedpoint)3 Z3Exception (com.microsoft.z3.Z3Exception)3 MachineToZ3Translator (de.bmoth.backend.z3.MachineToZ3Translator)2 ModelCheckingResult (de.bmoth.modelchecker.ModelCheckingResult)2 State (de.bmoth.modelchecker.State)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Z3_ast_print_mode (com.microsoft.z3.enumerations.Z3_ast_print_mode)1 LitmusLexer (dartagnan.LitmusLexer)1 LitmusParser (dartagnan.LitmusParser)1