std::vector<Node>& curr,
std::vector<Node>& exp)
{
+ Trace("sets-cycle-debug") << "Traverse eqc " << eqc << std::endl;
NodeManager* nm = NodeManager::currentNM();
if (std::find(curr.begin(), curr.end(), eqc) != curr.end())
{
{
// all regions must be equal
std::vector<Node> conc;
+ bool foundLoopStart = false;
for (const Node& cc : curr)
{
- conc.push_back(curr[0].eqNode(cc));
+ if (cc == eqc)
+ {
+ foundLoopStart = true;
+ }
+ else if (foundLoopStart && eqc != cc)
+ {
+ conc.push_back(eqc.eqNode(cc));
+ }
}
Node fact = conc.size() == 1 ? conc[0] : nm->mkNode(AND, conc);
+ Trace("sets-cycle-debug")
+ << "CYCLE: " << fact << " from " << exp << std::endl;
d_im.assertInference(fact, exp, "card_cycle");
d_im.flushPendingLemmas();
}
exp.push_back(eqc.eqNode(n));
for (const Node& cpnc : d_card_parent[n])
{
+ Trace("sets-cycle-debug")
+ << "Traverse card parent " << eqc << " -> " << cpnc << std::endl;
checkCardCyclesRec(cpnc, curr, exp);
if (d_im.hasProcessed())
{
regress1/sets/insert_invariant_37_2.smt2
regress1/sets/issue2568.smt2
regress1/sets/issue2904.smt2
+ regress1/sets/issue4391-card-lasso.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-fun d () Int)
+(declare-fun b () (Set Int))
+(declare-fun c () (Set Int))
+(declare-fun e () (Set Int))
+
+(assert (= e (union b e)))
+(assert (= (card b) d))
+(assert (= (card c) 0))
+(assert (= 0 (mod 0 d)))
+(assert (> (card (setminus e (intersection (intersection e b) (setminus e c)))) 1))
+
+(check-sat)