Menu

#39 aggregates (count/setof) are not quite right with reified items

Wrong answer
open
None
5
2015-02-13
2015-02-13
No

a [ b -> ${d(c)} ].
a [ b -> ${d(?x)} ] :- ?x = c.
@!{SetQuery(?s)} !- ?s = setof{?_x | a [ b -> ?_x ] }.

the setof query returns two identical reified formulas:

?s = [${d(c)@main}, ${d(c)@main}]

This has to do with the hidden arguments in reified formulas. Need to figure out how to gracefully ignore them in sorting or counting.

Discussion

Anonymous
Anonymous

Add attachments
Cancel