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 public enum SpecialCHRRelation implements CHRRelation {
10 EQUALS(A, A), // only in head
11 ASSIGN(A, A), // only in body
12 MEMBER(A, Types.list(A)), // only in head
13 CHECK(Types.BOOLEAN), // only in head
14 EXECUTE(Types.UNIT); // only in body
16 private final TVar[] typeVariables;
17 private final Type[] parameterTypes;
19 private SpecialCHRRelation(Type ... parameterTypes) {
20 this.typeVariables = Types.freeVarsArray(parameterTypes);
21 this.parameterTypes = parameterTypes;
25 public TVar[] getTypeVariables() {
30 public Type[] getParameterTypes() {
31 return parameterTypes;
34 public TPred[] getTypeConstraints() {
35 return TPred.EMPTY_ARRAY;