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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -