Skip to content

Commit

Permalink
[Solver]Add simple option to dump queries
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowack authored and Dan Liew committed Dec 17, 2015
1 parent 771cdf3 commit 512b9f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/klee/Solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ namespace klee {
Query negateExpr() const {
return withExpr(Expr::createIsZero(expr));
}

/// Dump query
void dump() const ;
};

class Solver {
Expand Down
12 changes: 12 additions & 0 deletions lib/Solver/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,4 +1267,16 @@ template class MetaSMTSolver< DirectSolver_Context < Z3_Backend> >;
template class MetaSMTSolver< DirectSolver_Context < STP_Backend> >;

#endif /* SUPPORT_METASMT */
///

void Query::dump() const {
llvm::errs() << "Constraints [\n";
for (ConstraintManager::const_iterator i = constraints.begin();
i != constraints.end(); i++) {
(*i)->dump();
}
llvm::errs() << "]\n";
llvm::errs() << "Query [\n";
expr->dump();
llvm::errs() << "]\n";
}

0 comments on commit 512b9f1

Please sign in to comment.