summaryrefslogtreecommitdiff
path: root/src/smt/command.cpp
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2016-03-08 12:10:41 -0600
committerajreynol <andrew.j.reynolds@gmail.com>2016-03-08 12:10:41 -0600
commit346c85d145f6938ce7dce74e7e7cb855d5a6025a (patch)
treefb9cc78736360756e2af81fc3457c4ed9929f32f /src/smt/command.cpp
parentb4c7be882b88c6741212ecd9c6be4e91fec76087 (diff)
Extend synthesis solver to handle single invocation with additional universal quantification. Refactor query/check-sat to call one internal function in SmtEngine. Make check-synth its own command. Minor work on quant ee.
Diffstat (limited to 'src/smt/command.cpp')
-rw-r--r--src/smt/command.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/smt/command.cpp b/src/smt/command.cpp
index 89d7b5ca2..5bf74a7de 100644
--- a/src/smt/command.cpp
+++ b/src/smt/command.cpp
@@ -376,6 +376,59 @@ std::string QueryCommand::getCommandName() const throw() {
return "query";
}
+
+/* class CheckSynthCommand */
+
+CheckSynthCommand::CheckSynthCommand() throw() :
+ d_expr() {
+}
+
+CheckSynthCommand::CheckSynthCommand(const Expr& expr, bool inUnsatCore) throw() :
+ d_expr(expr), d_inUnsatCore(inUnsatCore) {
+}
+
+Expr CheckSynthCommand::getExpr() const throw() {
+ return d_expr;
+}
+
+void CheckSynthCommand::invoke(SmtEngine* smtEngine) throw() {
+ try {
+ d_result = smtEngine->checkSynth(d_expr);
+ d_commandStatus = CommandSuccess::instance();
+ } catch(exception& e) {
+ d_commandStatus = new CommandFailure(e.what());
+ }
+}
+
+Result CheckSynthCommand::getResult() const throw() {
+ return d_result;
+}
+
+void CheckSynthCommand::printResult(std::ostream& out, uint32_t verbosity) const throw() {
+ if(! ok()) {
+ this->Command::printResult(out, verbosity);
+ } else {
+ out << d_result << endl;
+ }
+}
+
+Command* CheckSynthCommand::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) {
+ CheckSynthCommand* c = new CheckSynthCommand(d_expr.exportTo(exprManager, variableMap), d_inUnsatCore);
+ c->d_result = d_result;
+ return c;
+}
+
+Command* CheckSynthCommand::clone() const {
+ CheckSynthCommand* c = new CheckSynthCommand(d_expr, d_inUnsatCore);
+ c->d_result = d_result;
+ return c;
+}
+
+std::string CheckSynthCommand::getCommandName() const throw() {
+ return "check-synth";
+}
+
+
/* class ResetCommand */
void ResetCommand::invoke(SmtEngine* smtEngine) throw() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback