Makes it so that all theory-specific proof rules for this purpose are replaced by the generic THEORY_INFERENCE.
case PfRule::ITE_ELIM2: return "ITE_ELIM2";
case PfRule::NOT_ITE_ELIM1: return "NOT_ITE_ELIM1";
case PfRule::NOT_ITE_ELIM2: return "NOT_ITE_ELIM2";
- //================================================= De Morgan rules
case PfRule::NOT_AND: return "NOT_AND";
//================================================= CNF rules
case PfRule::CNF_AND_POS: return "CNF_AND_POS";
return "ARRAYS_READ_OVER_WRITE_CONTRA";
case PfRule::ARRAYS_READ_OVER_WRITE_1: return "ARRAYS_READ_OVER_WRITE_1";
case PfRule::ARRAYS_EXT: return "ARRAYS_EXT";
- case PfRule::ARRAYS_TRUST: return "ARRAYS_TRUST";
case PfRule::ARRAYS_EQ_RANGE_EXPAND: return "ARRAYS_EQ_RANGE_EXPAND";
//================================================= Bit-Vector rules
case PfRule::BV_BITBLAST: return "BV_BITBLAST";
case PfRule::DT_COLLAPSE: return "DT_COLLAPSE";
case PfRule::DT_SPLIT: return "DT_SPLIT";
case PfRule::DT_CLASH: return "DT_CLASH";
- case PfRule::DT_TRUST: return "DT_TRUST";
//================================================= Quantifiers rules
case PfRule::SKOLEM_INTRO: return "SKOLEM_INTRO";
case PfRule::EXISTS_INTRO: return "EXISTS_INTRO";
case PfRule::RE_ELIM: return "RE_ELIM";
case PfRule::STRING_CODE_INJ: return "STRING_CODE_INJ";
case PfRule::STRING_SEQ_UNIT_INJ: return "STRING_SEQ_UNIT_INJ";
- case PfRule::STRING_TRUST: return "STRING_TRUST";
//================================================= Arith rules
case PfRule::MACRO_ARITH_SCALE_SUM_UB:
return "ARITH_SCALE_SUM_UPPER_BOUNDS";
case PfRule::ARITH_TRICHOTOMY: return "ARITH_TRICHOTOMY";
case PfRule::INT_TIGHT_LB: return "INT_TIGHT_LB";
case PfRule::INT_TIGHT_UB: return "INT_TIGHT_UB";
- case PfRule::INT_TRUST: return "INT_TRUST";
case PfRule::ARITH_MULT_SIGN: return "ARITH_MULT_SIGN";
case PfRule::ARITH_MULT_POS: return "ARITH_MULT_POS";
case PfRule::ARITH_MULT_NEG: return "ARITH_MULT_NEG";
// (forall ((x T))
// (=> (and (<= i x) (<= x j)) (= (select a x) (select b x)))))
ARRAYS_EQ_RANGE_EXPAND,
- // ======== Array Trust
- // Children: (P1 ... Pn)
- // Arguments: (F)
- // ---------------------
- // Conclusion: F
- ARRAYS_TRUST,
//================================================= Bit-Vector rules
// Note: bitblast() represents the result of the bit-blasted term as a
// Conclusion: false
// for i != j.
DT_CLASH,
- // ======== Datatype Trust
- // Children: (P1 ... Pn)
- // Arguments: (F)
- // ---------------------
- // Conclusion: F
- DT_TRUST,
//================================================= Quantifiers rules
// ======== Skolem intro
// Also applies to the case where (seq.unit y) is a constant sequence
// of length one.
STRING_SEQ_UNIT_INJ,
- // ======== String Trust
- // Children: none
- // Arguments: (Q)
- // ---------------------
- // Conclusion: (Q)
- STRING_TRUST,
//================================================= Arithmetic rules
// ======== Adding Inequalities
// ---------------------
// Conclusion: arith::OperatorElim::getAxiomFor(t)
ARITH_OP_ELIM_AXIOM,
- // ======== Int Trust
- // Children: (P1 ... Pn)
- // Arguments: (Q)
- // ---------------------
- // Conclusion: (Q)
- INT_TRUST,
//======== Multiplication sign inference
// Children: none
#include "theory/arith/congruence_manager.h"
#include "theory/arith/normal_form.h"
#include "theory/arith/partial_model.h"
+#include "theory/builtin/proof_checker.h"
#include "theory/rewriter.h"
using namespace std;
}
case ArithProofType::IntHoleAP:
{
- pf = pnm->mkNode(PfRule::INT_TRUST,
+ Node t =
+ builtin::BuiltinProofRuleChecker::mkTheoryIdNode(THEORY_ARITH);
+ pf = pnm->mkNode(PfRule::THEORY_INFERENCE,
children,
- {getProofLiteral()},
+ {getProofLiteral(), t},
getProofLiteral());
break;
}
#include "theory/arith/pp_rewrite_eq.h"
#include "options/arith_options.h"
+#include "theory/builtin/proof_checker.h"
#include "theory/rewriter.h"
namespace cvc5 {
// don't need to rewrite terms since rewritten is not a non-standard op
if (proofsEnabled())
{
+ Node t = builtin::BuiltinProofRuleChecker::mkTheoryIdNode(THEORY_ARITH);
return d_ppPfGen.mkTrustedRewrite(
atom,
rewritten,
- d_pnm->mkNode(PfRule::INT_TRUST, {}, {atom.eqNode(rewritten)}));
+ d_pnm->mkNode(
+ PfRule::THEORY_INFERENCE, {}, {atom.eqNode(rewritten), t}));
}
return TrustNode::mkTrustRewrite(atom, rewritten, nullptr);
}
pc->registerChecker(PfRule::INT_TIGHT_UB, this);
pc->registerChecker(PfRule::INT_TIGHT_LB, this);
pc->registerChecker(PfRule::ARITH_OP_ELIM_AXIOM, this);
-
pc->registerChecker(PfRule::ARITH_MULT_POS, this);
pc->registerChecker(PfRule::ARITH_MULT_NEG, this);
- // trusted rules
- pc->registerTrustedChecker(PfRule::INT_TRUST, this, 2);
}
Node ArithProofRuleChecker::checkInternal(PfRule id,
}
// Check that all have the same constant:
}
- case PfRule::INT_TRUST:
- {
- if (Debug.isOn("arith::pf::check::trust"))
- {
- Debug("arith::pf::check::trust") << "Arith PfRule:" << id << std::endl;
- Debug("arith::pf::check::trust") << " children: " << std::endl;
- for (const auto& c : children)
- {
- Debug("arith::pf::check::trust") << " * " << c << std::endl;
- }
- Debug("arith::pf::check::trust") << " args:" << std::endl;
- for (const auto& c : args)
- {
- Debug("arith::pf::check::trust") << " * " << c << std::endl;
- }
- }
- Assert(args.size() == 1);
- return args[0];
- }
case PfRule::ARITH_OP_ELIM_AXIOM:
{
Assert(children.empty());
#include "theory/arrays/inference_manager.h"
#include "options/smt_options.h"
+#include "theory/builtin/proof_checker.h"
#include "theory/theory.h"
#include "theory/theory_state.h"
#include "theory/uf/equality_engine.h"
break;
case PfRule::ARRAYS_EXT: children.push_back(exp); break;
default:
- if (id != PfRule::ARRAYS_TRUST)
+ if (id != PfRule::THEORY_INFERENCE)
{
Assert(false) << "Unknown rule " << id << "\n";
}
children.push_back(exp);
args.push_back(conc);
- id = PfRule::ARRAYS_TRUST;
+ args.push_back(
+ builtin::BuiltinProofRuleChecker::mkTheoryIdNode(THEORY_ARRAYS));
+ id = PfRule::THEORY_INFERENCE;
break;
}
}
pc->registerChecker(PfRule::ARRAYS_READ_OVER_WRITE_1, this);
pc->registerChecker(PfRule::ARRAYS_EXT, this);
pc->registerChecker(PfRule::ARRAYS_EQ_RANGE_EXPAND, this);
- // trusted rules
- pc->registerTrustedChecker(PfRule::ARRAYS_TRUST, this, 2);
}
Node ArraysProofRuleChecker::checkInternal(PfRule id,
Node expandedEqRange = TheoryArraysRewriter::expandEqRange(args[0]);
return args[0].eqNode(expandedEqRange);
}
- if (id == PfRule::ARRAYS_TRUST)
- {
- // "trusted" rules
- Assert(!args.empty());
- Assert(args[0].getType().isBoolean());
- return args[0];
- }
// no rule
return Node::null();
}
{
preRegisterTermInternal(selConst);
}
+ // not currently supported in proofs, use THEORY_INFERENCE
d_im.assertInference(selConst.eqNode(defValue),
true,
InferenceId::ARRAYS_CONST_ARRAY_DEFAULT,
d_true,
- PfRule::ARRAYS_TRUST);
+ PfRule::THEORY_INFERENCE);
}
const CTNodeList* stores = d_infoMap.getStores(a);
#include "proof/proof.h"
#include "proof/proof_checker.h"
+#include "theory/builtin/proof_checker.h"
#include "theory/datatypes/theory_datatypes_utils.h"
#include "theory/model_manager.h"
#include "theory/rewriter.h"
{
// failed to reconstruct, add trust
Trace("dt-ipc") << "...failed " << infer << std::endl;
- cdp->addStep(conc, PfRule::DT_TRUST, expv, {conc});
+ Node t = builtin::BuiltinProofRuleChecker::mkTheoryIdNode(THEORY_DATATYPES);
+ cdp->addStep(conc, PfRule::THEORY_INFERENCE, expv, {conc, t});
}
else
{
pc->registerChecker(PfRule::DT_COLLAPSE, this);
pc->registerChecker(PfRule::DT_SPLIT, this);
pc->registerChecker(PfRule::DT_CLASH, this);
- // trusted rules
- pc->registerTrustedChecker(PfRule::DT_TRUST, this, 2);
}
Node DatatypesProofRuleChecker::checkInternal(PfRule id,
}
return nm->mkConst(false);
}
- else if (id == PfRule::DT_TRUST)
- {
- Assert(!args.empty());
- Assert(args[0].getType().isBoolean());
- return args[0];
- }
// no rule
return Node::null();
}
if (conc.getKind() != OR)
{
// This should never happen. If it does, we resort to using
- // STRING_TRUST below (in production mode).
+ // THEORY_INFERENCE below (in production mode).
Assert(false) << "Expected OR conclusion for " << infer;
}
else
case InferenceId::STRINGS_CTN_TRANS:
case InferenceId::STRINGS_CTN_DECOMPOSE:
default:
- // do nothing, these will be converted to STRING_TRUST below since the
+ // do nothing, these will be converted to THEORY_INFERENCE below since the
// rule is unknown.
break;
}
Trace("strings-ipc-fail") << " e: " << ec << std::endl;
}
}
- // untrustworthy conversion, the argument of STRING_TRUST is its conclusion
+ // untrustworthy conversion, the argument of THEORY_INFERENCE is its
+ // conclusion
ps.d_args.clear();
ps.d_args.push_back(conc);
+ Node t = builtin::BuiltinProofRuleChecker::mkTheoryIdNode(THEORY_STRINGS);
+ ps.d_args.push_back(t);
// use the trust rule
- ps.d_rule = PfRule::STRING_TRUST;
+ ps.d_rule = PfRule::THEORY_INFERENCE;
// add to stats
d_statistics.d_inferencesNoPf << infer;
}
pc->registerChecker(PfRule::RE_ELIM, this);
pc->registerChecker(PfRule::STRING_CODE_INJ, this);
pc->registerChecker(PfRule::STRING_SEQ_UNIT_INJ, this);
- // trusted rules
- pc->registerTrustedChecker(PfRule::STRING_TRUST, this, 2);
}
Node StringProofRuleChecker::checkInternal(PfRule id,
AlwaysAssert(t[0].getType() == t[1].getType());
return t[0].eqNode(t[1]);
}
- else if (id == PfRule::STRING_TRUST)
- {
- // "trusted" rules
- Assert(!args.empty());
- Assert(args[0].getType().isBoolean());
- return args[0];
- }
return Node::null();
}