This PR is a step towards enabling -o raw-benchmark. It adds printing methods for some of the new commands and fixes some other miscellaneous issues.
}
void Printer::toStreamCmdGetQuantifierElimination(std::ostream& out,
- Node n) const
+ Node n,
+ bool doFull) const
{
printUnknownCommand(out, "get-quantifier-elimination");
}
virtual void toStreamCmdGetModel(std::ostream& out) const;
/** Print block-model command */
- void toStreamCmdBlockModel(std::ostream& out) const;
+ virtual void toStreamCmdBlockModel(std::ostream& out) const;
/** Print block-model-values command */
- void toStreamCmdBlockModelValues(std::ostream& out,
- const std::vector<Node>& nodes) const;
+ virtual void toStreamCmdBlockModelValues(
+ std::ostream& out, const std::vector<Node>& nodes) const;
/** Print get-proof command */
virtual void toStreamCmdGetProof(std::ostream& out) const;
void toStreamCmdGetInstantiations(std::ostream& out) const;
/** Print get-interpol command */
- void toStreamCmdGetInterpol(std::ostream& out,
- const std::string& name,
- Node conj,
- TypeNode sygusType) const;
+ virtual void toStreamCmdGetInterpol(std::ostream& out,
+ const std::string& name,
+ Node conj,
+ TypeNode sygusType) const;
/** Print get-abduct command */
virtual void toStreamCmdGetAbduct(std::ostream& out,
TypeNode sygusType) const;
/** Print get-quantifier-elimination command */
- void toStreamCmdGetQuantifierElimination(std::ostream& out, Node n) const;
+ virtual void toStreamCmdGetQuantifierElimination(std::ostream& out,
+ Node n,
+ bool doFull) const;
/** Print get-unsat-assumptions command */
virtual void toStreamCmdGetUnsatAssumptions(std::ostream& out) const;
case kind::SEP_STAR: return "sep";
case kind::SEP_PTO: return "pto";
case kind::SEP_WAND: return "wand";
- case kind::SEP_EMP: return "emp";
+ case kind::SEP_EMP: return "sep.emp";
// quantifiers
case kind::FORALL: return "forall";
out << ") " << type << ')' << std::endl;
}
+void Smt2Printer::toStreamCmdDeclarePool(
+ std::ostream& out,
+ const std::string& id,
+ TypeNode type,
+ const std::vector<Node>& initValue) const
+{
+ out << "(declare-pool " << cvc5::quoteSymbol(id) << ' ' << type << " (";
+ for (size_t i = 0, n = initValue.size(); i < n; ++i)
+ {
+ if (i != 0) {
+ out << ' ';
+ }
+ out << initValue[i];
+ }
+ out << "))" << std::endl;
+}
+
void Smt2Printer::toStreamCmdDefineFunction(std::ostream& out,
const std::string& id,
const std::vector<Node>& formals,
out << "(get-model)" << std::endl;
}
+void Smt2Printer::toStreamCmdBlockModel(std::ostream& out) const
+{
+ out << "(block-model)" << std::endl;
+}
+
+void Smt2Printer::toStreamCmdBlockModelValues(
+ std::ostream& out, const std::vector<Node>& nodes) const
+{
+ out << "(block-model-values (";
+ for (size_t i = 0, n = nodes.size(); i < n; ++i)
+ {
+ if (i != 0)
+ {
+ out << ' ';
+ }
+ out << nodes[i];
+ }
+ out << "))" << std::endl;
+}
+
void Smt2Printer::toStreamCmdGetAssignment(std::ostream& out) const
{
out << "(get-assignment)" << std::endl;
out << "(check-synth)" << std::endl;
}
+void Smt2Printer::toStreamCmdGetInterpol(std::ostream& out,
+ const std::string& name,
+ Node conj,
+ TypeNode sygusType) const
+{
+ out << "(get-interpol " << cvc5::quoteSymbol(name) << ' ' << conj;
+ if (!sygusType.isNull())
+ {
+ out << ' ';
+ toStreamSygusGrammar(out, sygusType);
+ }
+ out << ')' << std::endl;
+}
+
void Smt2Printer::toStreamCmdGetAbduct(std::ostream& out,
const std::string& name,
Node conj,
out << ')' << std::endl;
}
+void Smt2Printer::toStreamCmdGetQuantifierElimination(std::ostream& out,
+ Node n,
+ bool doFull) const
+{
+ out << '(' << (doFull ? "get-qe" : "get-qe-disjunct") << ' ' << n << ')'
+ << std::endl;
+}
+
/*
--------------------------------------------------------------------------
End of Handling SyGuS commands
const std::string& id,
TypeNode type) const override;
+ /** Print declare-pool command */
+ void toStreamCmdDeclarePool(std::ostream& out,
+ const std::string& id,
+ TypeNode type,
+ const std::vector<Node>& initValue) const override;
+
/** Print declare-sort command */
- void toStreamCmdDeclareType(std::ostream& out,
- TypeNode type) const override;
+ void toStreamCmdDeclareType(std::ostream& out, TypeNode type) const override;
/** Print define-sort command */
void toStreamCmdDefineType(std::ostream& out,
TypeNode type) const override;
/** Print synth-fun command */
- void toStreamCmdSynthFun(std::ostream& out,
- Node f,
- const std::vector<Node>& vars,
- bool isInv,
- TypeNode sygusType = TypeNode::null()) const override;
+ void toStreamCmdSynthFun(
+ std::ostream& out,
+ Node f,
+ const std::vector<Node>& vars,
+ bool isInv,
+ TypeNode sygusType = TypeNode::null()) const override;
/** Print constraint command */
void toStreamCmdConstraint(std::ostream& out, Node n) const override;
/** Print get-model command */
void toStreamCmdGetModel(std::ostream& out) const override;
+ /** Print block-model command */
+ void toStreamCmdBlockModel(std::ostream& out) const override;
+
+ /** Print block-model-values command */
+ void toStreamCmdBlockModelValues(
+ std::ostream& out, const std::vector<Node>& nodes) const override;
+
/** Print get-proof command */
void toStreamCmdGetProof(std::ostream& out) const override;
+ /** Print get-interpol command */
+ void toStreamCmdGetInterpol(std::ostream& out,
+ const std::string& name,
+ Node conj,
+ TypeNode sygusType) const override;
+
/** Print get-abduct command */
void toStreamCmdGetAbduct(std::ostream& out,
const std::string& name,
Node conj,
TypeNode sygusType) const override;
+ /** Print get-quantifier-elimination command */
+ void toStreamCmdGetQuantifierElimination(std::ostream& out,
+ Node n,
+ bool doFull) const override;
+
/** Print get-unsat-assumptions command */
void toStreamCmdGetUnsatAssumptions(std::ostream& out) const override;
size_t dag,
Language language) const
{
- Printer::getPrinter(language)->toStreamCmdDeclareFunction(out,
- termToNode(d_func));
+ Printer::getPrinter(language)->toStreamCmdDeclareFunction(
+ out, d_symbol, sortToTypeNode(d_func.getSort()));
}
/* -------------------------------------------------------------------------- */
Language language) const
{
Printer::getPrinter(language)->toStreamCmdGetQuantifierElimination(
- out, termToNode(d_term));
+ out, termToNode(d_term), d_doFull);
}
/* -------------------------------------------------------------------------- */