Do not track processed in remove term formulas loop (#5791)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 20 Jan 2021 15:56:02 +0000 (09:56 -0600)
committerGitHub <noreply@github.com>
Wed, 20 Jan 2021 15:56:02 +0000 (09:56 -0600)
The assertion/tracking was spurious, since an eliminated term may occur in multiple contexts.

Fixes #5728 (which I could not reproduce currently). Adds a regression from a duplicate of that issue.

src/smt/term_formula_removal.cpp
test/regress/CMakeLists.txt
test/regress/regress1/issue5739-rtf-processed.smt2 [new file with mode: 0644]

index 42166d074736ad6110ce671ac7ea69323855c781..f77ae7b49d4077d11fc721cdbde96872e4a13aff 100644 (file)
@@ -69,12 +69,9 @@ theory::TrustNode RemoveTermFormulas::run(
   if (fixedPoint)
   {
     size_t i = 0;
-    std::unordered_set<Node, NodeHashFunction> processed;
     while (i < newAsserts.size())
     {
       theory::TrustNode trn = newAsserts[i];
-      AlwaysAssert(processed.find(trn.getProven()) == processed.end());
-      processed.insert(trn.getProven());
       // do not run to fixed point on subcall, since we are processing all
       // lemmas in this loop
       newAsserts[i] = runLemma(trn, newAsserts, newSkolems, false);
index 328f7df8c8e0fcd658f849d2e925b5ca475faa26..1c51a6c059ed3d9376645ba4b135426f7ea7a5c3 100644 (file)
@@ -1545,6 +1545,7 @@ set(regress_1_tests
   regress1/issue3990-sort-inference.smt2
   regress1/issue4273-ext-rew-cache.smt2
   regress1/issue4335-unsat-core.smt2
+  regress1/issue5739-rtf-processed.smt2 
   regress1/lemmas/clocksynchro_5clocks.main_invar.base.smtv1.smt2
   regress1/lemmas/pursuit-safety-8.smtv1.smt2
   regress1/lemmas/simple_startup_9nodes.abstract.base.smtv1.smt2
diff --git a/test/regress/regress1/issue5739-rtf-processed.smt2 b/test/regress/regress1/issue5739-rtf-processed.smt2
new file mode 100644 (file)
index 0000000..9ee876e
--- /dev/null
@@ -0,0 +1,14 @@
+; COMMAND-LINE: --cegqi-full
+; EXPECT: unsat
+(set-logic ALL)
+(set-info :status unsat)
+(assert
+ (not
+  (exists
+   ((a (_ BitVec 32))
+    (b (_ BitVec 32))
+    (c (_ BitVec 32))
+    (d (_ BitVec 32))
+    (e (_ BitVec 32)))
+   (distinct (bvashr c b) (bvlshr d a) e))))
+(check-sat)