-package org.simantics.scl.compiler.elaboration.chr.relations;\r
-\r
-import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;\r
-import org.simantics.scl.compiler.elaboration.chr.CHRRelation;\r
-import org.simantics.scl.compiler.internal.parsing.Symbol;\r
-import org.simantics.scl.compiler.types.TVar;\r
-import org.simantics.scl.compiler.types.Type;\r
-\r
-public class UnresolvedCHRRelation extends Symbol implements CHRRelation {\r
- public String name;\r
-\r
- public UnresolvedCHRRelation(long location, String name) {\r
- this.location = location;\r
- this.name = name;\r
- }\r
-\r
- @Override\r
- public Type[] getParameterTypes() {\r
- throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");\r
- }\r
-\r
- @Override\r
- public TVar[] getTypeVariables() {\r
- throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");\r
- }\r
-}\r
+package org.simantics.scl.compiler.elaboration.chr.relations;
+
+import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
+import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
+import org.simantics.scl.compiler.internal.parsing.Symbol;
+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 class UnresolvedCHRRelation extends Symbol implements CHRRelation {
+ public String name;
+
+ public UnresolvedCHRRelation(long location, String name) {
+ this.location = location;
+ this.name = name;
+ }
+
+ @Override
+ public Type[] getParameterTypes() {
+ throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+ }
+
+ @Override
+ public TVar[] getTypeVariables() {
+ throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+ }
+
+ public TPred[] getTypeConstraints() {
+ throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+ }
+
+ @Override
+ public void collectEnforceEffects(THashSet<Type> effects) {
+ effects.add(Types.PROC);
+ }
+
+ @Override
+ public void collectQueryEffects(THashSet<Type> effects) {
+ effects.add(Types.PROC);
+ }
+}