3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

overhaul of error messages. Add warning in dimacs conversion

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-07-04 16:04:37 -07:00
parent e622022bf9
commit 1eb8ccad59
31 changed files with 298 additions and 313 deletions

View file

@ -716,3 +716,24 @@ bool is_equal(goal const & s1, goal const & s2) {
SASSERT(num1 >= num2);
return num1 == num2;
}
bool goal::is_cnf() const {
for (unsigned i = 0; i < size(); i++) {
expr * f = form(i);
if (m_manager.is_or(f)) {
for (expr* l : *to_app(f)) {
if (!is_literal(f)) return false;
}
}
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() &&
!m_manager.is_false(f) && !m_manager.is_true(f)) return false;
return true;
}

View file

@ -77,7 +77,7 @@ protected:
unsigned get_not_idx(expr * f) const;
void shrink(unsigned j);
void reset_core();
bool is_literal(expr* f) const;
public:
goal(ast_manager & m, bool models_enabled = true, bool core_enabled = false);
@ -159,6 +159,8 @@ public:
void set(model_converter* m) { m_mc = m; }
void set(proof_converter* p) { m_pc = p; }
bool is_cnf() const;
goal * translate(ast_translation & translator) const;
};