mirror of
https://github.com/Z3Prover/z3
synced 2025-06-04 05:11:21 +00:00
parent
8248ec879e
commit
e96f9de70b
3 changed files with 14 additions and 6 deletions
|
@ -435,7 +435,7 @@ void seq_decl_plugin::match_right_assoc(psig& sig, unsigned dsz, sort *const* do
|
||||||
}
|
}
|
||||||
|
|
||||||
void seq_decl_plugin::match(psig& sig, unsigned dsz, sort *const* dom, sort* range, sort_ref& range_out) {
|
void seq_decl_plugin::match(psig& sig, unsigned dsz, sort *const* dom, sort* range, sort_ref& range_out) {
|
||||||
ptr_vector<sort> binding;
|
m_binding.reset();
|
||||||
ast_manager& m = *m_manager;
|
ast_manager& m = *m_manager;
|
||||||
if (sig.m_dom.size() != dsz) {
|
if (sig.m_dom.size() != dsz) {
|
||||||
std::ostringstream strm;
|
std::ostringstream strm;
|
||||||
|
@ -445,10 +445,10 @@ void seq_decl_plugin::match(psig& sig, unsigned dsz, sort *const* dom, sort* ran
|
||||||
}
|
}
|
||||||
bool is_match = true;
|
bool is_match = true;
|
||||||
for (unsigned i = 0; is_match && i < dsz; ++i) {
|
for (unsigned i = 0; is_match && i < dsz; ++i) {
|
||||||
is_match = match(binding, dom[i], sig.m_dom[i].get());
|
is_match = match(m_binding, dom[i], sig.m_dom[i].get());
|
||||||
}
|
}
|
||||||
if (range && is_match) {
|
if (range && is_match) {
|
||||||
is_match = match(binding, range, sig.m_range);
|
is_match = match(m_binding, range, sig.m_range);
|
||||||
}
|
}
|
||||||
if (!is_match) {
|
if (!is_match) {
|
||||||
std::ostringstream strm;
|
std::ostringstream strm;
|
||||||
|
@ -474,7 +474,7 @@ void seq_decl_plugin::match(psig& sig, unsigned dsz, sort *const* dom, sort* ran
|
||||||
strm << "is ambiguous. Function takes no arguments and sort of range has not been constrained";
|
strm << "is ambiguous. Function takes no arguments and sort of range has not been constrained";
|
||||||
m.raise_exception(strm.str().c_str());
|
m.raise_exception(strm.str().c_str());
|
||||||
}
|
}
|
||||||
range_out = apply_binding(binding, sig.m_range);
|
range_out = apply_binding(m_binding, sig.m_range);
|
||||||
SASSERT(range_out);
|
SASSERT(range_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,7 @@ class seq_decl_plugin : public decl_plugin {
|
||||||
};
|
};
|
||||||
|
|
||||||
ptr_vector<psig> m_sigs;
|
ptr_vector<psig> m_sigs;
|
||||||
|
ptr_vector<sort> m_binding;
|
||||||
bool m_init;
|
bool m_init;
|
||||||
symbol m_stringc_sym;
|
symbol m_stringc_sym;
|
||||||
symbol m_charc_sym;
|
symbol m_charc_sym;
|
||||||
|
|
|
@ -5553,8 +5553,15 @@ void theory_seq::propagate_accept(literal lit, expr* acc) {
|
||||||
void theory_seq::add_theory_assumptions(expr_ref_vector & assumptions) {
|
void theory_seq::add_theory_assumptions(expr_ref_vector & assumptions) {
|
||||||
TRACE("seq", tout << "add_theory_assumption " << m_util.has_re() << "\n";);
|
TRACE("seq", tout << "add_theory_assumption " << m_util.has_re() << "\n";);
|
||||||
if (m_util.has_re()) {
|
if (m_util.has_re()) {
|
||||||
expr_ref dlimit = mk_max_unfolding_depth();
|
expr_ref dlimit(m);
|
||||||
m_max_unfolding_lit = mk_literal(dlimit);
|
if (m_max_unfolding_lit != null_literal &&
|
||||||
|
m_max_unfolding_depth == 1) {
|
||||||
|
dlimit = mk_max_unfolding_depth();
|
||||||
|
m_max_unfolding_lit = mk_literal(dlimit);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dlimit = get_context().bool_var2expr(m_max_unfolding_lit.var());
|
||||||
|
}
|
||||||
TRACE("seq", tout << "add_theory_assumption " << dlimit << " " << assumptions << "\n";);
|
TRACE("seq", tout << "add_theory_assumption " << dlimit << " " << assumptions << "\n";);
|
||||||
assumptions.push_back(dlimit);
|
assumptions.push_back(dlimit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue