From d9d05fd0025138383555d5efc69bf461d513b8d8 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 8 Jun 2009 05:39:52 +0000 Subject: Add klee::createDummySolver, the dummy solver always fails. - Useful as an alternative backend to STP for testing. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73048 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Solver/Solver.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'lib/Solver') diff --git a/lib/Solver/Solver.cpp b/lib/Solver/Solver.cpp index 936f252d..98dcad0b 100644 --- a/lib/Solver/Solver.cpp +++ b/lib/Solver/Solver.cpp @@ -375,6 +375,41 @@ Solver *klee::createValidatingSolver(Solver *s, Solver *oracle) { /***/ +class DummySolverImpl : public SolverImpl { +public: + DummySolverImpl() {} + + bool computeValidity(const Query&, Solver::Validity &result) { + ++stats::queries; + // FIXME: We should have stats::queriesFail; + return false; + } + bool computeTruth(const Query&, bool &isValid) { + ++stats::queries; + // FIXME: We should have stats::queriesFail; + return false; + } + bool computeValue(const Query&, ref &result) { + ++stats::queries; + ++stats::queryCounterexamples; + return false; + } + bool computeInitialValues(const Query&, + const std::vector &objects, + std::vector< std::vector > &values, + bool &hasSolution) { + ++stats::queries; + ++stats::queryCounterexamples; + return false; + } +}; + +Solver *klee::createDummySolver() { + return new Solver(new DummySolverImpl()); +} + +/***/ + class STPSolverImpl : public SolverImpl { private: /// The solver we are part of, for access to public information. -- cgit 1.4.1