1 package org.simantics.scl.compiler.elaboration.chr.relations;
3 import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
4 import org.simantics.scl.compiler.types.TPred;
5 import org.simantics.scl.compiler.types.TVar;
6 import org.simantics.scl.compiler.types.Type;
7 import org.simantics.scl.compiler.types.Types;
9 import gnu.trove.set.hash.THashSet;
11 public enum SpecialCHRRelation implements CHRRelation {
12 EQUALS(A, A), // only in head
13 ASSIGN(A, A), // only in body
14 MEMBER(A, Types.list(A)), // only in head
15 CHECK(Types.BOOLEAN), // only in head
16 EXECUTE(Types.UNIT); // only in body
18 private final TVar[] typeVariables;
19 private final Type[] parameterTypes;
21 private SpecialCHRRelation(Type ... parameterTypes) {
22 this.typeVariables = Types.freeVarsArray(parameterTypes);
23 this.parameterTypes = parameterTypes;
27 public TVar[] getTypeVariables() {
32 public Type[] getParameterTypes() {
33 return parameterTypes;
36 public TPred[] getTypeConstraints() {
37 return TPred.EMPTY_ARRAY;
41 public void collectEnforceEffects(THashSet<Type> effects) {
45 public void collectQueryEffects(THashSet<Type> effects) {