ab1cd9bb60
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1094 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
26 lines
398 B
Prolog
26 lines
398 B
Prolog
|
|
:- module(evidence, [add_to_evidence/1,
|
|
execute_pre_evidence/0
|
|
]).
|
|
|
|
% declare some new evidence.
|
|
|
|
add_to_evidence(G2) :-
|
|
recordzifnot('$evidence',G2,_),
|
|
fail.
|
|
add_to_evidence(_).
|
|
|
|
% use it at query evaluation time.
|
|
|
|
execute_pre_evidence :-
|
|
findall(G, recorded('$evidence', G, _), LGs),
|
|
execute_all(LGs).
|
|
|
|
execute_all([]).
|
|
execute_all([M:G|Gs]) :-
|
|
call(M:G),
|
|
execute_all(Gs).
|
|
|
|
|
|
|