mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
z3str3: set up axioms on string terms that are added during the search
This commit is contained in:
parent
9ae1a6f061
commit
f91af02675
|
@ -8160,6 +8160,16 @@ namespace smt {
|
||||||
sort * rhs_sort = m.get_sort(rhs);
|
sort * rhs_sort = m.get_sort(rhs);
|
||||||
sort * str_sort = u.str.mk_string_sort();
|
sort * str_sort = u.str.mk_string_sort();
|
||||||
|
|
||||||
|
// Pick up new terms added during the search (e.g. recursive function expansion).
|
||||||
|
if (!existing_toplevel_exprs.contains(lhs)) {
|
||||||
|
existing_toplevel_exprs.insert(lhs);
|
||||||
|
set_up_axioms(lhs);
|
||||||
|
}
|
||||||
|
if (!existing_toplevel_exprs.contains(rhs)) {
|
||||||
|
existing_toplevel_exprs.insert(rhs);
|
||||||
|
set_up_axioms(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
if (lhs_sort != str_sort || rhs_sort != str_sort) {
|
if (lhs_sort != str_sort || rhs_sort != str_sort) {
|
||||||
TRACE("str", tout << "skip equality: not String sort" << std::endl;);
|
TRACE("str", tout << "skip equality: not String sort" << std::endl;);
|
||||||
return;
|
return;
|
||||||
|
@ -8615,7 +8625,12 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void theory_str::assign_eh(bool_var v, bool is_true) {
|
void theory_str::assign_eh(bool_var v, bool is_true) {
|
||||||
TRACE("str", tout << "assert: v" << v << " #" << get_context().bool_var2expr(v)->get_id() << " is_true: " << is_true << std::endl;);
|
expr * e = get_context().bool_var2expr(v);
|
||||||
|
TRACE("str", tout << "assert: v" << v << " " << mk_pp(e, get_manager()) << " is_true: " << is_true << std::endl;);
|
||||||
|
if (!existing_toplevel_exprs.contains(e)) {
|
||||||
|
existing_toplevel_exprs.insert(e);
|
||||||
|
set_up_axioms(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void theory_str::push_scope_eh() {
|
void theory_str::push_scope_eh() {
|
||||||
|
|
|
@ -346,6 +346,9 @@ protected:
|
||||||
// include an occurrence of the term for which axioms are being generated
|
// include an occurrence of the term for which axioms are being generated
|
||||||
obj_hashtable<expr> axiomatized_terms;
|
obj_hashtable<expr> axiomatized_terms;
|
||||||
|
|
||||||
|
// hashtable of all top-level exprs for which set_up_axioms() has been called
|
||||||
|
obj_hashtable<expr> existing_toplevel_exprs;
|
||||||
|
|
||||||
int tmpStringVarCount;
|
int tmpStringVarCount;
|
||||||
int tmpXorVarCount;
|
int tmpXorVarCount;
|
||||||
int tmpLenTestVarCount;
|
int tmpLenTestVarCount;
|
||||||
|
|
Loading…
Reference in a new issue