Go backward to Examples Go up to Top Go forward to Predicate Constants |
public final class Application implements Term { private String name; private Term[] arguments; public Value eval() throws EvalException { Function function = Model.getFunction(name, arguments.length); if (function == null) throw new EvalException("unknown function"); Value[] values = new Value[arguments.length]; for (int i=0; i< values.length; i++) values[i] = arguments[i].eval(); return function.apply(values); } }