klee
SolverImpl.h
Go to the documentation of this file.
1//===-- SolverImpl.h --------------------------------------------*- C++ -*-===//
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#ifndef KLEE_SOLVERIMPL_H
11#define KLEE_SOLVERIMPL_H
12
13#include "klee/System/Time.h"
14#include "Solver.h"
15
16#include <vector>
17
18namespace klee {
19 class Array;
20 class ExecutionState;
21 class Expr;
22 struct Query;
23
25 class SolverImpl {
26 // DO NOT IMPLEMENT.
28 void operator=(const SolverImpl&);
29
30 public:
32 virtual ~SolverImpl();
33
42
63 virtual bool computeValidity(const Query& query, Solver::Validity &result);
64
80 virtual bool computeTruth(const Query& query, bool &isValid) = 0;
81
87 virtual bool computeValue(const Query& query, ref<Expr> &result) = 0;
88
90 virtual bool computeInitialValues(const Query& query,
91 const std::vector<const Array*>
92 &objects,
93 std::vector< std::vector<unsigned char> >
94 &values,
95 bool &hasSolution) = 0;
96
99
102 static const char* getOperationStatusString(SolverRunStatus statusCode);
103
104 virtual char *getConstraintLog(const Query& query) {
105 // dummy
106 return nullptr;
107 }
108
109 virtual void setCoreSolverTimeout(time::Span timeout) {};
110};
111
112}
113
114#endif /* KLEE_SOLVERIMPL_H */
#define Expr
Definition: STPBuilder.h:19
SolverImpl - Abstract base clase for solver implementations.
Definition: SolverImpl.h:25
virtual ~SolverImpl()
Definition: SolverImpl.cpp:15
virtual void setCoreSolverTimeout(time::Span timeout)
Definition: SolverImpl.h:109
static const char * getOperationStatusString(SolverRunStatus statusCode)
Definition: SolverImpl.cpp:31
virtual bool computeTruth(const Query &query, bool &isValid)=0
virtual bool computeInitialValues(const Query &query, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &values, bool &hasSolution)=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
void operator=(const SolverImpl &)
virtual bool computeValue(const Query &query, ref< Expr > &result)=0
virtual char * getConstraintLog(const Query &query)
Definition: SolverImpl.h:104
virtual bool computeValidity(const Query &query, Solver::Validity &result)
Definition: SolverImpl.cpp:17
SolverImpl(const SolverImpl &)
virtual SolverRunStatus getOperationStatusCode()=0
getOperationStatusCode - get the status of the last solver operation
Definition: main.cpp:291