diff options
author | Haniel Barbosa <hanielbbarbosa@gmail.com> | 2020-08-12 11:31:30 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 09:31:30 -0500 |
commit | a852ea2c368a81c37eadccc02b3d36aec1a55c12 (patch) | |
tree | a6c07d8537223a33dc317017676aa6435606691c /src/theory/uf/equality_engine.h | |
parent | c5a7dc772788ea3f1d568da0d8ef4effca080b9c (diff) |
(proof-new) Improving proof-production in Equality Engine (#4871)
This commit improves functionalities of the equality engine so that it is easier to produce proofs for its reasoning. They are:
avoiding assertion of already entailed predicates/equalities.
better EqProof of disequalities with constants
correct EqProof involving n-ary congruence kinds
Diffstat (limited to 'src/theory/uf/equality_engine.h')
-rw-r--r-- | src/theory/uf/equality_engine.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/theory/uf/equality_engine.h b/src/theory/uf/equality_engine.h index 42ae3437d..9d1fc6165 100644 --- a/src/theory/uf/equality_engine.h +++ b/src/theory/uf/equality_engine.h @@ -415,6 +415,23 @@ private: /** Are we in propagate */ bool d_inPropagate; + /** Proof-new specific construction of equality conclusions for EqProofs + * + * Given two equality node ids, build an equality between the nodes they + * correspond to and add it as a conclusion to the given EqProof. + * + * The equality is only built if the nodes the ids correspond to are not + * internal nodes in the equality engine, i.e., they correspond to full + * applications of the respective kinds. Since the equality engine also + * applies congruence over n-ary kinds, internal nodes, i.e., partial + * applications, may still correspond to "full applications" in the + * first-order sense. Therefore this method also checks, in the case of n-ary + * congruence kinds, if an equality between "full applications" can be built. + */ + void buildEqConclusion(EqualityNodeId id1, + EqualityNodeId id2, + EqProof* eqp) const; + /** * Get an explanation of the equality t1 = t2. Returns the asserted equalities * that imply t1 = t2. Returns TNodes as the assertion equalities should be @@ -695,8 +712,12 @@ public: * @param polarity true if asserting the predicate, false if * asserting the negated predicate * @param reason the reason to keep for building explanations + * @return true if a new fact was asserted, false if this call was a no-op. */ - void assertPredicate(TNode p, bool polarity, TNode reason, unsigned pid = MERGED_THROUGH_EQUALITY); + bool assertPredicate(TNode p, + bool polarity, + TNode reason, + unsigned pid = MERGED_THROUGH_EQUALITY); /** * Adds an equality eq with the given polarity to the database. @@ -705,8 +726,12 @@ public: * @param polarity true if asserting the equality, false if * asserting the negated equality * @param reason the reason to keep for building explanations + * @return true if a new fact was asserted, false if this call was a no-op. */ - void assertEquality(TNode eq, bool polarity, TNode reason, unsigned pid = MERGED_THROUGH_EQUALITY); + bool assertEquality(TNode eq, + bool polarity, + TNode reason, + unsigned pid = MERGED_THROUGH_EQUALITY); /** * Returns the current representative of the term t. @@ -807,6 +832,9 @@ public: * Returns a fresh merge reason type tag for the client to use. */ unsigned getFreshMergeReasonType(); + + /** Identify this equality engine (for debugging, etc..) */ + std::string identify() const; }; } // Namespace eq |