From c60ca4b7b42eb930030d88fc11d42c70708127d8 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Thu, 16 Jun 2011 02:19:27 +0000 Subject: [PATCH] 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 --- src/to-sat/AIG/ToSATAIG.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- 2.47.3