import org.simantics.scl.compiler.elaboration.chr.relations.ExternalCHRRelation;
import org.simantics.scl.compiler.elaboration.chr.relations.SpecialCHRRelation;
import org.simantics.scl.compiler.elaboration.chr.relations.UnresolvedCHRRelation;
+import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
import org.simantics.scl.compiler.elaboration.contexts.TranslationContext.ExistentialFrame;
public boolean negated;
public boolean passive = true;
- public CHRLiteral(long location, CHRRelation relation, Expression[] parameters, boolean remove, boolean negated) {
+ public CHRLiteral(long location, CHRRelation relation, Expression[] parameters, boolean killAfterMatch, boolean negated) {
this.location = location;
this.relation = relation;
this.parameters = parameters;
- this.killAfterMatch = remove;
+ this.killAfterMatch = killAfterMatch;
this.negated = negated;
}
context.getErrorLog().log(location, "Relation " + relation + " does not define field names.");
return;
}
- parameters = ERecord.translateFieldsToFunctionParameters(context, fields, fieldNames);
+ parameters = ERecord.translateFieldsToFunctionParameters(context, fields, fieldNames, true);
if(parameters == null)
return;
for(int i=0;i<parameters.length;++i) {
visitor.visit(this);
return b.toString();
}
+
+ public CHRLiteral replace(ReplaceContext context) {
+ CHRLiteral copy = new CHRLiteral(location, relation, context.replace(parameters), killAfterMatch, negated);
+ for(int i=0;i<parameters.length;++i)
+ copy.parameters[i] = copy.parameters[i].replace(context);
+ copy.passive = passive;
+ copy.typeConstraintEvidenceParameters = context.replace(typeConstraintEvidenceParameters);
+ copy.typeParameters = context.replace(typeParameters);
+ copy.fields = context.replace(fields);
+ return copy;
+ }
}