This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/CLPBN/clpbn/evidence.yap
vsc ab1cd9bb60 introduce CLPBN in system
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1094 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-07-15 16:23:44 +00:00

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).