// Nothing to do here at this point.
}
+bool LFSCArithProof::printsAsBool(const Node& n)
+{
+ // Our boolean variables and constants print as sort Bool.
+ // All complex booleans print as formulas.
+ return n.getType().isBoolean() and (n.isVar() or n.isConst());
+}
+
} /* CVC4 namespace */
void printAliasingDeclarations(std::ostream& os,
std::ostream& paren,
const ProofLetMap& globalLetMap) override;
+
+ /**
+ * Return whether this node, when serialized to LFSC, has sort `Bool`. Otherwise, the sort is `formula`.
+ */
+ bool printsAsBool(const Node& n) override;
};
printTheoryTerm(term, os, map);
}
+void LFSCTheoryProofEngine::printBoundFormula(Expr term,
+ std::ostream& os,
+ const ProofLetMap& map)
+{
+ Assert(term.getType().isBoolean() or term.getType().isPredicate());
+ bool wrapWithBoolToPred = term.getType().isBoolean() and printsAsBool(term);
+ if (wrapWithBoolToPred)
+ {
+ os << "(p_app ";
+ }
+ printBoundTerm(term, os, map);
+ if (wrapWithBoolToPred)
+ {
+ os << ")";
+ }
+}
+
void LFSCTheoryProofEngine::printCoreTerm(Expr term, std::ostream& os, const ProofLetMap& map) {
if (term.isVariable()) {
os << ProofManager::sanitize(term);
switch(k) {
case kind::ITE: {
- os << (term.getType().isBoolean() ? "(ifte ": "(ite _ ");
-
- bool booleanCase = term[0].getType().isBoolean();
- if (booleanCase && printsAsBool(term[0])) os << "(p_app ";
- printBoundTerm(term[0], os, map);
- if (booleanCase && printsAsBool(term[0])) os << ")";
+ bool useFormulaType = term.getType().isBoolean();
+ Assert(term[1].getType().isSubtypeOf(term.getType()));
+ Assert(term[2].getType().isSubtypeOf(term.getType()));
+ os << (useFormulaType ? "(ifte " : "(ite _ ");
+ printBoundFormula(term[0], os, map);
os << " ";
- printBoundTerm(term[1], os, map);
+ if (useFormulaType)
+ {
+ printBoundFormula(term[1], os, map);
+ }
+ else
+ {
+ printBoundTerm(term[1], os, map);
+ }
os << " ";
- printBoundTerm(term[2], os, map);
+ if (useFormulaType)
+ {
+ printBoundFormula(term[2], os, map);
+ }
+ else
+ {
+ printBoundTerm(term[2], os, map);
+ }
os << ")";
return;
}
private:
static void dumpTheoryLemmas(const IdToSatClause& lemmas);
+ // Prints this boolean term as a formula.
+ // If necessary, it prints a wrapper converting a `Bool`-sorted term to a
+ // formula.
+ void printBoundFormula(Expr term, std::ostream& os, const ProofLetMap& map);
+
// TODO: this function should be moved into the BV prover.
std::map<Node, std::string> d_assertionToRewrite;
*/
virtual void printRewriteProof(std::ostream& os, const Node &n1, const Node &n2);
- // Return true if node prints as bool, false if it prints as a formula.
+ /**
+ * Return whether this node, when serialized as an LFSC proof, has sort `Bool`.
+ *
+ * This is virtual because it ultimately, theories control the serialization
+ * of their proofs, so a theory will need to override this appropriately.
+ *
+ * This should only be called on nodes of type `Bool`.
+ */
virtual bool printsAsBool(const Node &n) {
// Most nodes print as formulas, so this is the default.
return false;
regress0/arith/issue1399.smt2
regress0/arith/issue3412.smt2
regress0/arith/issue3413.smt2
+ regress0/arith/ite-lift.smt2
regress0/arith/leq.01.smtv1.smt2
regress0/arith/miplib.cvc
regress0/arith/miplib2.cvc
--- /dev/null
+; COMMAND-LINE: --check-proofs
+(set-option :incremental false)
+(set-info :status unsat)
+(set-info :category "crafted")
+(set-info :difficulty "0")
+(set-logic QF_LRA)
+
+(declare-fun x_0 () Real)
+(declare-fun x_1 () Real)
+(declare-fun b_f () Bool)
+(assert (<= x_0 0))
+(assert (<= x_1 0))
+(assert (not b_f))
+(assert (ite b_f b_f (>= (+ x_0 x_1) 1)))
+(check-sat)