use of com.sri.ai.expresso.api.FunctionApplication in project aic-expresso by aic-sri-international.
the class DefaultFunctionApplication method set.
@Override
public Expression set(int i, Expression newIthArgument) {
FunctionApplication result;
if (get(i) == newIthArgument) {
result = this;
} else {
if (i == -1) {
result = new DefaultFunctionApplication(newIthArgument, arguments);
} else {
ArrayList<Expression> newArguments = new ArrayList<Expression>(arguments);
newArguments.set(i, newIthArgument);
result = new DefaultFunctionApplication(functor, newArguments);
}
}
return result;
}
Aggregations