Implement Greatest function as Variable-arity function

For #2072