31 const std::vector<const Array *> &objects,
32 std::vector<std::vector<unsigned char> > &values,
47 if (isValid != answer)
48 assert(0 &&
"invalid solver result (computeTruth)");
63 assert(0 &&
"invalid solver result (computeValidity)");
76 query.
withExpr(NeExpr::create(query.
expr, result)), answer))
80 assert(0 &&
"invalid solver result (computeValue)");
86 const Query &query,
const std::vector<const Array *> &objects,
87 std::vector<std::vector<unsigned char> > &values,
bool &hasSolution) {
97 for (
unsigned i = 0; i != values.size(); ++i) {
98 const Array *array = objects[i];
100 for (
unsigned j = 0; j < array->
size; j++) {
101 unsigned char value = values[i][j];
111 constraints = AndExpr::create(constraints, constraint);
116 assert(0 &&
"invalid solver result (computeInitialValues)");
121 assert(0 &&
"invalid solver result (computeInitialValues)");
Expr::Width getRange() const
Expr::Width getDomain() const
static ref< ConstantExpr > alloc(const llvm::APInt &v)
Manages constraints, e.g. optimisation.
void push_back(const ref< Expr > &e)
static ref< Expr > createIsZero(ref< Expr > e)
static ref< Expr > create(const UpdateList &updates, ref< Expr > i)
SolverImpl - Abstract base clase for solver implementations.
virtual void setCoreSolverTimeout(time::Span timeout)
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
virtual bool computeValue(const Query &query, ref< Expr > &result)=0
virtual char * getConstraintLog(const Query &query)
virtual bool computeValidity(const Query &query, Solver::Validity &result)
virtual SolverRunStatus getOperationStatusCode()=0
getOperationStatusCode - get the status of the last solver operation
Class representing a complete list of updates into an array.
bool computeTruth(const Query &, bool &isValid)
SolverRunStatus getOperationStatusCode()
getOperationStatusCode - get the status of the last solver operation
ValidatingSolver(Solver *_solver, Solver *_oracle)
bool computeValidity(const Query &, Solver::Validity &result)
bool computeInitialValues(const Query &, const std::vector< const Array * > &objects, std::vector< std::vector< unsigned char > > &values, bool &hasSolution)
void setCoreSolverTimeout(time::Span timeout)
bool computeValue(const Query &, ref< Expr > &result)
char * getConstraintLog(const Query &)
Solver * createValidatingSolver(Solver *s, Solver *oracle)
Query withExpr(ref< Expr > _expr) const
withExpr - Return a copy of the query with the given expression.
const ConstraintSet & constraints