diff options
Diffstat (limited to 'subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java')
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java b/subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java index 2ba6becc..c6e8b8c9 100644 --- a/subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java +++ b/subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java | |||
@@ -1,9 +1,22 @@ | |||
1 | package tools.refinery.store.query; | 1 | package tools.refinery.store.query; |
2 | 2 | ||
3 | import tools.refinery.store.query.equality.LiteralEqualityHelper; | ||
3 | import tools.refinery.store.query.literal.Literal; | 4 | import tools.refinery.store.query.literal.Literal; |
4 | 5 | ||
5 | import java.util.List; | 6 | import java.util.List; |
6 | import java.util.Set; | 7 | import java.util.Set; |
7 | 8 | ||
8 | public record DnfClause(Set<Variable> quantifiedVariables, List<Literal> literals) { | 9 | public record DnfClause(Set<Variable> quantifiedVariables, List<Literal> literals) { |
10 | public boolean equalsWithSubstitution(LiteralEqualityHelper helper, DnfClause other) { | ||
11 | int size = literals.size(); | ||
12 | if (size != other.literals.size()) { | ||
13 | return false; | ||
14 | } | ||
15 | for (int i = 0; i < size; i++) { | ||
16 | if (!literals.get(i).equalsWithSubstitution(helper, other.literals.get(i))) { | ||
17 | return false; | ||
18 | } | ||
19 | } | ||
20 | return true; | ||
21 | } | ||
9 | } | 22 | } |