mirror of
https://github.com/Z3Prover/z3
synced 2025-10-10 09:48:05 +00:00
initial pass at using derivatives in regex unfolding
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b7b8ed23fb
commit
eb3f20832e
11 changed files with 694 additions and 228 deletions
|
@ -299,6 +299,7 @@ theory_seq::theory_seq(context& ctx):
|
|||
m_sk(m, m_rewrite),
|
||||
m_ax(*this, m_rewrite),
|
||||
m_unicode(*this),
|
||||
m_regex(*this),
|
||||
m_arith_value(m),
|
||||
m_trail_stack(*this),
|
||||
m_ls(m), m_rs(m),
|
||||
|
@ -367,6 +368,10 @@ final_check_status theory_seq::final_check_eh() {
|
|||
TRACEFIN("solve_nqs");
|
||||
return FC_CONTINUE;
|
||||
}
|
||||
if (m_regex.propagate()) {
|
||||
TRACEFIN("regex propagate");
|
||||
return FC_CONTINUE;
|
||||
}
|
||||
if (check_contains()) {
|
||||
++m_stats.m_propagate_contains;
|
||||
TRACEFIN("propagate_contains");
|
||||
|
@ -2617,6 +2622,7 @@ expr_ref theory_seq::add_elim_string_axiom(expr* n) {
|
|||
}
|
||||
|
||||
void theory_seq::propagate_in_re(expr* n, bool is_true) {
|
||||
|
||||
TRACE("seq", tout << mk_pp(n, m) << " <- " << (is_true?"true":"false") << "\n";);
|
||||
|
||||
expr_ref tmp(n, m);
|
||||
|
@ -3053,7 +3059,12 @@ void theory_seq::assign_eh(bool_var v, bool is_true) {
|
|||
}
|
||||
}
|
||||
else if (m_util.str.is_in_re(e)) {
|
||||
propagate_in_re(e, is_true);
|
||||
if (ctx.get_fparams().m_seq_use_derivatives) {
|
||||
m_regex.propagate_in_re(lit);
|
||||
}
|
||||
else {
|
||||
propagate_in_re(e, is_true);
|
||||
}
|
||||
}
|
||||
else if (m_sk.is_digit(e)) {
|
||||
// no-op
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue