blob: a366e26238faeb5ec4e0e069de3ad7d2b4120ac9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package tools.refinery.store.reasoning.translator.typehierarchy;
import tools.refinery.store.reasoning.representation.PartialRelation;
import java.util.Collections;
import java.util.Set;
record InferredType(Set<PartialRelation> mustTypes, Set<PartialRelation> mayConcreteTypes,
PartialRelation currentType) {
public static final InferredType UNTYPED = new InferredType(Set.of(), Set.of(), null);
public InferredType(Set<PartialRelation> mustTypes, Set<PartialRelation> mayConcreteTypes,
PartialRelation currentType) {
this.mustTypes = Collections.unmodifiableSet(mustTypes);
this.mayConcreteTypes = Collections.unmodifiableSet(mayConcreteTypes);
this.currentType = currentType;
}
public boolean isConsistent() {
return currentType != null || mustTypes.isEmpty();
}
public boolean isMust(PartialRelation partialRelation) {
return mustTypes.contains(partialRelation);
}
public boolean isMayConcrete(PartialRelation partialRelation) {
return mayConcreteTypes.contains(partialRelation);
}
}
|