mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
parent
8241ba784d
commit
19e2f8c9d5
3 changed files with 48 additions and 18 deletions
|
@ -466,6 +466,38 @@ class tseitin_cnf_tactic : public tactic {
|
|||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
mres match_iff_or(app * t, bool first, bool root) {
|
||||
expr * a = nullptr, * _b = nullptr;
|
||||
if (!root) return NO;
|
||||
if (!is_iff(m, t, a, _b)) return NO;
|
||||
bool sign = m.is_not(_b, _b);
|
||||
if (!m.is_or(_b)) return NO;
|
||||
app* b = to_app(_b);
|
||||
unsigned num = b->get_num_args();
|
||||
if (first) {
|
||||
bool visited = true;
|
||||
visit(a, visited);
|
||||
for (expr* arg : *b) {
|
||||
visit(arg, visited);
|
||||
}
|
||||
if (!visited)
|
||||
return CONT;
|
||||
}
|
||||
expr_ref la(m), nla(m), nlb(m), lb(m);
|
||||
get_lit(a, sign, la);
|
||||
inv(la, nla);
|
||||
expr_ref_buffer lits(m);
|
||||
lits.push_back(nla);
|
||||
for (expr* arg : *b) {
|
||||
get_lit(arg, false, lb);
|
||||
lits.push_back(lb);
|
||||
inv(lb, nlb);
|
||||
mk_clause(la, nlb);
|
||||
}
|
||||
mk_clause(lits.size(), lits.c_ptr());
|
||||
return DONE;
|
||||
}
|
||||
|
||||
mres match_iff(app * t, bool first, bool root) {
|
||||
expr * a, * b;
|
||||
|
@ -784,6 +816,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
TRY(match_or_3and);
|
||||
TRY(match_or);
|
||||
TRY(match_iff3);
|
||||
// TRY(match_iff_or);
|
||||
TRY(match_iff);
|
||||
TRY(match_ite);
|
||||
TRY(match_not);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue