blob: 3ba9a6b836981bc0c95cbb95107a76b73191a867 (
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
|
package tools.refinery.store.query.valuation;
import org.jetbrains.annotations.Nullable;
import tools.refinery.store.query.substitution.Substitution;
import tools.refinery.store.query.term.AnyDataVariable;
import tools.refinery.store.query.term.DataVariable;
import java.util.Set;
public interface Valuation {
<T> T getValue(DataVariable<T> variable);
default Valuation substitute(@Nullable Substitution substitution) {
if (substitution == null) {
return this;
}
return new SubstitutedValuation(this, substitution);
}
default Valuation restrict(Set<? extends AnyDataVariable> allowedVariables) {
return new RestrictedValuation(this, Set.copyOf(allowedVariables));
}
}
|