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

26 lines
398 B
Plaintext
Raw Normal View History

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