]> gerrit.simantics Code Review - simantics/platform.git/blob
c5dbe3c4190b54cf7aff3c08101168a6b50626b5
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.chr.relations;
2
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;
8
9 public enum SpecialCHRRelation implements CHRRelation {    
10     EQUALS(A, A),
11     MEMBER(A, Types.list(A)),
12     CHECK(Types.BOOLEAN),
13     EXECUTE(Types.UNIT);
14     
15     private final TVar[] typeVariables;
16     private final Type[] parameterTypes;
17     
18     private SpecialCHRRelation(Type ... parameterTypes) {
19         this.typeVariables = Types.freeVarsArray(parameterTypes);
20         this.parameterTypes = parameterTypes;
21     }
22
23     @Override
24     public TVar[] getTypeVariables() {
25         return typeVariables;
26     }
27     
28     @Override
29     public Type[] getParameterTypes() {
30         return parameterTypes;
31     }
32     
33     public TPred[] getTypeConstraints() {
34         return TPred.EMPTY_ARRAY;
35     }
36 }