aggregates in PFL: exa,ple

This commit is contained in:
Vítor Santos Costa 2012-09-23 13:24:49 +01:00
parent 34dc03d43b
commit 309dfaa813
3 changed files with 6 additions and 7 deletions

View File

@ -15,9 +15,7 @@ schema.yap: the PFL schema
tables: CPTs
=============================================================================
professor_ability(p0,X).

View File

@ -29,9 +29,9 @@ bayes grade(C,S)::[a,b,c,d], int(S), diff(C) ; grade_table ; [registration(_,C,S
bayes satisfaction(C,S)::[h,m,l], abi(P), grade(C,S) ; sat_table ; [reg_satisfaction(C,S,P)].
bayes rat(C) :: [h,m,l], agg(Sats) ; avg ; [course_rat(C, Sats)].
bayes rat(C) :: [h,m,l], Sats ; avg ; [course_rat(C, Sats)].
bayes rank(S) :: [a,b,c,d], agg(Grades) ; avg ; [student_ranking(S,Grades)].
bayes rank(S) :: [a,b,c,d], Grades ; avg ; [student_ranking(S,Grades)].
grade(Key, Grade) :-
@ -44,8 +44,8 @@ reg_satisfaction(CKey, SKey, PKey) :-
course_rat(CKey, Sats) :-
course(CKey, _),
setof(satisfaction(CKey,SKey,PKey),
reg_satisfaction(CKey, SKey, PKey),
setof(satisfaction(CKey,SKey),
PKey^reg_satisfaction(CKey, SKey, PKey),
Sats).
student_ranking(SKey, Grades) :-

View File

@ -21,6 +21,7 @@ total_students(256).
%:- clpbn_horus:set_solver(fove).
%:- clpbn_horus:set_solver(hve).
:- clpbn_horus:set_solver(bp).
%:- clpbn_horus:set_solver(ve).
%:- clpbn_horus:set_solver(cbp).
:- ensure_loaded(school32_data).