klee
QueryLoggingSolver.h
Go to the documentation of this file.
1//===-- QueryLoggingSolver.h
2//---------------------------------------------------===//
3//
4// The KLEE Symbolic Virtual Machine
5//
6// This file is distributed under the University of Illinois Open Source
7// License. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef KLEE_QUERYLOGGINGSOLVER_H
12#define KLEE_QUERYLOGGINGSOLVER_H
13
14#include "klee/Solver/Solver.h"
16#include "klee/System/Time.h"
17
18#include "llvm/Support/raw_ostream.h"
19
20using namespace klee;
21
27
28protected:
30 std::unique_ptr<llvm::raw_ostream> os;
31 // @brief Buffer used by logBuffer
32 std::string BufferString;
33 // @brief buffer to store logs before flushing to file
34 llvm::raw_string_ostream logBuffer;
35 unsigned queryCount;
36 time::Span minQueryTimeToLog; // we log to file only those queries which take longer than the specified time
37 bool logTimedOutQueries = false;
40 const std::string queryCommentSign; // sign representing commented lines
41 // in given a query format
42
43 virtual void startQuery(const Query &query, const char *typeName,
44 const Query *falseQuery = 0,
45 const std::vector<const Array *> *objects = 0);
46
47 virtual void finishQuery(bool success);
48
52 void flushBuffer(void);
53
54 virtual void printQuery(const Query &query, const Query *falseQuery = 0,
55 const std::vector<const Array *> *objects = 0) = 0;
56 void flushBufferConditionally(bool writeToFile);
57
58public:
59 QueryLoggingSolver(Solver *_solver, std::string path, const std::string &commentSign,
60 time::Span queryTimeToLog, bool logTimedOut);
61
62 virtual ~QueryLoggingSolver();
63
65 bool computeTruth(const Query &query, bool &isValid);
66 bool computeValidity(const Query &query, Solver::Validity &result);
67 bool computeValue(const Query &query, ref<Expr> &result);
68 bool computeInitialValues(const Query &query,
69 const std::vector<const Array *> &objects,
70 std::vector<std::vector<unsigned char> > &values,
71 bool &hasSolution);
73 char *getConstraintLog(const Query &);
74 void setCoreSolverTimeout(time::Span timeout);
75};
76
77#endif /* KLEE_QUERYLOGGINGSOLVER_H */
SolverRunStatus getOperationStatusCode()
getOperationStatusCode - get the status of the last solver operation
bool computeTruth(const Query &query, bool &isValid)
implementation of the SolverImpl interface
std::unique_ptr< llvm::raw_ostream > os
virtual void printQuery(const Query &query, const Query *falseQuery=0, const std::vector< const Array * > *objects=0)=0
virtual void startQuery(const Query &query, const char *typeName, const Query *falseQuery=0, const std::vector< const Array * > *objects=0)
time::Span lastQueryDuration
char * getConstraintLog(const Query &)
time::Span minQueryTimeToLog
bool computeValue(const Query &query, ref< Expr > &result)
void setCoreSolverTimeout(time::Span timeout)
const std::string queryCommentSign
llvm::raw_string_ostream logBuffer
bool computeValidity(const Query &query, Solver::Validity &result)
QueryLoggingSolver(Solver *_solver, std::string path, const std::string &commentSign, time::Span queryTimeToLog, bool logTimedOut)
virtual void finishQuery(bool success)
void flushBufferConditionally(bool writeToFile)
bool computeInitialValues(const Query &query, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &values, bool &hasSolution)
SolverImpl - Abstract base clase for solver implementations.
Definition: SolverImpl.h:25
Definition: main.cpp:291