From: trevor_hansen Date: Thu, 16 Jun 2011 02:19:27 +0000 (+0000) Subject: Speedup for easy instances. Don't call the SAT solver if we already know the problem... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c60ca4b7b42eb930030d88fc11d42c70708127d8;p=francis%2Fstp.git Speedup for easy instances. Don't call the SAT solver if we already know the problem is true/false. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1339 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/to-sat/AIG/ToSATAIG.cpp b/src/to-sat/AIG/ToSATAIG.cpp index 2eabd58..5f096c6 100644 --- a/src/to-sat/AIG/ToSATAIG.cpp +++ b/src/to-sat/AIG/ToSATAIG.cpp @@ -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)