mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
fixes for #6577
- 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:
parent
d22e4aa525
commit
46c8d78ece
3 changed files with 16 additions and 13 deletions
|
@ -692,28 +692,23 @@ bool goal::is_cnf() const {
|
|||
for (unsigned i = 0; i < size(); i++) {
|
||||
expr * f = form(i);
|
||||
if (m_manager.is_or(f)) {
|
||||
for (expr* lit : *to_app(f)) {
|
||||
if (!is_literal(lit)) {
|
||||
for (expr* lit : *to_app(f))
|
||||
if (!is_literal(lit))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!is_literal(f)) {
|
||||
if (!is_literal(f))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool goal::is_literal(expr* f) const {
|
||||
m_manager.is_not(f, f);
|
||||
if (!is_app(f)) return false;
|
||||
if (to_app(f)->get_family_id() == m_manager.get_basic_family_id()) {
|
||||
if (!is_app(f))
|
||||
return false;
|
||||
if (to_app(f)->get_family_id() == m_manager.get_basic_family_id())
|
||||
for (expr* arg : *to_app(f))
|
||||
if (m_manager.is_bool(arg)) {
|
||||
if (m_manager.is_bool(arg))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue