aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-query/src/main/java/tools/refinery/store/query/DnfClause.java
blob: c6e8b8c9b0d9e9875d4affaa40de6f2d829f4314 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package tools.refinery.store.query;

import tools.refinery.store.query.equality.LiteralEqualityHelper;
import tools.refinery.store.query.literal.Literal;

import java.util.List;
import java.util.Set;

public record DnfClause(Set<Variable> quantifiedVariables, List<Literal> literals) {
	public boolean equalsWithSubstitution(LiteralEqualityHelper helper, DnfClause other) {
		int size = literals.size();
		if (size != other.literals.size()) {
			return false;
		}
		for (int i = 0; i < size; i++) {
			if (!literals.get(i).equalsWithSubstitution(helper, other.literals.get(i))) {
				return false;
			}
		}
		return true;
	}
}