Implementation of cumulativeHistUsages() and cumulativeHistDependencies()