mirror of
https://github.com/Z3Prover/z3
synced 2025-06-16 10:56:16 +00:00
generalize model finder code to be independent of conjunction elimination
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
2e186633ee
commit
5a479fca76
1 changed files with 5 additions and 6 deletions
|
@ -2272,10 +2272,9 @@ namespace smt {
|
||||||
process_literal(atom, pol == NEG);
|
process_literal(atom, pol == NEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_or(app * n, polarity p) {
|
void process_and_or(app * n, polarity p) {
|
||||||
unsigned num_args = n->get_num_args();
|
for (expr* arg : *n)
|
||||||
for (unsigned i = 0; i < num_args; i++)
|
visit_formula(arg, p);
|
||||||
visit_formula(n->get_arg(i), p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_ite(app * n, polarity p) {
|
void process_ite(app * n, polarity p) {
|
||||||
|
@ -2306,13 +2305,13 @@ namespace smt {
|
||||||
if (is_app(curr)) {
|
if (is_app(curr)) {
|
||||||
if (to_app(curr)->get_family_id() == m_manager.get_basic_family_id() && m_manager.is_bool(curr)) {
|
if (to_app(curr)->get_family_id() == m_manager.get_basic_family_id() && m_manager.is_bool(curr)) {
|
||||||
switch (static_cast<basic_op_kind>(to_app(curr)->get_decl_kind())) {
|
switch (static_cast<basic_op_kind>(to_app(curr)->get_decl_kind())) {
|
||||||
case OP_AND:
|
|
||||||
case OP_IMPLIES:
|
case OP_IMPLIES:
|
||||||
case OP_XOR:
|
case OP_XOR:
|
||||||
UNREACHABLE(); // simplifier eliminated ANDs, IMPLIEs, and XORs
|
UNREACHABLE(); // simplifier eliminated ANDs, IMPLIEs, and XORs
|
||||||
break;
|
break;
|
||||||
case OP_OR:
|
case OP_OR:
|
||||||
process_or(to_app(curr), pol);
|
case OP_AND:
|
||||||
|
process_and_or(to_app(curr), pol);
|
||||||
break;
|
break;
|
||||||
case OP_NOT:
|
case OP_NOT:
|
||||||
visit_formula(to_app(curr)->get_arg(0), neg(pol));
|
visit_formula(to_app(curr)->get_arg(0), neg(pol));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue