diff options
author | 2023-08-17 17:07:12 +0200 | |
---|---|---|
committer | 2023-08-17 17:07:12 +0200 | |
commit | 263e7c025ab19573fba087f050b9dc1f1ade193f (patch) | |
tree | f6aed07a24e179f0db9d0e463dfad7ef2eb6ad4b /subprojects/store-query/src/main/java | |
parent | feat: basic semantics mapping and visualization (diff) | |
download | refinery-263e7c025ab19573fba087f050b9dc1f1ade193f.tar.gz refinery-263e7c025ab19573fba087f050b9dc1f1ade193f.tar.zst refinery-263e7c025ab19573fba087f050b9dc1f1ade193f.zip |
fix: containment link translation
Improper equality implementation of representative election literals merged weak
and strong connected components during query canonicalization.
Diffstat (limited to 'subprojects/store-query/src/main/java')
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java b/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java index 5d57c06c..f6545f9f 100644 --- a/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java +++ b/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java | |||
@@ -6,6 +6,8 @@ | |||
6 | package tools.refinery.store.query.literal; | 6 | package tools.refinery.store.query.literal; |
7 | 7 | ||
8 | import tools.refinery.store.query.Constraint; | 8 | import tools.refinery.store.query.Constraint; |
9 | import tools.refinery.store.query.equality.LiteralEqualityHelper; | ||
10 | import tools.refinery.store.query.equality.LiteralHashCodeHelper; | ||
9 | import tools.refinery.store.query.substitution.Substitution; | 11 | import tools.refinery.store.query.substitution.Substitution; |
10 | import tools.refinery.store.query.term.NodeVariable; | 12 | import tools.refinery.store.query.term.NodeVariable; |
11 | import tools.refinery.store.query.term.ParameterDirection; | 13 | import tools.refinery.store.query.term.ParameterDirection; |
@@ -82,6 +84,20 @@ public class RepresentativeElectionLiteral extends AbstractCallLiteral { | |||
82 | } | 84 | } |
83 | 85 | ||
84 | @Override | 86 | @Override |
87 | public boolean equalsWithSubstitution(LiteralEqualityHelper helper, Literal other) { | ||
88 | if (!super.equalsWithSubstitution(helper, other)) { | ||
89 | return false; | ||
90 | } | ||
91 | var otherRepresentativeElectionLiteral = (RepresentativeElectionLiteral) other; | ||
92 | return connectivity.equals(otherRepresentativeElectionLiteral.connectivity); | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public int hashCodeWithSubstitution(LiteralHashCodeHelper helper) { | ||
97 | return super.hashCodeWithSubstitution(helper) * 31 + connectivity.hashCode(); | ||
98 | } | ||
99 | |||
100 | @Override | ||
85 | public String toString() { | 101 | public String toString() { |
86 | var builder = new StringBuilder(); | 102 | var builder = new StringBuilder(); |
87 | builder.append("@Representative(\""); | 103 | builder.append("@Representative(\""); |