klee
SolverImpl.cpp
Go to the documentation of this file.
1//===-- SolverImpl.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#include "klee/Solver/Solver.h"
12
13using namespace klee;
14
15SolverImpl::~SolverImpl() {}
16
18 bool isTrue, isFalse;
19 if (!computeTruth(query, isTrue))
20 return false;
21 if (isTrue) {
22 result = Solver::True;
23 } else {
24 if (!computeTruth(query.negateExpr(), isFalse))
25 return false;
26 result = isFalse ? Solver::False : Solver::Unknown;
27 }
28 return true;
29}
30
32 switch (statusCode) {
34 return "OPERATION SUCCESSFUL, QUERY IS SOLVABLE";
36 return "OPERATION SUCCESSFUL, QUERY IS UNSOLVABLE";
38 return "OPERATION FAILED";
40 return "SOLVER TIMEOUT";
42 return "FORK FAILED";
44 return "SOLVER PROCESS INTERRUPTED";
46 return "UNEXPECTED SOLVER PROCESS EXIT CODE";
48 return "WAITPID FAILED FOR SOLVER PROCESS";
49 default:
50 return "UNRECOGNIZED OPERATION STATUS";
51 }
52}
static const char * getOperationStatusString(SolverRunStatus statusCode)
Definition: SolverImpl.cpp:31
virtual bool computeTruth(const Query &query, bool &isValid)=0
@ SOLVER_RUN_STATUS_WAITPID_FAILED
Definition: SolverImpl.h:41
@ SOLVER_RUN_STATUS_INTERRUPTED
Definition: SolverImpl.h:39
@ SOLVER_RUN_STATUS_SUCCESS_SOLVABLE
Definition: SolverImpl.h:34
@ SOLVER_RUN_STATUS_FORK_FAILED
Definition: SolverImpl.h:38
@ SOLVER_RUN_STATUS_SUCCESS_UNSOLVABLE
Definition: SolverImpl.h:35
@ SOLVER_RUN_STATUS_FAILURE
Definition: SolverImpl.h:36
@ SOLVER_RUN_STATUS_UNEXPECTED_EXIT_CODE
Definition: SolverImpl.h:40
@ SOLVER_RUN_STATUS_TIMEOUT
Definition: SolverImpl.h:37
virtual bool computeValidity(const Query &query, Solver::Validity &result)
Definition: SolverImpl.cpp:17
Definition: main.cpp:291
Query negateExpr() const
negateExpr - Return a copy of the query with the expression negated.
Definition: Solver.h:52