klee
ConstructSolverChain.cpp
Go to the documentation of this file.
1//===-- ConstructSolverChain.cpp ------------------------------------++ -*-===//
2//
3// The KLEE Symbolic Virtual Machine
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10/*
11 * This file groups declarations that are common to both KLEE and Kleaver.
12 */
13
14#include "klee/Solver/Common.h"
17#include "klee/System/Time.h"
18
19#include "llvm/Support/raw_ostream.h"
20
21
22namespace klee {
24 std::string querySMT2LogPath,
25 std::string baseSolverQuerySMT2LogPath,
26 std::string queryKQueryLogPath,
27 std::string baseSolverQueryKQueryLogPath) {
28 Solver *solver = coreSolver;
29 const time::Span minQueryTimeToLog(MinQueryTimeToLog);
30
32 solver = createKQueryLoggingSolver(solver, baseSolverQueryKQueryLogPath, minQueryTimeToLog, LogTimedOutQueries);
33 klee_message("Logging queries that reach solver in .kquery format to %s\n",
34 baseSolverQueryKQueryLogPath.c_str());
35 }
36
38 solver = createSMTLIBLoggingSolver(solver, baseSolverQuerySMT2LogPath, minQueryTimeToLog, LogTimedOutQueries);
39 klee_message("Logging queries that reach solver in .smt2 format to %s\n",
40 baseSolverQuerySMT2LogPath.c_str());
41 }
42
44 solver = createAssignmentValidatingSolver(solver);
45
47 solver = createFastCexSolver(solver);
48
49 if (UseCexCache)
50 solver = createCexCachingSolver(solver);
51
53 solver = createCachingSolver(solver);
54
56 solver = createIndependentSolver(solver);
57
59 solver = createValidatingSolver(solver, coreSolver);
60
62 solver = createKQueryLoggingSolver(solver, queryKQueryLogPath, minQueryTimeToLog, LogTimedOutQueries);
63 klee_message("Logging all queries in .kquery format to %s\n",
64 queryKQueryLogPath.c_str());
65 }
66
68 solver = createSMTLIBLoggingSolver(solver, querySMT2LogPath, minQueryTimeToLog, LogTimedOutQueries);
69 klee_message("Logging all queries in .smt2 format to %s\n",
70 querySMT2LogPath.c_str());
71 }
74 solver = createValidatingSolver(/*s=*/solver, /*oracle=*/oracleSolver);
75 }
76
77 return solver;
78}
79}
Definition: main.cpp:291
Solver * createCachingSolver(Solver *s)
Solver * constructSolverChain(Solver *coreSolver, std::string querySMT2LogPath, std::string baseSolverQuerySMT2LogPath, std::string queryKQueryLogPath, std::string baseSolverQueryKQueryLogPath)
Solver * createValidatingSolver(Solver *s, Solver *oracle)
llvm::cl::opt< bool > UseFastCexSolver
llvm::cl::opt< bool > LogTimedOutQueries
llvm::cl::opt< bool > DebugValidateSolver
void klee_message(const char *msg,...) __attribute__((format(printf
llvm::cl::opt< std::string > MinQueryTimeToLog
Solver * createKQueryLoggingSolver(Solver *s, std::string path, time::Span minQueryTimeToLog, bool logTimedOut)
@ SOLVER_SMTLIB
Log queries passed to solver in .smt2 (SMT-LIBv2) format.
Definition: SolverCmdLine.h:52
@ SOLVER_KQUERY
Log queries passed to solver in .kquery (KQuery) format.
Definition: SolverCmdLine.h:51
@ ALL_SMTLIB
Log all queries .smt2 (SMT-LIBv2) format.
Definition: SolverCmdLine.h:50
@ ALL_KQUERY
Log all queries in .kquery (KQuery) format.
Definition: SolverCmdLine.h:49
llvm::cl::opt< CoreSolverType > DebugCrossCheckCoreSolverWith
Solver * createAssignmentValidatingSolver(Solver *s)
Solver * createCexCachingSolver(Solver *s)
Solver * createFastCexSolver(Solver *s)
Solver * createCoreSolver(CoreSolverType cst)
Definition: CoreSolver.cpp:25
llvm::cl::opt< bool > UseAssignmentValidatingSolver
llvm::cl::opt< bool > UseIndependentSolver
@ NO_SOLVER
Definition: SolverCmdLine.h:62
Solver * createIndependentSolver(Solver *s)
Solver * createSMTLIBLoggingSolver(Solver *s, std::string path, time::Span minQueryTimeToLog, bool logTimedOut)
llvm::cl::opt< bool > UseCexCache
llvm::cl::bits< QueryLoggingSolverType > QueryLoggingOptions
llvm::cl::opt< bool > UseBranchCache