]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Speedup for easy instances. Don't call the SAT solver if we already know the problem...
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 16 Jun 2011 02:19:27 +0000 (02:19 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 16 Jun 2011 02:19:27 +0000 (02:19 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1339 e59a4935-1847-0410-ae03-e826735625c1

src/to-sat/AIG/ToSATAIG.cpp

index 2eabd588364163e54fee6c7463d771de68437b78..5f096c67609b94d9dc7da17f82f60c02d0b32f90 100644 (file)
@@ -8,7 +8,15 @@ namespace BEEV
     bool
     ToSATAIG::CallSAT(SATSolver& satSolver, const ASTNode& input, bool needAbsRef)
     {
-      if (cb != NULL  && cb->isUnsatisfiable())
+       // Shortcut if known. This avoids calling the setup of the CNF generator.
+       // setup takes about 15ms.
+       if (input == ASTFalse && !needAbsRef)
+               return false;
+
+       if (input == ASTTrue && !needAbsRef)
+               return true;
+
+     if (cb != NULL  && cb->isUnsatisfiable())
         return false;
 
       if (simp == NULL)