public ExpressionFunction withArgument(String argument, TensorType type) {
        List<String> arguments = new ArrayList<>(this.arguments);
        if ( ! arguments.contains(argument))
            arguments.add(argument);

        Map<String, TensorType> argumentTypes = new HashMap<>(this.argumentTypes);
        argumentTypes.put(argument, type);

        return new ExpressionFunction(name, arguments, body, argumentTypes, returnType);
    }
Returns a copy of this with the given argument (if not present) and argument type added
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/ExpressionFunction.java