File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 1212#include " cnf.h"
1313
1414#include < algorithm>
15- #include < cassert>
16- #include < iostream>
1715#include < set>
1816
17+ #include < util/invariant.h>
18+
1919// #define VERBOSE
2020
2121// / Tseitin encoding of conjunction of two literals
@@ -426,22 +426,23 @@ bool cnft::process_clause(const bvt &bv, bvt &dest)
426426 for (const auto l : bv)
427427 {
428428 // we never use index 0
429- assert (l.var_no ()!= 0 );
429+ INVARIANT (l.var_no () != 0 , " variable 0 must not be used " );
430430
431431 // we never use 'unused_var_no'
432- assert (l.var_no ()!=literalt::unused_var_no ());
432+ INVARIANT (
433+ l.var_no () != literalt::unused_var_no (),
434+ " variable 'unused_var_no' must not be used" );
433435
434436 if (l.is_true ())
435437 return true ; // clause satisfied
436438
437439 if (l.is_false ())
438440 continue ; // will remove later
439441
440- if (l.var_no ()>=_no_variables)
441- std::cout << " l.var_no()=" << l.var_no ()
442- << " _no_variables=" << _no_variables << ' \n ' ;
443-
444- assert (l.var_no ()<_no_variables);
442+ INVARIANT (
443+ l.var_no () < _no_variables,
444+ " unknown variable " + std::to_string (l.var_no ()) +
445+ " (no_variables = " + std::to_string (_no_variables) + " )" );
445446 }
446447
447448 // now copy
You can’t perform that action at this time.
0 commit comments