-package org.simantics.scl.compiler.elaboration.chr.relations;\r
-\r
-import org.simantics.scl.compiler.elaboration.chr.CHRRelation;\r
-import org.simantics.scl.compiler.types.TVar;\r
-import org.simantics.scl.compiler.types.Type;\r
-import org.simantics.scl.compiler.types.Types;\r
-\r
-public enum SpecialCHRRelation implements CHRRelation { \r
- EQUALS(A, A),\r
- MEMBER(A, Types.list(A)),\r
- CHECK(Types.BOOLEAN),\r
- EXECUTE(Types.UNIT);\r
- \r
- private final TVar[] typeVariables;\r
- private final Type[] parameterTypes;\r
- \r
- private SpecialCHRRelation(Type ... parameterTypes) {\r
- this.typeVariables = Types.freeVarsArray(parameterTypes);\r
- this.parameterTypes = parameterTypes;\r
- }\r
-\r
- @Override\r
- public TVar[] getTypeVariables() {\r
- return typeVariables;\r
- }\r
- \r
- @Override\r
- public Type[] getParameterTypes() {\r
- return parameterTypes;\r
- }\r
-}\r
+package org.simantics.scl.compiler.elaboration.chr.relations;
+
+import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
+import org.simantics.scl.compiler.types.TPred;
+import org.simantics.scl.compiler.types.TVar;
+import org.simantics.scl.compiler.types.Type;
+import org.simantics.scl.compiler.types.Types;
+
+import gnu.trove.set.hash.THashSet;
+
+public enum SpecialCHRRelation implements CHRRelation {
+ EQUALS(A, A), // only in head
+ ASSIGN(A, A), // only in body
+ MEMBER(A, Types.list(A)), // only in head
+ CHECK(Types.BOOLEAN), // only in head
+ EXECUTE(Types.UNIT); // only in body
+
+ private final TVar[] typeVariables;
+ private final Type[] parameterTypes;
+
+ private SpecialCHRRelation(Type ... parameterTypes) {
+ this.typeVariables = Types.freeVarsArray(parameterTypes);
+ this.parameterTypes = parameterTypes;
+ }
+
+ @Override
+ public TVar[] getTypeVariables() {
+ return typeVariables;
+ }
+
+ @Override
+ public Type[] getParameterTypes() {
+ return parameterTypes;
+ }
+
+ public TPred[] getTypeConstraints() {
+ return TPred.EMPTY_ARRAY;
+ }
+
+ @Override
+ public void collectEnforceEffects(THashSet<Type> effects) {
+ }
+
+ @Override
+ public void collectQueryEffects(THashSet<Type> effects) {
+ }
+}