1 package org.simantics.scl.compiler.elaboration.relations;
3 import org.simantics.scl.compiler.elaboration.chr.plan.PlanContext;
4 import org.simantics.scl.compiler.elaboration.expressions.Expression;
5 import org.simantics.scl.compiler.elaboration.expressions.Variable;
6 import org.simantics.scl.compiler.elaboration.query.compilation.EnforcingContext;
7 import org.simantics.scl.compiler.elaboration.query.compilation.QueryCompilationContext;
8 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
9 import org.simantics.scl.compiler.types.TPred;
10 import org.simantics.scl.compiler.types.TVar;
11 import org.simantics.scl.compiler.types.Type;
13 public interface SCLRelation {
15 public static final int F = 0;
16 public static final int B = 1;
18 public static final int FF = 0;
19 public static final int BF = 1;
20 public static final int FB = 2;
21 public static final int BB = 3;
23 public static final int FFF = 0;
24 public static final int BFF = 1;
25 public static final int FBF = 2;
26 public static final int BBF = 3;
27 public static final int FFB = 4;
28 public static final int BFB = 5;
29 public static final int FBB = 6;
30 public static final int BBB = 7;
32 TVar[] getTypeVariables();
33 Type[] getParameterTypes();
34 default TPred[] getTypeConstraints() {
35 return TPred.EMPTY_ARRAY;
39 double getSelectivity(int boundVariables);
40 int getRequiredVariablesMask();
41 void generate(long location,
42 QueryCompilationContext context,
43 Type[] typeParameters,
44 Variable[] parameters, int boundVariables);
45 Expression generateEnforce(long location, EnforcingContext context,
46 Type[] typeParameters,
47 Variable[] parameters);
48 default String[] getFieldNames() {
58 Expression[] expressions,
59 Expression[] typeConstraintEvidenceParameters);
64 Expression[] parameters,
65 Expression[] typeConstraintEvidenceParameters);