@@ -28,14 +28,13 @@ public void init() {
2828 public void logicTest () throws SolverException , InterruptedException {
2929 // Valid input string that sets the logic to QF_ALL
3030 BooleanFormula expected = mgr .parse ("(declare-const v Int)(assert (= v 3))" );
31- BooleanFormula validLogic =
32- mgr .parse ("(set-logic QF_ALL)" + "(declare-const v Int)" + "(assert (= v 3))" );
33- assertThatFormula (expected ).isEquivalentTo (validLogic );
31+ String validLogic = "(set-logic QF_ALL)" + "(declare-const v Int)" + "(assert (= v 3))" ;
32+ assertThatFormula (mgr .parse (validLogic )).isEquivalentTo (expected );
3433
35- // Invalid string that sets QF_UF, even though integers are needed
36- // Most solvers seem to just ignore the logic that was chosen
34+ // Invalid string that sets logic QF_UF, even though integers are needed
35+ // FIXME: We don't check for this as most solvers seem to ignore the logic anyway
3736 String wrongLogic = "(set-logic QF_UF)" + "(declare-const v Int)" + "(assert (= v 3))" ;
38- assertThrows ( IllegalArgumentException . class , () -> mgr .parse (wrongLogic ));
37+ assertThatFormula ( mgr .parse (wrongLogic )). isEquivalentTo ( expected );
3938
4039 // Try setting logic after another command was already used
4140 String logicAfterOption =
@@ -51,13 +50,15 @@ public void logicTest() throws SolverException, InterruptedException {
5150 assertThrows (IllegalArgumentException .class , () -> mgr .parse (logicTwice ));
5251
5352 // Call (reset) and *then* set the logic again
53+ // FIXME: We currently don't support the (reset) command and expect and exception to be thrown
54+ // here
5455 String logicReset =
5556 "(set-logic QF_UF)"
5657 + "(reset)"
5758 + "(set-logic ALL)"
5859 + "(declare-const v Int)"
5960 + "(assert (= v 3))" ;
60- assertThatFormula ( mgr .parse (logicReset )). isEquivalentTo ( expected );
61+ assertThrows ( IllegalArgumentException . class , () -> mgr .parse (logicReset ));
6162 }
6263
6364 @ Test
@@ -77,12 +78,13 @@ public void exitAtTheEnd() throws SolverException, InterruptedException {
7778
7879 @ Test
7980 public void stackPushTest () throws SolverException , InterruptedException {
80- BooleanFormula expected = mgr .parse ("(declare-const v Int)(assert (= v 3))" );
81+ // FIXME: We currently don't support stack operations and expect an exceptions to be thrown for
82+ // these inputs
8183
82- // Push assertions and then pop the stack to remove them
84+ // Push an assertion and then use ( pop) to remove it again
8385 String stackPush =
8486 "(declare-const v Int)" + "(push 1)" + "(assert (= v 0))" + "(pop 1)" + "(assert (= v 3))" ;
85- assertThatFormula ( mgr .parse (stackPush )). isEquivalentTo ( expected );
87+ assertThrows ( IllegalArgumentException . class , () -> mgr .parse (stackPush ));
8688
8789 // Use (reset-assertions) to remove all assertions from the stack
8890 String stackResetAssertions =
@@ -91,7 +93,7 @@ public void stackPushTest() throws SolverException, InterruptedException {
9193 + "(reset-assertions)"
9294 + "(declare-const v Int)"
9395 + "(assert (= v 0))" ;
94- assertThatFormula (( mgr .parse (stackResetAssertions ))). isEquivalentTo ( expected );
96+ assertThrows ( IllegalArgumentException . class , () -> mgr .parse (stackResetAssertions ));
9597
9698 // With :global-declarations the reset will also remove all declarations
9799 String globalStackResetAssertions =
@@ -100,7 +102,7 @@ public void stackPushTest() throws SolverException, InterruptedException {
100102 + "(assert (= v 3))"
101103 + "(reset-assertions)"
102104 + "(assert (= v 0))" ;
103- assertThatFormula ( mgr .parse (globalStackResetAssertions )). isEquivalentTo ( expected );
105+ assertThrows ( IllegalArgumentException . class , () -> mgr .parse (globalStackResetAssertions ));
104106
105107 // Just calling (reset) will also clear the stack
106108 String stackReset =
@@ -109,6 +111,6 @@ public void stackPushTest() throws SolverException, InterruptedException {
109111 + "(reset)"
110112 + "(declare-const v Int)"
111113 + "(assert (= v 3))" ;
112- assertThatFormula ( mgr .parse (stackReset )). isEquivalentTo ( expected );
114+ assertThrows ( IllegalArgumentException . class , () -> mgr .parse (stackReset ));
113115 }
114116}
0 commit comments