This PR fixes a missing connection in trust substitution proofs, which was the cause of open proofs when solved equalities from ppAssert were not justified by proofs.
Also distinguishes TRUST_SUBS_EQ from TRUST_SUBS_MAP for clarity.
case PfRule::TRUST_REWRITE: return "TRUST_REWRITE";
case PfRule::TRUST_SUBS: return "TRUST_SUBS";
case PfRule::TRUST_SUBS_MAP: return "TRUST_SUBS_MAP";
+ case PfRule::TRUST_SUBS_EQ: return "TRUST_SUBS_EQ";
//================================================= Boolean rules
case PfRule::RESOLUTION: return "RESOLUTION";
case PfRule::CHAIN_RESOLUTION: return "CHAIN_RESOLUTION";
THEORY_REWRITE,
// The remaining rules in this section have the signature of a "trusted rule":
//
- // Children: none
+ // Children: ?
// Arguments: (F)
// ---------------------------------------------------------------
// Conclusion: F
//
+ // Unless stated below, the expected children vector of the rule is empty.
+ //
// where F is an equality of the form t = t' where t was replaced by t'
// based on some preprocessing pass, or otherwise F was added as a new
// assertion by some preprocessing pass.
// could not be replayed during proof postprocessing.
TRUST_SUBS,
// where F is an equality (= t t') that holds by a form of substitution that
- // could not be determined by the TrustSubstitutionMap.
+ // could not be determined by the TrustSubstitutionMap. This inference may
+ // contain possibly multiple children corresponding to the formulas used to
+ // derive the substitution.
TRUST_SUBS_MAP,
+ // where F is a solved equality of the form (= x t) derived as the solved
+ // form of F', where F' is given as a child.
+ TRUST_SUBS_EQ,
// ========= SAT Refutation for assumption-based unsat cores
// Children: (P1, ..., Pn)
// Arguments: none
pc->registerTrustedChecker(PfRule::TRUST_REWRITE, this, 1);
pc->registerTrustedChecker(PfRule::TRUST_SUBS, this, 1);
pc->registerTrustedChecker(PfRule::TRUST_SUBS_MAP, this, 1);
+ pc->registerTrustedChecker(PfRule::TRUST_SUBS_EQ, this, 3);
}
Node BuiltinProofRuleChecker::applySubstitutionRewrite(
|| id == PfRule::THEORY_EXPAND_DEF || id == PfRule::WITNESS_AXIOM
|| id == PfRule::THEORY_LEMMA || id == PfRule::THEORY_REWRITE
|| id == PfRule::TRUST_REWRITE || id == PfRule::TRUST_SUBS
- || id == PfRule::TRUST_SUBS_MAP)
+ || id == PfRule::TRUST_SUBS_MAP || id == PfRule::TRUST_SUBS_EQ)
{
// "trusted" rules
Assert(!args.empty());
* add the solved substitutions to the map, if any. The method should return
* true if the literal can be safely removed from the input problem.
*
- * Note that tin has trude node kind LEMMA. Its proof generator should be
- * take into account when adding a substitution to outSubstitutions when
+ * Note that tin has trust node kind LEMMA. Its proof generator should be
+ * taken into account when adding a substitution to outSubstitutions when
* proofs are enabled.
*/
virtual PPAssertStatus ppAssert(TrustNode tin,
// Try to transform tn.getProven() to (= x t) here, if necessary
if (!d_tspb->applyPredTransform(proven, eq, {}))
{
- // failed to rewrite, it is critical for unsat cores that proven is a
- // premise here, since the conclusion depends on it
- addSubstitution(x, t, PfRule::TRUST_SUBS_MAP, {proven}, {eq});
- Trace("trust-subs") << "...failed to rewrite" << std::endl;
- return nullptr;
+ // failed to rewrite, we add a trust step which assumes eq is provable
+ // from proven, and proceed as normal.
+ Trace("trust-subs") << "...failed to rewrite " << proven << std::endl;
+ d_tspb->addStep(PfRule::TRUST_SUBS_EQ, {proven}, {eq}, eq);
}
Trace("trust-subs") << "...successful rewrite" << std::endl;
solvePg->addSteps(*d_tspb.get());
regress0/printer/tuples_and_records.cvc
regress0/proofs/issue277-circuit-propagator.smt2
regress0/proofs/scope.smt2
+ regress0/proofs/trust-subs-eq-open.smt2
regress0/push-pop/boolean/fuzz_12.smt2
regress0/push-pop/boolean/fuzz_13.smt2
regress0/push-pop/boolean/fuzz_14.smt2
-; COMMAND-LINE: --no-check-proofs
+; COMMAND-LINE:
; EXPECT: unsat
(set-option :incremental false)
(set-info :source "Hand-crafted bit-vector benchmarks. Some are from the SVC benchmark suite.
-; COMMAND-LINE: --no-check-proofs
+; COMMAND-LINE:
; EXPECT: unsat
(set-option :incremental false)
(set-info :source "Hand-crafted bit-vector benchmarks. Some are from the SVC benchmark suite.
-; COMMAND-LINE: --no-check-proofs
+; COMMAND-LINE:
; EXPECT: unsat
(set-logic QF_BV)
(set-info :smt-lib-version 2.6)
(assert (<= x0 (- 13)))
(check-sat)
(check-sat)
-(check-sat)
\ No newline at end of file
+(check-sat)
--- /dev/null
+(set-logic ALL)
+(set-info :status unsat)
+(declare-fun c () (_ BitVec 3))
+(check-sat-assuming (
+(and
+(= (_ bv0 1) ((_ extract 1 1) c))
+(= (_ bv1 1) ((_ extract 0 0) c))
+(not (= (_ bv1 2) ((_ extract 1 0) c))))))