klee
|
#include <Solver.h>
Public Types | |
enum | Validity { True = 1 , False = -1 , Unknown = 0 } |
Public Member Functions | |
Solver (SolverImpl *_impl) | |
virtual | ~Solver () |
bool | evaluate (const Query &, Validity &result) |
bool | mustBeTrue (const Query &, bool &result) |
bool | mustBeFalse (const Query &, bool &result) |
bool | mayBeTrue (const Query &, bool &result) |
bool | mayBeFalse (const Query &, bool &result) |
bool | getValue (const Query &, ref< ConstantExpr > &result) |
bool | getInitialValues (const Query &, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &result) |
virtual std::pair< ref< Expr >, ref< Expr > > | getRange (const Query &) |
virtual char * | getConstraintLog (const Query &query) |
virtual void | setCoreSolverTimeout (time::Span timeout) |
Static Public Member Functions | |
static const char * | validity_to_str (Validity v) |
validity_to_str - Return the name of given Validity enum value. More... | |
Public Attributes | |
SolverImpl * | impl |
Private Member Functions | |
Solver (const Solver &) | |
void | operator= (const Solver &) |
|
private |
|
inline |
|
virtual |
Definition at line 25 of file Solver.cpp.
References impl.
evaluate - Determine for a particular state if the query expression is provably true, provably false or neither.
[out] | result | - if then Solver::True, else if then Solver::False, else Solver::Unknown |
Definition at line 37 of file Solver.cpp.
References klee::Expr::Bool, klee::SolverImpl::computeValidity(), klee::Query::expr, False, klee::Expr::getWidth(), impl, and True.
Referenced by getRange().
|
virtual |
Reimplemented in klee::MetaSMTSolver< SolverContext >, klee::STPSolver, and klee::Z3Solver.
Definition at line 29 of file Solver.cpp.
References klee::SolverImpl::getConstraintLog(), and impl.
Referenced by klee::AssignmentValidatingSolver::dumpAssignmentQuery().
bool Solver::getInitialValues | ( | const Query & | query, |
const std::vector< const Array * > & | objects, | ||
std::vector< std::vector< unsigned char > > & | result | ||
) |
getInitialValues - Compute the initial values for a list of objects.
[out] | result | - On success, this vector will be filled in with an array of bytes for each given object (with length matching the object size). The bytes correspond to the initial values for the objects for some satisfying assignment. |
NOTE: This function returns failure if there is no satisfying assignment.
Definition at line 98 of file Solver.cpp.
References klee::SolverImpl::computeInitialValues(), and impl.
Referenced by EvaluateInputAST().
getRange - Compute a tight range of possible values for a given expression.
Definition at line 111 of file Solver.cpp.
References klee::ConstantExpr::create(), evaluate(), klee::Query::expr, False, klee::Expr::getWidth(), klee::bits64::maxValueOfNBits(), mayBeTrue(), mustBeTrue(), True, and klee::Query::withExpr().
bool Solver::getValue | ( | const Query & | query, |
ref< ConstantExpr > & | result | ||
) |
getValue - Compute one possible value for the given expression.
[out] | result | - On success, a value for the expression in some satisfying assignment. |
Definition at line 81 of file Solver.cpp.
References klee::SolverImpl::computeValue(), klee::Query::expr, and impl.
Referenced by klee::ImpliedValue::checkForImpliedValues(), and EvaluateInputAST().
bool Solver::mayBeFalse | ( | const Query & | query, |
bool & | result | ||
) |
mayBeFalse - Determine if there is a valid assignment for the given state in which the expression evaluates to false.
This evaluates the following logical formula:
which is equivalent to
Where is some assignment, are the constraints in the query and is the query expression.
[out] | result | - On success, true iff the logical formula may be false |
Definition at line 73 of file Solver.cpp.
References mustBeTrue().
bool Solver::mayBeTrue | ( | const Query & | query, |
bool & | result | ||
) |
mayBeTrue - Determine if there is a valid assignment for the given state in which the expression evaluates to true.
This evaluates the following logical formula:
which is equivalent to
Where is some assignment, are the constraints in the query and is the query expression.
[out] | result | - On success, true iff the logical formula may be true |
Definition at line 65 of file Solver.cpp.
References mustBeFalse().
Referenced by getRange().
bool Solver::mustBeFalse | ( | const Query & | query, |
bool & | result | ||
) |
mustBeFalse - Determine if the expression is provably false.
This evaluates the following logical formula:
which is equivalent to
Where is some assignment, are the constraints in the query and is the query expression.
[out] | result | - On success, true iff the logical formula is false |
Definition at line 61 of file Solver.cpp.
References mustBeTrue(), and klee::Query::negateExpr().
Referenced by mayBeTrue().
bool Solver::mustBeTrue | ( | const Query & | query, |
bool & | result | ||
) |
mustBeTrue - Determine if the expression is provably true.
This evaluates the following logical formula:
which is equivalent to
Where is some assignment, are the constraints in the query and is the query expression.
[out] | result | - On success, true iff the logical formula is true |
Definition at line 49 of file Solver.cpp.
References klee::Expr::Bool, klee::SolverImpl::computeTruth(), klee::Query::expr, klee::Expr::getWidth(), and impl.
Referenced by klee::ImpliedValue::checkForImpliedValues(), EvaluateInputAST(), getRange(), mayBeFalse(), and mustBeFalse().
|
private |
|
virtual |
Reimplemented in klee::MetaSMTSolver< SolverContext >, klee::STPSolver, and klee::Z3Solver.
Definition at line 33 of file Solver.cpp.
References impl, and klee::SolverImpl::setCoreSolverTimeout().
Referenced by EvaluateInputAST().
|
static |
validity_to_str - Return the name of given Validity enum value.
Definition at line 17 of file Solver.cpp.
SolverImpl* klee::Solver::impl |
Definition at line 77 of file Solver.h.
Referenced by klee::StagedSolverImpl::computeInitialValues(), klee::AssignmentValidatingSolver::computeInitialValues(), klee::ValidatingSolver::computeInitialValues(), CachingSolver::computeInitialValues(), IndependentSolver::computeInitialValues(), QueryLoggingSolver::computeInitialValues(), klee::StagedSolverImpl::computeTruth(), klee::AssignmentValidatingSolver::computeTruth(), CachingSolver::computeTruth(), IndependentSolver::computeTruth(), klee::ValidatingSolver::computeTruth(), QueryLoggingSolver::computeTruth(), klee::StagedSolverImpl::computeValidity(), klee::AssignmentValidatingSolver::computeValidity(), CachingSolver::computeValidity(), IndependentSolver::computeValidity(), klee::ValidatingSolver::computeValidity(), QueryLoggingSolver::computeValidity(), klee::StagedSolverImpl::computeValue(), klee::AssignmentValidatingSolver::computeValue(), IndependentSolver::computeValue(), klee::ValidatingSolver::computeValue(), CachingSolver::computeValue(), QueryLoggingSolver::computeValue(), evaluate(), EvaluateInputAST(), QueryLoggingSolver::finishQuery(), QueryLoggingSolver::flushBuffer(), CexCachingSolver::getAssignment(), klee::StagedSolverImpl::getConstraintLog(), klee::AssignmentValidatingSolver::getConstraintLog(), CachingSolver::getConstraintLog(), IndependentSolver::getConstraintLog(), QueryLoggingSolver::getConstraintLog(), klee::ValidatingSolver::getConstraintLog(), getConstraintLog(), CexCachingSolver::getConstraintLog(), getInitialValues(), klee::StagedSolverImpl::getOperationStatusCode(), klee::AssignmentValidatingSolver::getOperationStatusCode(), CachingSolver::getOperationStatusCode(), CexCachingSolver::getOperationStatusCode(), IndependentSolver::getOperationStatusCode(), QueryLoggingSolver::getOperationStatusCode(), klee::ValidatingSolver::getOperationStatusCode(), getValue(), mustBeTrue(), klee::StagedSolverImpl::setCoreSolverTimeout(), setCoreSolverTimeout(), klee::AssignmentValidatingSolver::setCoreSolverTimeout(), CachingSolver::setCoreSolverTimeout(), CexCachingSolver::setCoreSolverTimeout(), IndependentSolver::setCoreSolverTimeout(), QueryLoggingSolver::setCoreSolverTimeout(), klee::ValidatingSolver::setCoreSolverTimeout(), and ~Solver().