Aggregation in Prolog -
i try understand, how aggregation in swi-prolog works.
therefore use table works_on attributs employee_id, projectnumber, hours.
in prolog fact of table works_on(1,2,3).
now want find out, how many hours has been worked on each project. therefore imported library aggregate command: use_module(library(aggregate)).
now can use aggregate/3 function, don't understnad how function works... guess first argument of function variables, second query bind these variables , third should variable in result stored.
so guess query aggregate( (x,sum(y)) , (works_on(_,x,y), result ). query throws error , don't understand documentation...
i hope can tell me right query explanation, how aggregate/3 works.
thanks :)
Comments
Post a Comment