diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-10-06 10:02:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 10:02:54 -0500 |
commit | 2d8889f935ca78ef4a5555f0e6bbed76dbc559d7 (patch) | |
tree | 2d83522cd3d1e0d711773a45de0d2be2952dbb7c /src/theory/booleans | |
parent | 6d663abe421c07976755c224180b1a1ee93442f6 (diff) |
(proof-new) Add interface for trusted substitution and update ppAssert (#5193)
The current work on proof-new involves proofs for preprocessing. The biggest issue currently is that our preprocessing passes do not track proofs for substitutions.
This adds a "trusted substitution" class with is a layer on substitution map. The proof aspect of this class is not yet implemented, this PR just adds its interface.
This also updates Theory::ppAssert to take a TrustSubstitutionMap instead of a SubstitutionMap, since eventually we will require proofs to be provided for substitutions that are added to this map.
Diffstat (limited to 'src/theory/booleans')
-rw-r--r-- | src/theory/booleans/theory_bool.cpp | 14 | ||||
-rw-r--r-- | src/theory/booleans/theory_bool.h | 3 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/theory/booleans/theory_bool.cpp b/src/theory/booleans/theory_bool.cpp index 8ce0c077a..c08012b61 100644 --- a/src/theory/booleans/theory_bool.cpp +++ b/src/theory/booleans/theory_bool.cpp @@ -50,8 +50,10 @@ TheoryBool::TheoryBool(context::Context* c, } } -Theory::PPAssertStatus TheoryBool::ppAssert(TNode in, SubstitutionMap& outSubstitutions) { - +Theory::PPAssertStatus TheoryBool::ppAssert( + TrustNode tin, TrustSubstitutionMap& outSubstitutions) +{ + TNode in = tin.getNode(); if (in.getKind() == kind::CONST_BOOLEAN && !in.getConst<bool>()) { // If we get a false literal, we're in conflict return PP_ASSERT_STATUS_CONFLICT; @@ -61,18 +63,20 @@ Theory::PPAssertStatus TheoryBool::ppAssert(TNode in, SubstitutionMap& outSubsti if (in.getKind() == kind::NOT) { if (in[0].isVar()) { - outSubstitutions.addSubstitution(in[0], NodeManager::currentNM()->mkConst<bool>(false)); + outSubstitutions.addSubstitutionSolved( + in[0], NodeManager::currentNM()->mkConst<bool>(false), tin); return PP_ASSERT_STATUS_SOLVED; } } else { if (in.isVar()) { - outSubstitutions.addSubstitution(in, NodeManager::currentNM()->mkConst<bool>(true)); + outSubstitutions.addSubstitutionSolved( + in, NodeManager::currentNM()->mkConst<bool>(true), tin); return PP_ASSERT_STATUS_SOLVED; } } - return Theory::ppAssert(in, outSubstitutions); + return Theory::ppAssert(tin, outSubstitutions); } }/* CVC4::theory::booleans namespace */ diff --git a/src/theory/booleans/theory_bool.h b/src/theory/booleans/theory_bool.h index 720ba4ed4..0a8ca2766 100644 --- a/src/theory/booleans/theory_bool.h +++ b/src/theory/booleans/theory_bool.h @@ -39,7 +39,8 @@ class TheoryBool : public Theory { TheoryRewriter* getTheoryRewriter() override { return &d_rewriter; } - PPAssertStatus ppAssert(TNode in, SubstitutionMap& outSubstitutions) override; + PPAssertStatus ppAssert(TrustNode tin, + TrustSubstitutionMap& outSubstitutions) override; std::string identify() const override { return std::string("TheoryBool"); } |