Fix issue with lemma during equality engine iterator in sets (#6289)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 6 Apr 2021 12:28:59 +0000 (07:28 -0500)
committerGitHub <noreply@github.com>
Tue, 6 Apr 2021 12:28:59 +0000 (07:28 -0500)
Fixes #4370.

src/theory/sets/theory_sets_private.cpp
test/regress/CMakeLists.txt
test/regress/regress1/sets/issue4370-2-lemma-ee-iter.smt2 [new file with mode: 0644]
test/regress/regress1/sets/issue4370-4-lemma-ee-iter.smt2 [new file with mode: 0644]

index ea7e773b7dfff040a1d3a3529e1f04f0e0d403b1..bb4080578a7c34bdca7908eaeb338e81d5f0124a 100644 (file)
@@ -286,6 +286,10 @@ void TheorySetsPrivate::fullEffortCheck()
           d_card_enabled = true;
           // register it with the cardinality solver
           d_cardSolver->registerTerm(n);
+          if (d_im.hasSent())
+          {
+            break;
+          }
           // if we do not handle the kind, set incomplete
           Kind nk0 = n[0].getKind();
           // some kinds of cardinality we cannot handle
index 6bff05bdbe56ff29f9e38472da4f157197d2178c..49b7b05433da074933a38c138777fefbeb4e7e52 100644 (file)
@@ -1969,6 +1969,8 @@ set(regress_1_tests
   regress1/sets/issue2568.smt2
   regress1/sets/issue2904.smt2
   regress1/sets/issue4124-need-check.smt2
+  regress1/sets/issue4370-2-lemma-ee-iter.smt2
+  regress1/sets/issue4370-4-lemma-ee-iter.smt2
   regress1/sets/issue4391-card-lasso.smt2
   regress1/sets/issue5271.smt2
   regress1/sets/issue5309.smt2
diff --git a/test/regress/regress1/sets/issue4370-2-lemma-ee-iter.smt2 b/test/regress/regress1/sets/issue4370-2-lemma-ee-iter.smt2
new file mode 100644 (file)
index 0000000..aa73492
--- /dev/null
@@ -0,0 +1,7 @@
+(set-logic ALL)
+(set-info :status unsat)
+(declare-fun st1 () (Set Int))
+(declare-fun st7 () (Set Int))
+(assert (> 0 (card (intersection st1 (union st7 st1)))))
+(assert (subset st1 st7))
+(check-sat)
diff --git a/test/regress/regress1/sets/issue4370-4-lemma-ee-iter.smt2 b/test/regress/regress1/sets/issue4370-4-lemma-ee-iter.smt2
new file mode 100644 (file)
index 0000000..9542570
--- /dev/null
@@ -0,0 +1,8 @@
+(set-logic ALL)
+(set-info :status unsat)
+(declare-fun st3 () (Set String))
+(declare-fun st9 () (Set String))
+(assert (is_singleton (intersection st3 st9)))
+(assert (< 1 (card (intersection st3 st9))))
+(assert (is_singleton st9))
+(check-sat)