After #8827, we automatically generate code for the options listed in printer_options.toml, which allows those options to be set on input/output streams. Some of the options that are currently in printer_options.toml are not a good fit for that and this commit moves them out of the file. This is in preparation of making that stream options public (or at public in the parser), because some commands require setting stream options.
type = "uint64_t"
default = "1"
help = "Number of parallel jobs the portfolio engine can run"
+
+[[option]]
+ name = "printSuccess"
+ category = "common"
+ long = "print-success"
+ type = "bool"
+ default = "false"
+ help = "print the \"success\" output required of SMT-LIBv2"
minimum = "0"
help = "dagify common subexprs appearing > N times (1 == default, 0 == don't dagify)"
-[[option]]
- name = "printInstMode"
- category = "common"
- long = "print-inst=MODE"
- type = "PrintInstMode"
- default = "LIST"
- help = "print format for printing instantiations"
- help_mode = "Print format for printing instantiations."
-[[option.mode.LIST]]
- name = "list"
- help = "Print the list of instantiations per quantified formula, when non-empty."
-[[option.mode.NUM]]
- name = "num"
- help = "Print the total number of instantiations per quantified formula, when non-zero."
-
-[[option]]
- name = "printInstFull"
- category = "regular"
- long = "print-inst-full"
- type = "bool"
- default = "true"
- help = "print instantiations for formulas that do not have given identifiers"
-
-[[option]]
- name = "printDotAsDAG"
- category = "expert"
- long = "proof-dot-dag"
- type = "bool"
- default = "false"
- help = "Indicates if the dot proof will be printed as a DAG or as a tree"
-
-[[option]]
- name = "printDotClusters"
- category = "regular"
- long = "print-dot-clusters"
- type = "bool"
- default = "false"
- help = "Whether the proof node clusters (e.g. SAT, CNF, INPUT) will be printed when using the dot format or not."
-
-[[option]]
- name = "printUnsatCoresFull"
- category = "regular"
- long = "print-unsat-cores-full"
- type = "bool"
- default = "false"
- help = "when printing unsat cores, include unlabeled assertions"
-
[[option]]
name = "flattenHOChains"
category = "expert"
name = "none"
help = "(default) do not print declarations of uninterpreted elements in models."
-[[option]]
- name = "sygusOut"
- category = "regular"
- long = "sygus-out=MODE"
- type = "SygusSolutionOutMode"
- default = "STANDARD"
- help = "output mode for sygus"
- help_mode = "Modes for sygus solution output."
-[[option.mode.STATUS]]
- name = "status"
- help = "Print only status for check-synth calls."
-[[option.mode.STATUS_AND_DEF]]
- name = "status-and-def"
- help = "Print status followed by definition corresponding to solution."
-[[option.mode.STANDARD]]
- name = "sygus-standard"
- help = "Print based on SyGuS standard."
-
[[option]]
name = "bvPrintConstsAsIndexedSymbols"
category = "regular"
type = "bool"
default = "false"
help = "print bit-vector constants in decimal (e.g. (_ bv1 4)) instead of binary (e.g. #b0001), applies to SMT-LIB 2.x"
-
-[[option]]
- name = "printSuccess"
- category = "common"
- long = "print-success"
- type = "bool"
- default = "false"
- help = "print the \"success\" output required of SMT-LIBv2"
type = "bool"
default = "false"
help = "Add pivots to Alethe resolution steps"
+
+[[option]]
+ name = "printDotAsDAG"
+ category = "expert"
+ long = "proof-dot-dag"
+ type = "bool"
+ default = "false"
+ help = "Indicates if the dot proof will be printed as a DAG or as a tree"
+
+[[option]]
+ name = "printDotClusters"
+ category = "regular"
+ long = "print-dot-clusters"
+ type = "bool"
+ default = "false"
+ help = "Whether the proof node clusters (e.g. SAT, CNF, INPUT) will be printed when using the dot format or not."
default = "2"
help = "instantiation rounds quantifiers takes (>=1) before allowing theory combination to happen"
+[[option]]
+ name = "printInstMode"
+ category = "common"
+ long = "print-inst=MODE"
+ type = "PrintInstMode"
+ default = "LIST"
+ help = "print format for printing instantiations"
+ help_mode = "Print format for printing instantiations."
+[[option.mode.LIST]]
+ name = "list"
+ help = "Print the list of instantiations per quantified formula, when non-empty."
+[[option.mode.NUM]]
+ name = "num"
+ help = "Print the total number of instantiations per quantified formula, when non-zero."
+
+[[option]]
+ name = "printInstFull"
+ category = "regular"
+ long = "print-inst-full"
+ type = "bool"
+ default = "true"
+ help = "print instantiations for formulas that do not have given identifiers"
+
[[option]]
name = "instMaxLevel"
category = "expert"
default = "false"
help = "support SyGuS commands"
+[[option]]
+ name = "sygusOut"
+ category = "regular"
+ long = "sygus-out=MODE"
+ type = "SygusSolutionOutMode"
+ default = "STANDARD"
+ help = "output mode for sygus"
+ help_mode = "Modes for sygus solution output."
+[[option.mode.STATUS]]
+ name = "status"
+ help = "Print only status for check-synth calls."
+[[option.mode.STATUS_AND_DEF]]
+ name = "status-and-def"
+ help = "Print status followed by definition corresponding to solution."
+[[option.mode.STANDARD]]
+ name = "sygus-standard"
+ help = "Print based on SyGuS standard."
+
[[option]]
name = "cegqiSingleInvMode"
category = "regular"
default = "false"
help = "if an unsat core is produced, it is reduced to a minimal unsat core"
+[[option]]
+ name = "printUnsatCoresFull"
+ category = "regular"
+ long = "print-unsat-cores-full"
+ type = "bool"
+ default = "false"
+ help = "when printing unsat cores, include unlabeled assertions"
+
[[option]]
name = "checkUnsatCores"
category = "regular"
static void toStream(std::ostream& out, const cvc5::CommandSuccess* s)
{
- if (options::ioutils::getPrintSuccess(out))
- {
- out << "OK" << endl;
- }
+ out << "OK" << endl;
}
static void toStream(std::ostream& out, const cvc5::CommandInterrupted* s)
const cvc5::CommandSuccess* s,
Variant v)
{
- if (options::ioutils::getPrintSuccess(out))
- {
- out << "success" << endl;
- }
+ out << "success" << endl;
}
static void toStream(std::ostream& out,
namespace cvc5::internal {
namespace proof {
-DotPrinter::DotPrinter()
- : d_lbind(options::dagThresh() ? options::dagThresh() + 1 : 0), d_ruleID(0)
+DotPrinter::DotPrinter(Env& env)
+ : EnvObj(env),
+ d_lbind(options::dagThresh() ? options::dagThresh() + 1 : 0),
+ d_ruleID(0)
{
const std::string acronyms[5] = {"SAT", "CNF", "TL", "PP", "IN"};
const std::string colors[5] = {"purple", "yellow", "green", "brown", "blue"};
ancestorHashs,
ProofNodeClusterType::NOT_DEFINED);
- if (options::ioutils::getPrintDotClusters(out))
+ if (options().proof.printDotClusters)
{
// Print the sub-graphs
for (unsigned i = 0; i < 5; i++)
uint64_t currentRuleID = d_ruleID;
// Print DAG option enabled
- if (options::ioutils::getPrintDotAsDAG(out))
+ if (options().proof.printDotAsDAG)
{
ProofNodeHashFunction hasher;
size_t currentHash = hasher(pn);
}
ProofNodeClusterType proofNodeType = ProofNodeClusterType::NOT_DEFINED;
- if (options::ioutils::getPrintDotClusters(out))
+ if (options().proof.printDotClusters)
{
// Define the type of this node
proofNodeType = defineProofNodeType(pn, parentType);
ancestorHashs,
proofNodeType);
out << "\t" << childId << " -> " << currentRuleID << ";\n";
- if (options::ioutils::getPrintDotAsDAG(out))
+ if (options().proof.printDotAsDAG)
{
ancestorHashs.pop_back();
}
ancestorHashs,
proofNodeType);
out << "\t" << childId << " -> " << currentRuleID << ";\n";
- if (options::ioutils::getPrintDotAsDAG(out))
+ if (options().proof.printDotAsDAG)
{
ancestorHashs.pop_back();
}
}
// If it's a scope, then remove from the stack
- if (isSCOPE(r) && options::ioutils::getPrintDotClusters(out))
+ if (isSCOPE(r) && options().proof.printDotClusters)
{
d_scopesArgs.pop_back();
}
#include "printer/let_binding.h"
#include "proof/proof_node.h"
+#include "smt/env_obj.h"
namespace cvc5::internal {
namespace proof {
NOT_DEFINED
};
-class DotPrinter
+class DotPrinter : protected EnvObj
{
public:
- DotPrinter();
+ DotPrinter(Env& env);
~DotPrinter();
/**
}
else if (!isMuted())
{
- printResult(out);
+ printResult(solver, out);
}
}
Printer::getPrinter(out)->toStream(out, this);
}
-void Command::printResult(std::ostream& out) const
+void Command::printResult(cvc5::Solver* solver, std::ostream& out) const
{
- if (d_commandStatus != nullptr)
+ if (!ok()
+ || (d_commandStatus != nullptr
+ && solver->getOption("print-success") == "true"))
{
out << *d_commandStatus;
}
Trace("dtview::command") << "* ~COMMAND: echo |" << d_output << "|~"
<< std::endl;
d_commandStatus = CommandSuccess::instance();
- printResult(out);
+ printResult(solver, out);
}
std::string EchoCommand::getCommandName() const { return "echo"; }
cvc5::Result CheckSatCommand::getResult() const { return d_result; }
-void CheckSatCommand::printResult(std::ostream& out) const
+void CheckSatCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
{
out << d_result << endl;
}
return d_result;
}
-void CheckSatAssumingCommand::printResult(std::ostream& out) const
+void CheckSatAssumingCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_result << endl;
}
}
cvc5::SynthResult CheckSynthCommand::getResult() const { return d_result; }
-void CheckSynthCommand::printResult(std::ostream& out) const
+void CheckSynthCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_solution.str();
}
}
cvc5::Term SimplifyCommand::getResult() const { return d_result; }
-void SimplifyCommand::printResult(std::ostream& out) const
+void SimplifyCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
{
out << d_result << endl;
}
}
cvc5::Term GetValueCommand::getResult() const { return d_result; }
-void GetValueCommand::printResult(std::ostream& out) const
+void GetValueCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
{
options::ioutils::Scope scope(out);
options::ioutils::applyDagThresh(out, 0);
}
cvc5::Term GetAssignmentCommand::getResult() const { return d_result; }
-void GetAssignmentCommand::printResult(std::ostream& out) const
+void GetAssignmentCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_result << endl;
}
}
}
-void GetModelCommand::printResult(std::ostream& out) const { out << d_result; }
+void GetModelCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
+{
+ out << d_result;
+}
std::string GetModelCommand::getCommandName() const { return "get-model"; }
}
}
-void GetProofCommand::printResult(std::ostream& out) const { out << d_result; }
+void GetProofCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
+{
+ out << d_result;
+}
std::string GetProofCommand::getCommandName() const { return "get-proof"; }
}
}
-void GetInstantiationsCommand::printResult(std::ostream& out) const
+void GetInstantiationsCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_solver->getInstantiations();
}
}
}
-void GetInterpolantCommand::printResult(std::ostream& out) const
+void GetInterpolantCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
options::ioutils::Scope scope(out);
options::ioutils::applyDagThresh(out, 0);
}
}
-void GetInterpolantNextCommand::printResult(std::ostream& out) const
+void GetInterpolantNextCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
options::ioutils::Scope scope(out);
options::ioutils::applyDagThresh(out, 0);
}
}
-void GetAbductCommand::printResult(std::ostream& out) const
+void GetAbductCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
options::ioutils::Scope scope(out);
options::ioutils::applyDagThresh(out, 0);
}
}
-void GetAbductNextCommand::printResult(std::ostream& out) const
+void GetAbductNextCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
options::ioutils::Scope scope(out);
options::ioutils::applyDagThresh(out, 0);
{
return d_result;
}
-void GetQuantifierEliminationCommand::printResult(std::ostream& out) const
+void GetQuantifierEliminationCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_result << endl;
}
return d_result;
}
-void GetUnsatAssumptionsCommand::printResult(std::ostream& out) const
+void GetUnsatAssumptionsCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
container_to_stream(out, d_result, "(", ")\n", " ");
}
}
}
-void GetUnsatCoreCommand::printResult(std::ostream& out) const
+void GetUnsatCoreCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
if (d_solver->getOption("print-unsat-cores-full") == "true")
{
}
}
-void GetDifficultyCommand::printResult(std::ostream& out) const
+void GetDifficultyCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << "(" << std::endl;
for (const std::pair<const cvc5::Term, cvc5::Term>& d : d_result)
}
}
-void GetLearnedLiteralsCommand::printResult(std::ostream& out) const
+void GetLearnedLiteralsCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << "(" << std::endl;
for (const cvc5::Term& lit : d_result)
}
std::string GetAssertionsCommand::getResult() const { return d_result; }
-void GetAssertionsCommand::printResult(std::ostream& out) const
+void GetAssertionsCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
out << d_result;
}
}
std::string GetInfoCommand::getResult() const { return d_result; }
-void GetInfoCommand::printResult(std::ostream& out) const
+void GetInfoCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
{
if (d_result != "")
{
}
std::string GetOptionCommand::getResult() const { return d_result; }
-void GetOptionCommand::printResult(std::ostream& out) const
+void GetOptionCommand::printResult(cvc5::Solver* solver,
+ std::ostream& out) const
{
if (d_result != "")
{
* Print the result of running the command. This method is only called if the
* command ran successfully.
*/
- virtual void printResult(std::ostream& out) const;
+ virtual void printResult(cvc5::Solver* solver, std::ostream& out) const;
// These methods rely on Command being a friend of classes in the API.
// Subclasses of command should use these methods for conversions,
CheckSatCommand();
cvc5::Result getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
const std::vector<cvc5::Term>& getTerms() const;
cvc5::Result getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
/** returns the result of the check-synth call */
cvc5::SynthResult getResult() const;
/** prints the result of the check-synth-call */
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
/** invokes this command
*
* This invocation makes the SMT engine build a synthesis conjecture based on
cvc5::Term getTerm() const;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class SimplifyCommand */
const std::vector<cvc5::Term>& getTerms() const;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class GetValueCommand */
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class GetAssignmentCommand */
public:
GetModelCommand();
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
static bool isEnabled(cvc5::Solver* solver, const cvc5::Result& res);
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
cvc5::Term getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
bool getDoFull() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
cvc5::Term getResult() const;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
GetUnsatAssumptionsCommand();
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
std::vector<cvc5::Term> getResult() const;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
const std::vector<cvc5::Term>& getUnsatCore() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
const std::map<cvc5::Term, cvc5::Term>& getDifficultyMap() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
const std::vector<cvc5::Term>& getLearnedLiterals() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
std::string getResult() const;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class GetAssertionsCommand */
std::string getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class GetInfoCommand */
std::string getResult() const;
void invoke(cvc5::Solver* solver, SymbolManager* sm) override;
- void printResult(std::ostream& out) const override;
+ void printResult(cvc5::Solver* solver, std::ostream& out) const override;
std::string getCommandName() const override;
void toStream(std::ostream& out) const override;
}; /* class GetOptionCommand */
// according to the proof format, post process and print the proof node
if (options().proof.proofFormatMode == options::ProofFormatMode::DOT)
{
- proof::DotPrinter dotPrinter;
+ proof::DotPrinter dotPrinter(d_env);
dotPrinter.print(out, fp.get());
}
else if (options().proof.proofFormatMode == options::ProofFormatMode::ALETHE)
#include "options/options_public.h"
#include "options/parser_options.h"
#include "options/printer_options.h"
+#include "options/quantifiers_options.h"
#include "options/proof_options.h"
#include "options/smt_options.h"
#include "options/theory_options.h"
// First, extract and print the skolemizations
bool printed = false;
- bool reqNames = !d_env->getOptions().printer.printInstFull;
+ bool reqNames = !d_env->getOptions().quantifiers.printInstFull;
// only print when in list mode
- if (d_env->getOptions().printer.printInstMode == options::PrintInstMode::LIST)
+ if (d_env->getOptions().quantifiers.printInstMode == options::PrintInstMode::LIST)
{
std::map<Node, std::vector<Node>> sks;
qe->getSkolemTermVectors(sks);
continue;
}
// must have a name
- if (d_env->getOptions().printer.printInstMode
+ if (d_env->getOptions().quantifiers.printInstMode
== options::PrintInstMode::NUM)
{
out << "(num-instantiations " << name << " " << i.second.d_inst.size()
{
// take the name
i.second.d_quant = name;
- Assert(d_env->getOptions().printer.printInstMode
+ Assert(d_env->getOptions().quantifiers.printInstMode
== options::PrintInstMode::LIST);
out << i.second;
}
#include "expr/node_algorithm.h"
#include "options/base_options.h"
-#include "options/printer_options.h"
#include "options/quantifiers_options.h"
#include "options/smt_options.h"
#include "proof/lazy_proof.h"
}
if (isOutputOn(OutputTag::INST))
{
- bool req = !options().printer.printInstFull;
+ bool req = !options().quantifiers.printInstFull;
for (std::pair<const Node, uint32_t>& i : d_instDebugTemp)
{
Node name;