- for(int i=0;i<parameters.length;++i)
- parameters[i] = parameters[i].resolve(context);
- }
-
- public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
- for(Expression parameter : parameters)
- parameter.collectRefs(allRefs, refs);
- if(typeConstraintEvidenceParameters != null)
- for(Expression parameter : typeConstraintEvidenceParameters)
- parameter.collectRefs(allRefs, refs);
+ if(parameters == null && fields != null) {
+ String[] fieldNames = relation.getFieldNames();
+ if(fieldNames == null) {
+ context.getErrorLog().log(location, "Relation " + relation + " does not define field names.");
+ return;
+ }
+ parameters = ERecord.translateFieldsToFunctionParameters(context, fields, fieldNames);
+ if(parameters == null)
+ return;
+ for(int i=0;i<parameters.length;++i) {
+ Expression parameter = parameters[i];
+ if(parameter == null) {
+ ExistentialFrame frame = context.getCurrentExistentialFrame();
+ if(frame == null || frame.disallowNewExistentials)
+ context.getErrorLog().log(location, "Field " + fieldNames[i] + " not defined.");
+ else
+ parameters[i] = frame.createBlank(location);
+ }
+ else
+ parameters[i] = parameters[i].resolve(context);
+ }
+ fields = null;
+ }