Implementing Cumulative Functions with Generalized Cumulative Constraints