Fixes #8705.
This also impacts unsat cores when proofs are enabled.
Theory::PPAssertStatus TheoryBool::ppAssert(
TrustNode tin, TrustSubstitutionMap& outSubstitutions)
{
+ Assert(tin.getKind() == TrustNodeKind::LEMMA);
TNode in = tin.getNode();
if (in.getKind() == kind::CONST_BOOLEAN && !in.getConst<bool>()) {
// If we get a false literal, we're in conflict
in[0], NodeManager::currentNM()->mkConst<bool>(false), tin);
return PP_ASSERT_STATUS_SOLVED;
}
- } else {
- if (in.isVar())
+ else if (in[0].getKind() == kind::EQUAL && in[0][0].getType().isBoolean())
{
- outSubstitutions.addSubstitutionSolved(
- in, NodeManager::currentNM()->mkConst<bool>(true), tin);
- return PP_ASSERT_STATUS_SOLVED;
+ TNode eq = in[0];
+ if (eq[0].isVar() && isLegalElimination(eq[0], eq[1]))
+ {
+ outSubstitutions.addSubstitutionSolved(eq[0], eq[1].notNode(), tin);
+ return PP_ASSERT_STATUS_SOLVED;
+ }
+ else if (eq[1].isVar() && isLegalElimination(eq[1], eq[0]))
+ {
+ outSubstitutions.addSubstitutionSolved(eq[1], eq[0].notNode(), tin);
+ return PP_ASSERT_STATUS_SOLVED;
+ }
}
}
+ else if (in.isVar())
+ {
+ outSubstitutions.addSubstitutionSolved(
+ in, NodeManager::currentNM()->mkConst<bool>(true), tin);
+ return PP_ASSERT_STATUS_SOLVED;
+ }
+ // the positive Boolean equality case is handled in the default way
return Theory::ppAssert(tin, outSubstitutions);
}
Theory::PPAssertStatus Theory::ppAssert(TrustNode tin,
TrustSubstitutionMap& outSubstitutions)
{
+ Assert(tin.getKind() == TrustNodeKind::LEMMA);
TNode in = tin.getNode();
if (in.getKind() == kind::EQUAL)
{
return PP_ASSERT_STATUS_SOLVED;
}
}
- else if (in.getKind() == kind::NOT && in[0].getKind() == kind::EQUAL
- && in[0][0].getType().isBoolean())
- {
- TNode eq = in[0];
- if (eq[0].isVar())
- {
- Node res = eq[0].eqNode(eq[1].notNode());
- TrustNode tn = TrustNode::mkTrustRewrite(in, res, nullptr);
- return ppAssert(tn, outSubstitutions);
- }
- else if (eq[1].isVar())
- {
- Node res = eq[1].eqNode(eq[0].notNode());
- TrustNode tn = TrustNode::mkTrustRewrite(in, res, nullptr);
- return ppAssert(tn, outSubstitutions);
- }
- }
return PP_ASSERT_STATUS_UNSOLVED;
}
theory::Theory::PPAssertStatus TheoryEngine::solve(
TrustNode tliteral, TrustSubstitutionMap& substitutionOut)
{
+ Assert(tliteral.getKind() == TrustNodeKind::LEMMA);
// Reset the interrupt flag
d_interrupted = false;
regress0/cores/issue5238.smt2
regress0/cores/issue5902.smt2
regress0/cores/issue5908.smt2
+ regress0/cores/issue8705-bool-ppassert.smt2
regress0/cvc-rerror-print.cvc.smt2
regress0/cvc3-bug15.cvc.smt2
regress0/cvc3.userdoc.01.cvc.smt2
--- /dev/null
+; COMMAND-LINE: --produce-proofs
+; EXPECT: unsat
+(set-logic ALL)
+(set-info :status unsat)
+(declare-fun a () String)
+(declare-fun b () String)
+(declare-fun c () Bool)
+(declare-fun d () Bool)
+(declare-fun g () Bool)
+(declare-fun e () Bool)
+(declare-fun f () String)
+(assert (= b f))
+(assert (= c (= "" b)))
+(assert (= d (not c)))
+(assert d)
+(assert (= a f))
+(assert (= g (not (= e (not (= "" a))))))
+(assert g)
+(assert e)
+(check-sat)