This PR removes the command-verbosity option. It is implemented as a weird special case, and nobody seems to use it anyway.
}
cmd->invoke(solver, sm, out);
- // ignore the error if the command-verbosity is 0 for this command
- std::string commandName =
- std::string("command-verbosity:") + cmd->getCommandName();
- if (solver->getOption(commandName) == "0")
- {
- return true;
- }
return !cmd->fail();
}
invoke(solver, sm);
if (!(isMuted() && ok()))
{
- printResult(
- out,
- std::stoul(solver->getOption("command-verbosity:" + getCommandName())));
+ printResult(out);
}
}
Printer::getPrinter(language)->toStream(out, this);
}
-void Command::printResult(std::ostream& out, uint32_t verbosity) const
+void Command::printResult(std::ostream& out) const
{
- if (d_commandStatus != NULL)
+ if (d_commandStatus != nullptr)
{
- if ((!ok() && verbosity >= 1) || verbosity >= 2)
- {
- out << *d_commandStatus;
- }
+ out << *d_commandStatus;
}
}
Trace("dtview::command") << "* ~COMMAND: echo |" << d_output << "|~"
<< std::endl;
d_commandStatus = CommandSuccess::instance();
- printResult(
- out,
- std::stoul(solver->getOption("command-verbosity:" + getCommandName())));
+ printResult(out);
}
Command* EchoCommand::clone() const { return new EchoCommand(d_output); }
api::Result CheckSatCommand::getResult() const { return d_result; }
-void CheckSatCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void CheckSatCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
return d_result;
}
-void CheckSatAssumingCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void CheckSatAssumingCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
api::Result QueryCommand::getResult() const { return d_result; }
-void QueryCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void QueryCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
api::Result CheckSynthCommand::getResult() const { return d_result; }
-void CheckSynthCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void CheckSynthCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
api::Term SimplifyCommand::getResult() const { return d_result; }
-void SimplifyCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void SimplifyCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
api::Term GetValueCommand::getResult() const { return d_result; }
-void GetValueCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetValueCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
api::Term GetAssignmentCommand::getResult() const { return d_result; }
-void GetAssignmentCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetAssignmentCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetModelCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetModelCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetProofCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetProofCommand::printResult(std::ostream& out) const
{
if (ok())
{
}
else
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
}
}
}
-void GetInstantiationsCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetInstantiationsCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetInterpolCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetInterpolCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetAbductCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetAbductCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
{
return d_result;
}
-void GetQuantifierEliminationCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetQuantifierEliminationCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
return d_result;
}
-void GetUnsatAssumptionsCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetUnsatAssumptionsCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetUnsatCoreCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetUnsatCoreCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
}
-void GetDifficultyCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetDifficultyCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
std::string GetAssertionsCommand::getResult() const { return d_result; }
-void GetAssertionsCommand::printResult(std::ostream& out,
- uint32_t verbosity) const
+void GetAssertionsCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else
{
}
std::string GetInfoCommand::getResult() const { return d_result; }
-void GetInfoCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetInfoCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else if (d_result != "")
{
}
std::string GetOptionCommand::getResult() const { return d_result; }
-void GetOptionCommand::printResult(std::ostream& out, uint32_t verbosity) const
+void GetOptionCommand::printResult(std::ostream& out) const
{
if (!ok())
{
- this->Command::printResult(out, verbosity);
+ this->Command::printResult(out);
}
else if (d_result != "")
{
/** Get the command status (it's NULL if we haven't run yet). */
const CommandStatus* getCommandStatus() const { return d_commandStatus; }
- virtual void printResult(std::ostream& out, uint32_t verbosity = 2) const;
+ virtual void printResult(std::ostream& out) const;
/**
* Clone this Command (make a shallow copy).
CheckSatCommand();
api::Result getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
const std::vector<api::Term>& getTerms() const;
api::Result getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
api::Term getTerm() const;
api::Result getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
/** returns the result of the check-synth call */
api::Result getResult() const;
/** prints the result of the check-synth-call */
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
/** invokes this command
*
* This invocation makes the SMT engine build a synthesis conjecture based on
api::Term getTerm() const;
api::Term getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
const std::vector<api::Term>& getTerms() const;
api::Term getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
api::Term getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
public:
GetModelCommand();
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
static bool isEnabled(api::Solver* solver, const api::Result& res);
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
api::Term getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
api::Term getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
bool getDoFull() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
api::Term getResult() const;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
GetUnsatAssumptionsCommand();
void invoke(api::Solver* solver, SymbolManager* sm) override;
std::vector<api::Term> getResult() const;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
const std::vector<api::Term>& getUnsatCore() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
const std::map<api::Term, api::Term>& getDifficultyMap() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void invoke(api::Solver* solver, SymbolManager* sm) override;
std::string getResult() const;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
std::string getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
std::string getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
+ void printResult(std::ostream& out) const override;
Command* clone() const override;
std::string getCommandName() const override;
void toStream(std::ostream& out,
void SolverEngine::setOption(const std::string& key, const std::string& value)
{
Trace("smt") << "SMT setOption(" << key << ", " << value << ")" << endl;
-
- if (key == "command-verbosity")
- {
- size_t fstIndex = value.find(" ");
- size_t sndIndex = value.find(" ", fstIndex + 1);
- if (sndIndex == std::string::npos)
- {
- string c = value.substr(1, fstIndex - 1);
- int v =
- std::stoi(value.substr(fstIndex + 1, value.length() - fstIndex - 1));
- if (v < 0 || v > 2)
- {
- throw OptionException("command-verbosity must be 0, 1, or 2");
- }
- d_commandVerbosity[c] = v;
- return;
- }
- throw OptionException(
- "command-verbosity value must be a tuple (command-name integer)");
- }
-
- if (value.find(" ") != std::string::npos)
- {
- throw OptionException("bad value for :" + key);
- }
-
- std::string optionarg = value;
- options::set(getOptions(), key, optionarg);
+ options::set(getOptions(), key, value);
}
void SolverEngine::setIsInternalSubsolver() { d_isInternalSubsolver = true; }
std::string SolverEngine::getOption(const std::string& key) const
{
- NodeManager* nm = d_env->getNodeManager();
-
Trace("smt") << "SMT getOption(" << key << ")" << endl;
-
- if (key.find("command-verbosity:") == 0)
- {
- auto it =
- d_commandVerbosity.find(key.substr(std::strlen("command-verbosity:")));
- if (it != d_commandVerbosity.end())
- {
- return std::to_string(it->second);
- }
- it = d_commandVerbosity.find("*");
- if (it != d_commandVerbosity.end())
- {
- return std::to_string(it->second);
- }
- return "2";
- }
-
- if (key == "command-verbosity")
- {
- vector<Node> result;
- Node defaultVerbosity;
- for (const auto& verb : d_commandVerbosity)
- {
- // treat the command name as a variable name as opposed to a string
- // constant to avoid printing double quotes around the name
- Node name = nm->mkBoundVar(verb.first, nm->integerType());
- Node value = nm->mkConst(Rational(verb.second));
- if (verb.first == "*")
- {
- // put the default at the end of the SExpr
- defaultVerbosity = nm->mkNode(Kind::SEXPR, name, value);
- }
- else
- {
- result.push_back(nm->mkNode(Kind::SEXPR, name, value));
- }
- }
- // ensure the default is always listed
- if (defaultVerbosity.isNull())
- {
- defaultVerbosity = nm->mkNode(Kind::SEXPR,
- nm->mkBoundVar("*", nm->integerType()),
- nm->mkConst(Rational(2)));
- }
- result.push_back(defaultVerbosity);
- return nm->mkNode(Kind::SEXPR, result).toString();
- }
-
return options::get(getOptions(), key);
}
/** Whether this is an internal subsolver. */
bool d_isInternalSubsolver;
- /**
- * Verbosity of various commands.
- */
- std::map<std::string, int> d_commandVerbosity;
-
/** The statistics class */
std::unique_ptr<smt::SolverEngineStatistics> d_stats;
-; EXPECT: (SEXPR (SEXPR check-sat (CONST_RATIONAL 2)) (SEXPR * (CONST_RATIONAL 1)))
; EXPECT: (:status unknown)
; This regression tests uses of s-expressions when the output-language is AST
(set-option :output-language ast)
-; Set the verbosity of all commands to 1
-(set-option :command-verbosity (* 1))
-; Set the verbosity of (check-sat) command to 2
-(set-option :command-verbosity (check-sat 2))
-; Get the verbosity of all commands
-(get-option :command-verbosity)
-; There is no SMT option to get the verbosity of a specific command
-
(set-info :source (true false (- 15) 15 15.0 #b00001111 #x0f x |x
"| "" """"))
(get-info :status)
-; EXPECT: ((* 2))
-; EXPECT: ((check-sat 1) (* 1))
; EXPECT: true
; EXPECT: false
; EXPECT: 15
; EXPECT: none
-(get-option :command-verbosity)
-(set-option :command-verbosity (* 1))
-(set-option :command-verbosity (check-sat 1))
-(get-option :command-verbosity)
(set-option :check-models true)
(get-option :check-models)
(set-option :check-models false)