/* class Command */
-Command::Command() throw() : d_commandStatus(NULL) {
+Command::Command() throw() : d_commandStatus(NULL), d_muted(false) {
}
Command::Command(const Command& cmd) {
d_commandStatus = (cmd.d_commandStatus == NULL) ? NULL : &cmd.d_commandStatus->clone();
+ d_muted = cmd.d_muted;
}
Command::~Command() throw() {
void Command::invoke(SmtEngine* smtEngine, std::ostream& out) throw() {
invoke(smtEngine);
- printResult(out);
+ if(!(isMuted() && ok())) {
+ printResult(out);
+ }
}
std::string Command::toString() const throw() {
*/
const CommandStatus* d_commandStatus;
+ /**
+ * True if this command is "muted"---i.e., don't print "success" on
+ * successful execution.
+ */
+ bool d_muted;
+
public:
typedef CommandPrintSuccess printsuccess;
std::string toString() const throw();
+ /**
+ * If false, instruct this Command not to print a success message.
+ */
+ void setMuted(bool muted) throw() { d_muted = muted; }
+
+ /**
+ * Determine whether this Command will print a success message.
+ */
+ bool isMuted() throw() { return d_muted; }
+
/**
* Either the command hasn't run yet, or it completed successfully
* (CommandSuccess, not CommandUnsupported or CommandFailure).
std::string attr_name = attr;
attr_name.erase( attr_name.begin() );
Command* c = new SetUserAttributeCommand( attr_name, expr );
+ c->setMuted(true);
PARSER_STATE->preemptCommand(c);
} else {
PARSER_STATE->attributeNotSupported(attr);
// bind name to expr with define-fun
Command* c =
new DefineNamedFunctionCommand(name, func, std::vector<Expr>(), expr);
+ c->setMuted(true);
PARSER_STATE->preemptCommand(c);
}
;
setLogic("ALL_SUPPORTED");
- preemptCommand(new SetBenchmarkLogicCommand("ALL_SUPPORTED"));
+ Command* c = new SetBenchmarkLogicCommand("ALL_SUPPORTED");
+ c->setMuted(true);
+ preemptCommand(c);
}
}
}