Search in sources :

Example 6 with State

use of de.bmoth.modelchecker.State in project bmoth by hhu-stups.

the class StateTest method testStateEquals.

@Test
public void testStateEquals() throws Exception {
    HashMap<String, Expr> map1 = new HashMap<>();
    HashMap<String, Expr> map2 = new HashMap<>();
    map1.put("x", z3Context.mkInt(11));
    map2.put("x", z3Context.mkInt(11));
    State state1 = new State(map1);
    State state2 = new State(map2);
    assertEquals(state1, state2);
    assertEquals(state1.hashCode(), state2.hashCode());
}
Also used : Expr(com.microsoft.z3.Expr) HashMap(java.util.HashMap) State(de.bmoth.modelchecker.State) Test(org.junit.Test)

Example 7 with State

use of de.bmoth.modelchecker.State in project bmoth by hhu-stups.

the class StateTest method testEquals.

@Test
public void testEquals() {
    HashMap<String, Expr> map = new HashMap<>();
    map.put("a", z3Context.mkInt(1));
    map.put("b", z3Context.mkInt(2));
    State s = new State(map);
    State s2 = new State(map);
    assertEqualsImplementedCorrectly(s);
    assertEqualsImplementedCorrectly(s, s2);
    s2 = new State(map);
    State s3 = new State(map);
    assertEqualsImplementedCorrectly(s2);
    assertEqualsImplementedCorrectly(s2, s3);
}
Also used : Expr(com.microsoft.z3.Expr) HashMap(java.util.HashMap) State(de.bmoth.modelchecker.State) Test(org.junit.Test)

Example 8 with State

use of de.bmoth.modelchecker.State in project bmoth by hhu-stups.

the class StateTest method testStateEquals2.

@Test
public void testStateEquals2() throws Exception {
    HashMap<String, Expr> map1 = new HashMap<>();
    HashMap<String, Expr> map2 = new HashMap<>();
    map1.put("x", z3Context.mkInt(11));
    map1.put("y", z3Context.mkInt(12));
    map2.put("x", z3Context.mkInt(11));
    State state1 = new State(map1);
    State state2 = new State(map2);
    assertNotEquals(state1, state2);
    assertNotEquals(state1.hashCode(), state2.hashCode());
}
Also used : Expr(com.microsoft.z3.Expr) HashMap(java.util.HashMap) State(de.bmoth.modelchecker.State) Test(org.junit.Test)

Aggregations

State (de.bmoth.modelchecker.State)8 Expr (com.microsoft.z3.Expr)6 HashMap (java.util.HashMap)6 Test (org.junit.Test)6 Status (com.microsoft.z3.Status)2