summaryrefslogtreecommitdiff
path: root/src/theory/sets
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-04-05 10:21:55 -0500
committerGitHub <noreply@github.com>2021-04-05 15:21:55 +0000
commit73bc16fbba65ca8d8cdc9dd6674ae9280658ee9a (patch)
tree41175283436792bb3332bc465793d901ff55544e /src/theory/sets
parentcf5cd9981f92985e647df5bb9244679715951e8c (diff)
Fix subtyping for sets care graph (#6278)
We were getting types for set singleton/membership in a way that was unsafe for subtyping, which was leading to incorrectly computing care graphs for sets of reals. Fixes #5705.
Diffstat (limited to 'src/theory/sets')
-rw-r--r--src/theory/sets/theory_sets_private.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/theory/sets/theory_sets_private.cpp b/src/theory/sets/theory_sets_private.cpp
index 8d005c6fe..ea7e773b7 100644
--- a/src/theory/sets/theory_sets_private.cpp
+++ b/src/theory/sets/theory_sets_private.cpp
@@ -985,9 +985,20 @@ void TheorySetsPrivate::computeCareGraph()
{
Trace("sets-cg-debug") << "...build for " << f1 << std::endl;
Assert(d_equalityEngine->hasTerm(f1));
- // break into index based on operator, and type of first argument (since
- // some operators are parametric)
- TypeNode tn = f1[0].getType();
+ // break into index based on operator, and the type of the element
+ // type of the proper set, which notice must be safe wrt subtyping.
+ TypeNode tn;
+ if (k == kind::SINGLETON)
+ {
+ // get the type of the singleton set (not the type of its element)
+ tn = f1.getType().getSetElementType();
+ }
+ else
+ {
+ Assert (k == kind::MEMBER);
+ // get the element type of the set (not the type of the element)
+ tn = f1[1].getType().getSetElementType();
+ }
std::vector<TNode> reps;
bool hasCareArg = false;
for (unsigned j = 0; j < f1.getNumChildren(); j++)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback