summaryrefslogtreecommitdiff
path: root/src/proof/theory_proof.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/proof/theory_proof.cpp')
-rw-r--r--src/proof/theory_proof.cpp46
1 files changed, 38 insertions, 8 deletions
diff --git a/src/proof/theory_proof.cpp b/src/proof/theory_proof.cpp
index d95572820..eee75e612 100644
--- a/src/proof/theory_proof.cpp
+++ b/src/proof/theory_proof.cpp
@@ -872,6 +872,23 @@ void LFSCTheoryProofEngine::printBoundTerm(Expr term, std::ostream& os, const Pr
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);
@@ -882,17 +899,30 @@ void LFSCTheoryProofEngine::printCoreTerm(Expr term, std::ostream& os, const Pro
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;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback