klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
klee::SolverImpl Class Referenceabstract

SolverImpl - Abstract base clase for solver implementations. More...

#include <SolverImpl.h>

Inheritance diagram for klee::SolverImpl:

Public Types

enum  SolverRunStatus {
  SOLVER_RUN_STATUS_SUCCESS_SOLVABLE, SOLVER_RUN_STATUS_SUCCESS_UNSOLVABLE, SOLVER_RUN_STATUS_FAILURE, SOLVER_RUN_STATUS_TIMEOUT,
  SOLVER_RUN_STATUS_FORK_FAILED, SOLVER_RUN_STATUS_INTERRUPTED, SOLVER_RUN_STATUS_UNEXPECTED_EXIT_CODE, SOLVER_RUN_STATUS_WAITPID_FAILED
}
 

Public Member Functions

 SolverImpl ()
 
virtual ~SolverImpl ()
 
virtual bool computeValidity (const Query &query, Solver::Validity &result)
 
virtual bool computeTruth (const Query &query, bool &isValid)=0
 
virtual bool computeValue (const Query &query, ref< Expr > &result)=0
 
virtual bool computeInitialValues (const Query &query, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &values, bool &hasSolution)=0
 
virtual SolverRunStatus getOperationStatusCode ()=0
 getOperationStatusCode - get the status of the last solver operation More...
 
virtual char * getConstraintLog (const Query &query)
 
virtual void setCoreSolverTimeout (double timeout)
 

Static Public Member Functions

static const char * getOperationStatusString (SolverRunStatus statusCode)
 

Private Member Functions

 SolverImpl (const SolverImpl &)
 
void operator= (const SolverImpl &)
 

Detailed Description

SolverImpl - Abstract base clase for solver implementations.

Definition at line 22 of file SolverImpl.h.

Member Enumeration Documentation

Enumerator
SOLVER_RUN_STATUS_SUCCESS_SOLVABLE 
SOLVER_RUN_STATUS_SUCCESS_UNSOLVABLE 
SOLVER_RUN_STATUS_FAILURE 
SOLVER_RUN_STATUS_TIMEOUT 
SOLVER_RUN_STATUS_FORK_FAILED 
SOLVER_RUN_STATUS_INTERRUPTED 
SOLVER_RUN_STATUS_UNEXPECTED_EXIT_CODE 
SOLVER_RUN_STATUS_WAITPID_FAILED 

Definition at line 31 of file SolverImpl.h.

Constructor & Destructor Documentation

klee::SolverImpl::SolverImpl ( const SolverImpl )
private
klee::SolverImpl::SolverImpl ( )
inline

Definition at line 28 of file SolverImpl.h.

SolverImpl::~SolverImpl ( )
virtual

Definition at line 70 of file Solver.cpp.

Member Function Documentation

virtual bool klee::SolverImpl::computeInitialValues ( const Query query,
const std::vector< const Array * > &  objects,
std::vector< std::vector< unsigned char > > &  values,
bool &  hasSolution 
)
pure virtual
virtual bool klee::SolverImpl::computeTruth ( const Query query,
bool &  isValid 
)
pure virtual

computeTruth - Determine whether the given query expression is provably true given the constraints.

The query expression is guaranteed to be non-constant and have bool type.

This method should evaluate the logical formula:

\[ \forall X constraints(X) \to query(X) \]

Where $X$ is some assignment, $constraints(X)$ are the constraints in the query and $query(X)$ is the query expression.

Parameters
[out]isValid- On success, true iff the logical formula is true.
Returns
True on success

Implemented in STPSolverImpl, DummySolverImpl, ValidatingSolver, IndependentSolver, klee::StagedSolverImpl, CexCachingSolver, CachingSolver, and QueryLoggingSolver.

Referenced by QueryLoggingSolver::computeTruth(), klee::StagedSolverImpl::computeTruth(), and klee::StagedSolverImpl::computeValidity().

Here is the caller graph for this function:

bool SolverImpl::computeValidity ( const Query query,
Solver::Validity result 
)
virtual

computeValidity - Compute a full validity result for the query.

The query expression is guaranteed to be non-constant and have bool type.

SolverImpl provides a default implementation which uses computeTruth. Clients should override this if a more efficient implementation is available.

Parameters
[out]result- if

\[ \forall X constraints(X) \to query(X) \]

then Solver::True, else if

\[ \forall X constraints(X) \to \lnot query(X) \]

then Solver::False, else Solver::Unknown
Returns
True on success

Reimplemented in DummySolverImpl, ValidatingSolver, IndependentSolver, klee::StagedSolverImpl, CexCachingSolver, CachingSolver, and QueryLoggingSolver.

Definition at line 73 of file Solver.cpp.

References klee::Solver::False, klee::Query::negateExpr(), klee::Solver::True, and klee::Solver::Unknown.

Referenced by QueryLoggingSolver::computeValidity(), and klee::StagedSolverImpl::computeValidity().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool klee::SolverImpl::computeValue ( const Query query,
ref< Expr > &  result 
)
pure virtual

computeValue - Compute a feasible value for the expression.

The query expression is guaranteed to be non-constant.

Returns
True on success

Implemented in STPSolverImpl, DummySolverImpl, ValidatingSolver, IndependentSolver, klee::StagedSolverImpl, CexCachingSolver, CachingSolver, and QueryLoggingSolver.

Referenced by QueryLoggingSolver::computeValue(), and klee::StagedSolverImpl::computeValue().

Here is the caller graph for this function:

virtual char* klee::SolverImpl::getConstraintLog ( const Query query)
inlinevirtual
virtual SolverRunStatus klee::SolverImpl::getOperationStatusCode ( )
pure virtual
const char * SolverImpl::getOperationStatusString ( SolverRunStatus  statusCode)
static

getOperationStatusString - get string representation of the operation status code

Definition at line 87 of file Solver.cpp.

void klee::SolverImpl::operator= ( const SolverImpl )
private
virtual void klee::SolverImpl::setCoreSolverTimeout ( double  timeout)
inlinevirtual

The documentation for this class was generated from the following files: