Did you know ... Search Documentation:
Predicate aggregate_list/3
 aggregate_list(+Op, +List, -Answer) is semidet[private]
Aggregate the answer from the list produced by findall/3, bagof/3 or setof/3. The latter two cases deal with compound answers.
To be done
- Compile code for incremental state update, which we will use for aggregate_all/3 as well. We should be using goal_expansion to generate these clauses.