mirror of
https://github.com/Z3Prover/z3
synced 2025-07-29 07:27:57 +00:00
fix #2650, use datatype constructor producing smallest possible tree whenever possible
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b0bf2f1792
commit
02e71c7d23
5 changed files with 55 additions and 41 deletions
|
@ -885,6 +885,7 @@ namespace smt {
|
|||
unassigned_idx = idx;
|
||||
num_unassigned++;
|
||||
}
|
||||
TRACE("datatype", tout << "propagate " << num_unassigned << " eqs: " << eqs.size() << "\n";);
|
||||
if (num_unassigned == 0) {
|
||||
// conflict
|
||||
SASSERT(!lits.empty());
|
||||
|
@ -938,13 +939,13 @@ namespace smt {
|
|||
enode * n = get_enode(v);
|
||||
sort * s = m.get_sort(n->get_owner());
|
||||
func_decl * non_rec_c = m_util.get_non_rec_constructor(s);
|
||||
TRACE("datatype_bug", tout << "non_rec_c: " << non_rec_c->get_name() << "\n";);
|
||||
unsigned non_rec_idx = m_util.get_constructor_idx(non_rec_c);
|
||||
var_data * d = m_var_data[v];
|
||||
SASSERT(d->m_constructor == nullptr);
|
||||
func_decl * r = nullptr;
|
||||
m_stats.m_splits++;
|
||||
|
||||
TRACE("datatype_bug", tout << "non_rec_c: " << non_rec_c->get_name() << " #rec: " << d->m_recognizers.size() << "\n";);
|
||||
|
||||
if (d->m_recognizers.empty()) {
|
||||
r = m_util.get_constructor_is(non_rec_c);
|
||||
|
@ -987,7 +988,7 @@ namespace smt {
|
|||
return; // all recognizers are asserted to false... conflict will be detected...
|
||||
}
|
||||
}
|
||||
SASSERT(r != 0);
|
||||
SASSERT(r != nullptr);
|
||||
app * r_app = m.mk_app(r, n->get_owner());
|
||||
TRACE("datatype", tout << "creating split: " << mk_pp(r_app, m) << "\n";);
|
||||
ctx.internalize(r_app, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue