From 309dfaa8133e6c8cfe97312dcfbadce26f24ba03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 23 Sep 2012 13:24:49 +0100 Subject: [PATCH] aggregates in PFL: exa,ple --- packages/CLPBN/examples/School/README | 4 +--- packages/CLPBN/examples/School/parschema.yap | 8 ++++---- packages/CLPBN/examples/School/school_32.yap | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/CLPBN/examples/School/README b/packages/CLPBN/examples/School/README index 6e2dd7540..7b2a725e5 100644 --- a/packages/CLPBN/examples/School/README +++ b/packages/CLPBN/examples/School/README @@ -15,9 +15,7 @@ schema.yap: the PFL schema tables: CPTs - - - +============================================================================= professor_ability(p0,X). diff --git a/packages/CLPBN/examples/School/parschema.yap b/packages/CLPBN/examples/School/parschema.yap index 49cc742f5..70be09835 100644 --- a/packages/CLPBN/examples/School/parschema.yap +++ b/packages/CLPBN/examples/School/parschema.yap @@ -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) :- diff --git a/packages/CLPBN/examples/School/school_32.yap b/packages/CLPBN/examples/School/school_32.yap index 56980939e..9f5cbfc9a 100644 --- a/packages/CLPBN/examples/School/school_32.yap +++ b/packages/CLPBN/examples/School/school_32.yap @@ -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).