In clingo you can use aggregates, such as #min, #max and #sum. I assume there is no aggregate for products, so how would I implement a product for varying number of atoms? Preferably without introducing aux predicates. Example:
total(1,4).
total(2,8).
total(3,9).
I'm searching for a functionality which outputs 288, since 4*8*9 = 288.
One solution is the following, but it uses auxiliary predicates. Maybe it can be improved...
yielding