klee
CoreSolver.cpp
Go to the documentation of this file.
1//===-- CoreSolver.cpp ------------------------------------------*- C++ -*-===//
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#include "STPSolver.h"
11#include "Z3Solver.h"
12#include "MetaSMTSolver.h"
13
16#include "klee/Solver/Solver.h"
17
18#include "llvm/Support/ErrorHandling.h"
19#include "llvm/Support/raw_ostream.h"
20
21#include <string>
22
23namespace klee {
24
26 switch (cst) {
27 case STP_SOLVER:
28#ifdef ENABLE_STP
29 klee_message("Using STP solver backend");
31#else
32 klee_message("Not compiled with STP support");
33 return NULL;
34#endif
35 case METASMT_SOLVER:
36#ifdef ENABLE_METASMT
37 klee_message("Using MetaSMT solver backend");
38 return createMetaSMTSolver();
39#else
40 klee_message("Not compiled with MetaSMT support");
41 return NULL;
42#endif
43 case DUMMY_SOLVER:
44 return createDummySolver();
45 case Z3_SOLVER:
46#ifdef ENABLE_Z3
47 klee_message("Using Z3 solver backend");
48 return new Z3Solver();
49#else
50 klee_message("Not compiled with Z3 support");
51 return NULL;
52#endif
53 case NO_SOLVER:
54 klee_message("Invalid solver");
55 return NULL;
56 default:
57 llvm_unreachable("Unsupported CoreSolverType");
58 }
59}
60}
STPSolver - A complete solver based on STP.
Definition: STPSolver.h:18
Z3Solver - A complete solver based on Z3.
Definition: Z3Solver.h:18
Definition: main.cpp:291
Solver * createMetaSMTSolver()
void klee_message(const char *msg,...) __attribute__((format(printf
Solver * createDummySolver()
Definition: DummySolver.cpp:62
Solver * createCoreSolver(CoreSolverType cst)
Definition: CoreSolver.cpp:25
CoreSolverType
Definition: SolverCmdLine.h:57
@ NO_SOLVER
Definition: SolverCmdLine.h:62
@ METASMT_SOLVER
Definition: SolverCmdLine.h:59
@ Z3_SOLVER
Definition: SolverCmdLine.h:61
@ STP_SOLVER
Definition: SolverCmdLine.h:58
@ DUMMY_SOLVER
Definition: SolverCmdLine.h:60
llvm::cl::opt< bool > UseForkedCoreSolver
llvm::cl::opt< bool > CoreSolverOptimizeDivides