Towards having proofs working on master.
Node checkDebug(PfRule id,
const std::vector<Node>& cchildren,
const std::vector<Node>& args,
- Node expected,
- const char* traceTag);
+ Node expected = Node::null(),
+ const char* traceTag = "");
/** Indicate that psc is the checker for proof rule id */
void registerChecker(PfRule id, ProofRuleChecker* psc);
/**
* [***] This class traverses the left hand side of a given equality-to-prove
* (the term g(f(a),h(a),e) in the above example) and "replays" the rewrite
* steps to obtain its rewritten form. To do so, it applies any available
- * rewrite step both at pre-rewrite (pre-order traversal) and post-rewrite
- * (post-order traversal). It thus does not require the user of this class to
- * distinguish whether a rewrite is a pre-rewrite or a post-rewrite during
- * addRewriteStep. In particular, notice that in the above example, we realize
- * that f(a) --> c at pre-rewrite instead of post-rewriting a --> b and then
- * ending with f(a)=f(b).
+ * rewrite step at pre-rewrite (pre-order traversal) and post-rewrite
+ * (post-order traversal) based on whether the user specified pre-rewrite or a
+ * post-rewrite during addRewriteStep.
*
* This class may additionally be used for term-context-sensitive rewrite
* systems. An example is the term formula removal pass which rewrites
Node ProofPostprocessCallback::addProofForWitnessForm(Node t, CDProof* cdp)
{
- Node tw = SkolemManager::getWitnessForm(t);
+ Node tw = SkolemManager::getOriginalForm(t);
Node eq = t.eqNode(tw);
if (t == tw)
{
return getUnsatCoreInternal();
}
+void SmtEngine::getRelevantInstantiationTermVectors(
+ std::map<Node, std::vector<std::vector<Node>>>& insts)
+{
+ Assert(d_state->getMode() == SmtMode::UNSAT);
+ // generate with new proofs
+ PropEngine* pe = getPropEngine();
+ Assert(pe != nullptr);
+ Assert(pe->getProof() != nullptr);
+ std::shared_ptr<ProofNode> pfn = d_pfManager->getFinalProof(
+ pe->getProof(), *d_asserts, *d_definedFunctions);
+ d_ucManager->getRelevantInstantiations(pfn, insts);
+}
+
std::string SmtEngine::getProof()
{
Trace("smt") << "SMT getProof()\n";
finishInit();
if (options::proof() && getSmtMode() == SmtMode::UNSAT)
{
- // TODO (project #37): minimize instantiations based on proof manager
+ // minimize instantiations based on proof manager
+ getRelevantInstantiationTermVectors(insts);
}
else
{
*/
std::vector<Node> getValues(const std::vector<Node>& exprs);
- /** Print all instantiations made by the quantifiers module. */
+ /** print instantiations
+ *
+ * Print all instantiations for all quantified formulas on out,
+ * returns true if at least one instantiation was printed. The type of output
+ * (list, num, etc.) is determined by printInstMode.
+ */
void printInstantiations(std::ostream& out);
/**
* Print the current proof. This method should be called after an UNSAT
*/
void getInstantiationTermVectors(Node q,
std::vector<std::vector<Node>>& tvecs);
+ /**
+ * As above but only the instantiations that were relevant for the
+ * refutation.
+ */
+ void getRelevantInstantiationTermVectors(
+ std::map<Node, std::vector<std::vector<Node>>>& insts);
/**
* Get instantiation term vectors, which maps each instantiated quantified
* formula to the list of instantiations for that quantified formula. This