Forcing rewrite pass rather than asserting if formula has been rewritten (#3748)
authorHaniel Barbosa <hanielbbarbosa@gmail.com>
Fri, 14 Feb 2020 03:50:00 +0000 (00:50 -0300)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 03:50:00 +0000 (19:50 -0800)
This ensures that users or developers don't accidentally break the solver either via options or changing the SMT engine flow so that the formula is not rewritten up to a given point.

src/smt/smt_engine.cpp

index 4a7c9def3653af0fe77aa309134203990c79e5bc..ad4d4e1d55b5722b770ae4ec752c547f713b78eb 100644 (file)
@@ -3331,24 +3331,15 @@ void SmtEnginePrivate::processAssertions() {
     d_passes["bv-intro-pow2"]->apply(&d_assertions);
   }
 
-  if (options::unsatCores())
-  {
-    // special rewriting pass for unsat cores, since many of the passes below
-    // are skipped
-    d_passes["rewrite"]->apply(&d_assertions);
-  }
-  else
+  // Since this pass is not robust for the information tracking necessary for
+  // unsat cores, it's only applied if we are not doing unsat core computation
+  if (!options::unsatCores())
   {
     d_passes["apply-substs"]->apply(&d_assertions);
   }
 
-  // Assertions ARE guaranteed to be rewritten by this point
-#ifdef CVC4_ASSERTIONS
-  for (unsigned i = 0; i < d_assertions.size(); ++i)
-  {
-    Assert(Rewriter::rewrite(d_assertions[i]) == d_assertions[i]);
-  }
-#endif
+  // Assertions MUST BE guaranteed to be rewritten by this point
+  d_passes["rewrite"]->apply(&d_assertions);
 
   // Lift bit-vectors of size 1 to bool
   if (options::bitvectorToBool())