mirror of
https://github.com/Z3Prover/z3
synced 2025-08-20 02:00:22 +00:00
add stub for cheap equality propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6a45c5d17c
commit
d372af4782
13 changed files with 131 additions and 105 deletions
|
@ -64,22 +64,21 @@ namespace smt {
|
|||
expr* s = nullptr, *r = nullptr;
|
||||
expr* e = ctx.bool_var2expr(lit.var());
|
||||
expr_ref id(a().mk_int(e->get_id()), m);
|
||||
unsigned idx = 0;
|
||||
VERIFY(str().is_in_re(e, s, r));
|
||||
sort* seq_sort = m.get_sort(s);
|
||||
vector<expr_ref_vector> patterns;
|
||||
auto mk_cont = [&](unsigned idx) {
|
||||
auto mk_cont = [&](unsigned idx) {
|
||||
return sk().mk("seq.cont", id, a().mk_int(idx), seq_sort);
|
||||
};
|
||||
unsigned idx = 0;
|
||||
if (seq_rw().is_re_contains_pattern(r, patterns)) {
|
||||
expr_ref t(m);
|
||||
expr_ref_vector ts(m);
|
||||
ts.push_back(mk_cont(idx));
|
||||
for (auto const& p : patterns) {
|
||||
ts.append(p);
|
||||
ts.push_back(mk_cont(++idx));
|
||||
}
|
||||
t = th.mk_concat(ts, seq_sort);
|
||||
expr_ref t = th.mk_concat(ts, seq_sort);
|
||||
th.propagate_eq(lit, s, t, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1012,6 +1012,7 @@ public:
|
|||
}
|
||||
|
||||
bool internalize_atom(app * atom, bool gate_ctx) {
|
||||
TRACE("arith", tout << mk_pp(atom, m) << "\n";);
|
||||
SASSERT(!ctx().b_internalized(atom));
|
||||
expr* n1, *n2;
|
||||
rational r;
|
||||
|
@ -1722,7 +1723,9 @@ public:
|
|||
final_check_status st = FC_DONE;
|
||||
switch (is_sat) {
|
||||
case l_true:
|
||||
TRACE("arith", display(tout););
|
||||
TRACE("arith", /*display(tout);*/
|
||||
ctx().display(tout);
|
||||
);
|
||||
switch (check_lia()) {
|
||||
case l_true:
|
||||
break;
|
||||
|
|
|
@ -1173,6 +1173,8 @@ bool theory_seq::reduce_length(unsigned i, unsigned j, bool front, expr_ref_vect
|
|||
expr_ref lenl = mk_len(l);
|
||||
expr_ref lenr = mk_len(r);
|
||||
literal lit = mk_eq(lenl, lenr, false);
|
||||
ctx.mark_as_relevant(lit);
|
||||
|
||||
if (ctx.get_assignment(lit) == l_true) {
|
||||
expr_ref_vector lhs(m), rhs(m);
|
||||
lhs.append(l2, ls2);
|
||||
|
@ -2753,7 +2755,6 @@ bool theory_seq::lower_bound(expr* e, rational& lo) const {
|
|||
VERIFY(m_autil.is_int(e));
|
||||
bool is_strict = true;
|
||||
return m_arith_value.get_lo(e, lo, is_strict) && !is_strict && lo.is_int();
|
||||
|
||||
}
|
||||
|
||||
bool theory_seq::upper_bound(expr* e, rational& hi) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue