klee
|
#include <QueryLoggingSolver.h>
Public Member Functions | |
QueryLoggingSolver (Solver *_solver, std::string path, const std::string &commentSign, time::Span queryTimeToLog, bool logTimedOut) | |
virtual | ~QueryLoggingSolver () |
bool | computeTruth (const Query &query, bool &isValid) |
implementation of the SolverImpl interface More... | |
bool | computeValidity (const Query &query, Solver::Validity &result) |
bool | computeValue (const Query &query, ref< Expr > &result) |
bool | computeInitialValues (const Query &query, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &values, bool &hasSolution) |
SolverRunStatus | getOperationStatusCode () |
getOperationStatusCode - get the status of the last solver operation More... | |
char * | getConstraintLog (const Query &) |
void | setCoreSolverTimeout (time::Span timeout) |
Public Member Functions inherited from klee::SolverImpl | |
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 (time::Span timeout) |
Protected Member Functions | |
virtual void | startQuery (const Query &query, const char *typeName, const Query *falseQuery=0, const std::vector< const Array * > *objects=0) |
virtual void | finishQuery (bool success) |
void | flushBuffer (void) |
virtual void | printQuery (const Query &query, const Query *falseQuery=0, const std::vector< const Array * > *objects=0)=0 |
void | flushBufferConditionally (bool writeToFile) |
Protected Attributes | |
Solver * | solver |
std::unique_ptr< llvm::raw_ostream > | os |
std::string | BufferString |
llvm::raw_string_ostream | logBuffer |
unsigned | queryCount |
time::Span | minQueryTimeToLog |
bool | logTimedOutQueries = false |
time::Point | startTime |
time::Span | lastQueryDuration |
const std::string | queryCommentSign |
Additional Inherited Members | |
Public Types inherited from klee::SolverImpl | |
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 } |
Static Public Member Functions inherited from klee::SolverImpl | |
static const char * | getOperationStatusString (SolverRunStatus statusCode) |
This abstract class represents a solver that is capable of logging queries to a file. Derived classes might specialize this one by providing different formats for the query output.
Definition at line 26 of file QueryLoggingSolver.h.
QueryLoggingSolver::QueryLoggingSolver | ( | Solver * | _solver, |
std::string | path, | ||
const std::string & | commentSign, | ||
time::Span | queryTimeToLog, | ||
bool | logTimedOut | ||
) |
Definition at line 32 of file QueryLoggingSolver.cpp.
References klee::klee_error(), klee::klee_open_output_file(), os, and solver.
|
virtual |
Definition at line 56 of file QueryLoggingSolver.cpp.
References solver.
|
virtual |
Implements klee::SolverImpl.
Definition at line 166 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::computeInitialValues(), finishQuery(), flushBuffer(), klee::Solver::impl, logBuffer, klee::Array::name, queryCommentSign, klee::Array::size, solver, and startQuery().
|
virtual |
implementation of the SolverImpl interface
Implements klee::SolverImpl.
Definition at line 112 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::computeTruth(), finishQuery(), flushBuffer(), klee::Solver::impl, logBuffer, queryCommentSign, solver, and startQuery().
|
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.
[out] | result | - if then Solver::True, else if then Solver::False, else Solver::Unknown |
Reimplemented from klee::SolverImpl.
Definition at line 130 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::computeValidity(), finishQuery(), flushBuffer(), klee::Solver::impl, logBuffer, queryCommentSign, solver, and startQuery().
computeValue - Compute a feasible value for the expression.
The query expression is guaranteed to be non-constant.
Implements klee::SolverImpl.
Definition at line 148 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::computeValue(), finishQuery(), flushBuffer(), klee::Solver::impl, logBuffer, queryCommentSign, solver, startQuery(), and klee::Query::withFalse().
|
protectedvirtual |
Definition at line 88 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::getOperationStatusCode(), klee::time::getWallTime(), klee::Solver::impl, lastQueryDuration, logBuffer, queryCommentSign, solver, and startTime.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), and computeValue().
|
protected |
flushBuffer - flushes the temporary logs buffer. Depending on threshold settings, contents of the buffer are either discarded or written to a file.
Definition at line 100 of file QueryLoggingSolver.cpp.
References flushBufferConditionally(), klee::SolverImpl::getOperationStatusCode(), klee::Solver::impl, lastQueryDuration, logTimedOutQueries, minQueryTimeToLog, solver, and klee::SolverImpl::SOLVER_RUN_STATUS_TIMEOUT.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), and computeValue().
|
protected |
Definition at line 60 of file QueryLoggingSolver.cpp.
References BufferString, logBuffer, and os.
Referenced by flushBuffer(), and startQuery().
|
virtual |
Reimplemented from klee::SolverImpl.
Definition at line 212 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::getConstraintLog(), klee::Solver::impl, and solver.
|
virtual |
getOperationStatusCode - get the status of the last solver operation
Implements klee::SolverImpl.
Definition at line 208 of file QueryLoggingSolver.cpp.
References klee::SolverImpl::getOperationStatusCode(), klee::Solver::impl, and solver.
|
protectedpure virtual |
Implemented in KQueryLoggingSolver, and SMTLIBLoggingSolver.
Referenced by startQuery().
|
virtual |
Reimplemented from klee::SolverImpl.
Definition at line 216 of file QueryLoggingSolver.cpp.
References klee::Solver::impl, klee::SolverImpl::setCoreSolverTimeout(), and solver.
|
protectedvirtual |
Definition at line 70 of file QueryLoggingSolver.cpp.
References flushBufferConditionally(), klee::StatisticManager::getStatisticByName(), klee::Statistic::getValue(), klee::time::getWallTime(), klee::stats::instructions, logBuffer, printQuery(), queryCommentSign, queryCount, startTime, and klee::theStatisticManager.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), and computeValue().
|
protected |
Definition at line 32 of file QueryLoggingSolver.h.
Referenced by flushBufferConditionally().
|
protected |
Definition at line 39 of file QueryLoggingSolver.h.
Referenced by finishQuery(), and flushBuffer().
|
protected |
Definition at line 34 of file QueryLoggingSolver.h.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), computeValue(), finishQuery(), flushBufferConditionally(), KQueryLoggingSolver::printQuery(), SMTLIBLoggingSolver::SMTLIBLoggingSolver(), and startQuery().
|
protected |
Definition at line 37 of file QueryLoggingSolver.h.
Referenced by flushBuffer().
|
protected |
Definition at line 36 of file QueryLoggingSolver.h.
Referenced by flushBuffer().
|
protected |
Definition at line 30 of file QueryLoggingSolver.h.
Referenced by flushBufferConditionally(), and QueryLoggingSolver().
|
protected |
Definition at line 40 of file QueryLoggingSolver.h.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), computeValue(), finishQuery(), and startQuery().
|
protected |
Definition at line 35 of file QueryLoggingSolver.h.
Referenced by startQuery().
|
protected |
Definition at line 29 of file QueryLoggingSolver.h.
Referenced by computeInitialValues(), computeTruth(), computeValidity(), computeValue(), finishQuery(), flushBuffer(), getConstraintLog(), getOperationStatusCode(), QueryLoggingSolver(), setCoreSolverTimeout(), and ~QueryLoggingSolver().
|
protected |
Definition at line 38 of file QueryLoggingSolver.h.
Referenced by finishQuery(), and startQuery().