// cardinality
d_cardSolver->mkModelValueElementsFor(val, eqc, els, mvals, m);
}
+
Node rep = NormalForm::mkBop(kind::UNION, els, eqc.getType());
rep = Rewriter::rewrite(rep);
Trace("sets-model") << "* Assign representative of " << eqc << " to "
}
m->assertSkeleton(rep);
+ // we add the element terms (singletons) as representatives to tell the
+ // model builder to evaluate them along with their union (rep).
+ // This is needed to account for cases when members and rep are not enough
+ // for the model builder to evaluate set terms.
+ // e.g.
+ // eqc(rep) = [(union (singleton skolem) (singleton 0))]
+ // eqc(skolem) = [0]
+ // The model builder would fail to evaluate rep as (singleton 0)
+ // if (singleton skolem) is not registered as a representative in the
+ // model
+ for (const Node& el : els)
+ {
+ m->assertSkeleton(el);
+ }
+
Trace("sets-model") << "Set " << eqc << " = { " << traceElements(rep)
<< " }" << std::endl;
}
if (itMap != d_constantReps.end())
{
ri = (*itMap).second;
+ Trace("model-builder-debug") << i << ": const child " << ri << std::endl;
recurse = false;
}
else if (!evalOnly)
{
recurse = false;
+ Trace("model-builder-debug") << i << ": keep " << ri << std::endl;
}
}
+ else
+ {
+ Trace("model-builder-debug") << i << ": no hasTerm " << ri << std::endl;
+ }
if (recurse)
{
ri = normalize(m, ri, evalOnly);
regress1/sets/issue2568.smt2
regress1/sets/issue2904.smt2
regress1/sets/issue4391-card-lasso.smt2
+ regress1/sets/issue5309.smt2
regress1/sets/lemmabug-ListElts317minimized.smt2
regress1/sets/remove_check_free_31_6.smt2
regress1/sets/sets-disequal.smt2
--- /dev/null
+(set-logic ALL)
+(set-info :status sat)
+(declare-const zero Int)
+(declare-fun A () (Set Int))
+(assert (exists ((x Int)) (= A (singleton x))))
+(assert (member (- zero) A))
+(check-sat)