diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-09-28 18:33:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 18:33:03 -0500 |
commit | 0ae9a3cfd78bc2d0b8a603a21f2181038fab4880 (patch) | |
tree | 7db1a29bf39973de0754af63aa7dbdfc01b50cab /src/theory | |
parent | d4564e7ef8eb277fcfc42c3130a3180165594b58 (diff) |
Minor fixes to quantifiers proofs (#5151)
Includes minor changes to the proof checker and a fix in the instantiate module.
Diffstat (limited to 'src/theory')
-rw-r--r-- | src/theory/quantifiers/instantiate.cpp | 2 | ||||
-rw-r--r-- | src/theory/quantifiers/proof_checker.cpp | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/theory/quantifiers/instantiate.cpp b/src/theory/quantifiers/instantiate.cpp index 0abcd98cb..f88c2e7a0 100644 --- a/src/theory/quantifiers/instantiate.cpp +++ b/src/theory/quantifiers/instantiate.cpp @@ -272,7 +272,7 @@ bool Instantiate::addInstantiation( "Instantiate::getInstantiation:qpreprocess", false, PfRule::THEORY_PREPROCESS); - pfTmp->addStep(body, PfRule::EQ_RESOLVE, {orig_body, proven}, {body}); + pfTmp->addStep(body, PfRule::EQ_RESOLVE, {orig_body, proven}, {}); } } Trace("inst-debug") << "...preprocess to " << body << std::endl; diff --git a/src/theory/quantifiers/proof_checker.cpp b/src/theory/quantifiers/proof_checker.cpp index 5ba390591..e2a416120 100644 --- a/src/theory/quantifiers/proof_checker.cpp +++ b/src/theory/quantifiers/proof_checker.cpp @@ -36,23 +36,30 @@ Node QuantifiersProofRuleChecker::checkInternal( PfRule id, const std::vector<Node>& children, const std::vector<Node>& args) { NodeManager* nm = NodeManager::currentNM(); + SkolemManager* sm = nm->getSkolemManager(); // compute what was proven - if (id == PfRule::WITNESS_INTRO || id == PfRule::EXISTS_INTRO) + if (id == PfRule::EXISTS_INTRO) { Assert(children.size() == 1); Assert(args.size() == 1); - SkolemManager* sm = nm->getSkolemManager(); Node p = children[0]; Node t = args[0]; - Node exists = sm->mkExistential(t, p); - if (id == PfRule::EXISTS_INTRO) + return sm->mkExistential(t, p); + } + else if (id == PfRule::WITNESS_INTRO) + { + Assert(children.size() == 1); + Assert(args.empty()); + if (children[0].getKind() != EXISTS || children[0][0].getNumChildren() != 1) { - return exists; + return Node::null(); } std::vector<Node> skolems; - sm->mkSkolemize(exists, skolems, "k"); + sm->mkSkolemize(children[0], skolems, "k"); Assert(skolems.size() == 1); - return skolems[0]; + Node witness = SkolemManager::getWitnessForm(skolems[0]); + Assert(witness.getKind() == WITNESS && witness[0] == children[0][0]); + return skolems[0].eqNode(witness); } else if (id == PfRule::SKOLEMIZE) { @@ -64,7 +71,6 @@ Node QuantifiersProofRuleChecker::checkInternal( { return Node::null(); } - SkolemManager* sm = nm->getSkolemManager(); Node exists; if (children[0].getKind() == EXISTS) { |