diff options
author | mudathirmahgoub <mudathirmahgoub@gmail.com> | 2020-10-24 09:16:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-24 09:16:52 -0500 |
commit | 0a4ee1ac60e6b914ca8173c773eb9db54cdf0f61 (patch) | |
tree | 04171a29b35069bac913785daf30a188720b004c /src/theory/sets | |
parent | 6937d6afe65ae3e51f514ca463f95faa3feda7aa (diff) |
Fix issue 5271 (#5335)
This PR fixes #5271 by splitting on the equality of set members which ensures members are distinct when collectModelInfo is called.
Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
Diffstat (limited to 'src/theory/sets')
-rw-r--r-- | src/theory/sets/theory_sets_private.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/theory/sets/theory_sets_private.cpp b/src/theory/sets/theory_sets_private.cpp index b951d0333..a382688a9 100644 --- a/src/theory/sets/theory_sets_private.cpp +++ b/src/theory/sets/theory_sets_private.cpp @@ -850,7 +850,17 @@ void TheorySetsPrivate::addCarePairs(TNodeTrie* t1, { Node f1 = t1->getData(); Node f2 = t2->getData(); - if (!d_state.areEqual(f1, f2)) + + // Usually when (= (f x) (f y)), we don't care whether (= x y) is true or + // not for the shared variables x, y in the care graph. + // However, this does not apply to the membership operator since the + // equality or disequality between members affects the number of elements + // in a set. Therefore we need to split on (= x y) for kind MEMBER. + // Example: + // Suppose (= (member x S) member( y, S)) is true and there are + // no other members in S. We would get S = {x} if (= x y) is true. + // Otherwise we would get S = {x, y}. + if (f1.getKind() == MEMBER || !d_state.areEqual(f1, f2)) { Trace("sets-cg") << "Check " << f1 << " and " << f2 << std::endl; vector<pair<TNode, TNode> > currentPairs; @@ -1101,6 +1111,9 @@ bool TheorySetsPrivate::collectModelValues(TheoryModel* m, TypeNode elementType = eqc.getType().getSetElementType(); for (const std::pair<const Node, Node>& itmm : emems) { + Trace("sets-model") + << "m->getRepresentative(" << itmm.first + << ")= " << m->getRepresentative(itmm.first) << std::endl; Node t = nm->mkSingleton(elementType, itmm.first); els.push_back(t); } |