improvements on benchmarkings

This commit is contained in:
Tiago Gomes
2012-04-11 23:48:59 +01:00
parent 03013960d3
commit 564958ef8d
21 changed files with 241 additions and 252 deletions

View File

@@ -41,18 +41,19 @@
user:term_expansion( bayes((Formula ; Phi ; Constraints)), pfl:factor(bayes,Id,FList,FV,Phi,Constraints)) :-
!,
term_variables(Formula, FreeVars),
FV =.. [fv|FreeVars],
FV =.. [''|FreeVars],
new_id(Id),
process_args(Formula, Id, 0, _, FList, []).
user:term_expansion( markov((Formula ; Phi ; Constraints)), pfl:factor(markov,Id,FList,FV,Phi,Constraints)) :-
!,
term_variables(Formula, FreeVars),
FV =.. [fv|FreeVars],
FV =.. [''|FreeVars],
new_id(Id),
process_args(Formula, Id, 0, _, FList, []).
user:term_expansion( Id@N, L ) :-
atom(Id), number(N), !,
findall(G,generate_entity(0, N, Id, G), L).
N1 is N + 1,
findall(G,generate_entity(1, N1, Id, G), L).
user:term_expansion( Goal, [] ) :-
preprocess(Goal, Sk,Var), !,
(ground(Goal) -> true ; throw(error('non ground evidence',Goal))),
@@ -78,7 +79,7 @@ defined_in_factor(Key, Factor) :-
generate_entity(N, N, _, _) :- !.
generate_entity(I0, _N, Id, T) :-
atomic_concat(person_, I0, P),
atomic_concat(p, I0, P),
T =.. [Id, P].
generate_entity(I0, N, Id, T) :-
I is I0+1,