summaryrefslogtreecommitdiff
path: root/src/expr/command.cpp
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2015-01-26 13:11:01 +0100
committerajreynol <andrew.j.reynolds@gmail.com>2015-01-26 13:11:01 +0100
commitedd8886e56c8bb84f3fd85fc6f697d870bc0a3b7 (patch)
tree1fe3e8699f3c4831a302a369b377396ae5a347a4 /src/expr/command.cpp
parentf3045ccce9d30114f6e90cfa72de176da344cb1f (diff)
Output solutions for synthesis conjectures with --dump-synth. Minor refactor of previous commit.
Diffstat (limited to 'src/expr/command.cpp')
-rw-r--r--src/expr/command.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/expr/command.cpp b/src/expr/command.cpp
index 242e018f6..1c7c1d171 100644
--- a/src/expr/command.cpp
+++ b/src/expr/command.cpp
@@ -1187,6 +1187,44 @@ std::string GetInstantiationsCommand::getCommandName() const throw() {
return "get-instantiations";
}
+/* class GetSynthSolutionCommand */
+
+GetSynthSolutionCommand::GetSynthSolutionCommand() throw() {
+}
+
+void GetSynthSolutionCommand::invoke(SmtEngine* smtEngine) throw() {
+ try {
+ d_smtEngine = smtEngine;
+ d_commandStatus = CommandSuccess::instance();
+ } catch(exception& e) {
+ d_commandStatus = new CommandFailure(e.what());
+ }
+}
+
+void GetSynthSolutionCommand::printResult(std::ostream& out, uint32_t verbosity) const throw() {
+ if(! ok()) {
+ this->Command::printResult(out, verbosity);
+ } else {
+ d_smtEngine->printSynthSolution(out);
+ }
+}
+
+Command* GetSynthSolutionCommand::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) {
+ GetSynthSolutionCommand* c = new GetSynthSolutionCommand();
+ c->d_smtEngine = d_smtEngine;
+ return c;
+}
+
+Command* GetSynthSolutionCommand::clone() const {
+ GetSynthSolutionCommand* c = new GetSynthSolutionCommand();
+ c->d_smtEngine = d_smtEngine;
+ return c;
+}
+
+std::string GetSynthSolutionCommand::getCommandName() const throw() {
+ return "get-instantiations";
+}
+
/* class GetUnsatCoreCommand */
GetUnsatCoreCommand::GetUnsatCoreCommand() throw() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback