diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-09-04 22:22:41 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-09-04 22:22:41 +0000 |
commit | ce6c366450cc9cb30c254f26089696c1c7c913c0 (patch) | |
tree | a7ea29ec2f222c0e7ae4d9559a486905be10a923 /src/expr/command.cpp | |
parent | 5d9670acc3c8eacdebdbb07302a8e35f837d0e52 (diff) |
Accepted some patches from the Multicore Programming Group at Imperial College London (via Peter Collingbourne):
cvc4-0001-Look-for-cxxtestgen-as-well-as-cxxtestgen.pl-and-cxx.patch
* better checking for cxxtest
cvc4-0002-Do-not-read-an-additional-command-after-failure.patch
* more correct failure behavior for interactive tools
cvc4-0003-Only-exit-when-encountering-a-CommandFailure.patch
* don't consider "unsupported" as a failure (accepted with modifications)
cvc4-0004-Produce-SMT-LIB-v2-conformant-output-for-get-info.patch
* better get-info responses (accepted with modifications)
These patches will help the group build Boogie support for CVC4.
(this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/expr/command.cpp')
-rw-r--r-- | src/expr/command.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/expr/command.cpp b/src/expr/command.cpp index 648c64388..b058292f3 100644 --- a/src/expr/command.cpp +++ b/src/expr/command.cpp @@ -91,6 +91,10 @@ bool Command::ok() const throw() { return d_commandStatus == NULL || dynamic_cast<const CommandSuccess*>(d_commandStatus) != NULL; } +bool Command::fail() const throw() { + return d_commandStatus != NULL && dynamic_cast<const CommandFailure*>(d_commandStatus) != NULL; +} + void Command::invoke(SmtEngine* smtEngine, std::ostream& out) throw() { invoke(smtEngine); printResult(out); @@ -1048,11 +1052,11 @@ std::string GetInfoCommand::getFlag() const throw() { void GetInfoCommand::invoke(SmtEngine* smtEngine) throw() { try { - SExpr response = smtEngine->getInfo(d_flag); + vector<SExpr> v; + v.push_back(SExpr(SExpr::Keyword(string(":") + d_flag))); + v.push_back(smtEngine->getInfo(d_flag)); stringstream ss; - ss << SExpr(SExpr::Keyword(d_flag)) - << ' ' - << response; + ss << SExpr(v); d_result = ss.str(); d_commandStatus = CommandSuccess::instance(); } catch(UnrecognizedOptionException&) { @@ -1136,7 +1140,6 @@ void GetOptionCommand::invoke(SmtEngine* smtEngine) throw() { v.push_back(SExpr(SExpr::Keyword(string(":") + d_flag))); v.push_back(smtEngine->getOption(d_flag)); stringstream ss; - ss << SExpr(v); d_result = ss.str(); d_commandStatus = CommandSuccess::instance(); |