3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
- the literal false should not appear in clauses
- the literal true forces a tautology
- fix early return in is_cnf check. It should check all clauses for nested Booleans.
This commit is contained in:
Nikolaj Bjorner 2023-02-11 09:32:53 -08:00
parent d22e4aa525
commit 46c8d78ece
3 changed files with 16 additions and 13 deletions

View file

@ -47,6 +47,8 @@ struct dimacs_pp {
}
for (unsigned j = 0; j < num_lits; j++) {
expr * l = lits[j];
if (m.is_false(l))
continue;
if (m.is_not(l))
l = to_app(l)->get_arg(0);
if (!is_uninterp_const(l))
@ -101,6 +103,12 @@ struct dimacs_pp {
}
for (unsigned j = 0; j < num_lits; j++) {
expr * l = lits[j];
if (m.is_false(l))
continue;
if (m.is_true(l)) {
out << "1 -1 ";
continue;
}
if (m.is_not(l)) {
out << "-";
l = to_app(l)->get_arg(0);