|
14 | 14 | #include <unistd.h>
|
15 | 15 | #endif
|
16 | 16 |
|
17 |
| -#include <cassert> |
18 | 17 | #include <stack>
|
19 | 18 |
|
20 | 19 | #include <util/invariant.h>
|
21 | 20 | #include <util/threeval.h>
|
22 |
| -#include <util/invariant.h> |
23 | 21 |
|
24 | 22 | #include <minisat/core/Solver.h>
|
25 | 23 | #include <minisat/simp/SimpSolver.h>
|
@@ -68,7 +66,7 @@ tvt satcheck_minisat2_baset<T>::l_get(literalt a) const
|
68 | 66 | template<typename T>
|
69 | 67 | void satcheck_minisat2_baset<T>::set_polarity(literalt a, bool value)
|
70 | 68 | {
|
71 |
| - assert(!a.is_constant()); |
| 69 | + PRECONDITION(!a.is_constant()); |
72 | 70 |
|
73 | 71 | try
|
74 | 72 | {
|
@@ -112,7 +110,10 @@ void satcheck_minisat2_baset<T>::lcnf(const bvt &bv)
|
112 | 110 | if(it->is_true())
|
113 | 111 | return;
|
114 | 112 | else if(!it->is_false())
|
115 |
| - assert(it->var_no() < (unsigned)solver->nVars()); |
| 113 | + { |
| 114 | + INVARIANT( |
| 115 | + it->var_no() < (unsigned)solver->nVars(), "variable not added yet"); |
| 116 | + } |
116 | 117 | }
|
117 | 118 |
|
118 | 119 | Minisat::vec<Minisat::Lit> c;
|
@@ -148,7 +149,7 @@ static void interrupt_solver(int signum)
|
148 | 149 | template<typename T>
|
149 | 150 | propt::resultt satcheck_minisat2_baset<T>::prop_solve()
|
150 | 151 | {
|
151 |
| - assert(status!=statust::ERROR); |
| 152 | + PRECONDITION(status != statust::ERROR); |
152 | 153 |
|
153 | 154 | {
|
154 | 155 | messaget::status() <<
|
@@ -260,7 +261,7 @@ propt::resultt satcheck_minisat2_baset<T>::prop_solve()
|
260 | 261 | template<typename T>
|
261 | 262 | void satcheck_minisat2_baset<T>::set_assignment(literalt a, bool value)
|
262 | 263 | {
|
263 |
| - assert(!a.is_constant()); |
| 264 | + PRECONDITION(!a.is_constant()); |
264 | 265 |
|
265 | 266 | try
|
266 | 267 | {
|
@@ -353,7 +354,7 @@ void satcheck_minisat_simplifiert::set_frozen(literalt a)
|
353 | 354 |
|
354 | 355 | bool satcheck_minisat_simplifiert::is_eliminated(literalt a) const
|
355 | 356 | {
|
356 |
| - assert(!a.is_constant()); |
| 357 | + PRECONDITION(!a.is_constant()); |
357 | 358 |
|
358 | 359 | return solver->isEliminated(a.var_no());
|
359 | 360 | }
|
0 commit comments