aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-query
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2023-08-17 17:07:12 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2023-08-17 17:07:12 +0200
commit263e7c025ab19573fba087f050b9dc1f1ade193f (patch)
treef6aed07a24e179f0db9d0e463dfad7ef2eb6ad4b /subprojects/store-query
parentfeat: basic semantics mapping and visualization (diff)
downloadrefinery-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')
-rw-r--r--subprojects/store-query/src/main/java/tools/refinery/store/query/literal/RepresentativeElectionLiteral.java16
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 @@
6package tools.refinery.store.query.literal; 6package tools.refinery.store.query.literal;
7 7
8import tools.refinery.store.query.Constraint; 8import tools.refinery.store.query.Constraint;
9import tools.refinery.store.query.equality.LiteralEqualityHelper;
10import tools.refinery.store.query.equality.LiteralHashCodeHelper;
9import tools.refinery.store.query.substitution.Substitution; 11import tools.refinery.store.query.substitution.Substitution;
10import tools.refinery.store.query.term.NodeVariable; 12import tools.refinery.store.query.term.NodeVariable;
11import tools.refinery.store.query.term.ParameterDirection; 13import 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(\"");