write_depth/3

overflow handlings and garbage collection
Several ipdates to CLPBN
dif/2 could be broken in the presence of attributed variables.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1474 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2005-12-05 17:16:12 +00:00
parent 868f236185
commit 5c2e06ad50
23 changed files with 494 additions and 308 deletions

View File

@@ -16,14 +16,20 @@ project_from_CPT(V,tab(Table,Deps,Szs),tab(NewTable,NDeps,NSzs)) :-
propagate_evidence(V, Evs) :-
clpbn:get_atts(V, [evidence(Ev),dist(Out,_,_)]), !,
generate_szs_with_evidence(Out,Ev,Evs).
generate_szs_with_evidence(Out,Ev,Evs,Found),
(var(Found) ->
clpbn:get_atts(V, [key(K)]),
throw(clpbn(evidence_does_not_match,K,Ev,[Out]))
;
true
).
propagate_evidence(_, _).
generate_szs_with_evidence([],_,[]).
generate_szs_with_evidence([Ev|Out],Ev,[ok|Evs]) :- !,
generate_szs_with_evidence(Out,Ev,Evs).
generate_szs_with_evidence([_|Out],Ev,[not_ok|Evs]) :-
generate_szs_with_evidence(Out,Ev,Evs).
generate_szs_with_evidence([],_,[],_).
generate_szs_with_evidence([Ev|Out],Ev,[ok|Evs],found) :- !,
generate_szs_with_evidence(Out,Ev,Evs,found).
generate_szs_with_evidence([_|Out],Ev,[not_ok|Evs],Found) :-
generate_szs_with_evidence(Out,Ev,Evs,Found).
find_projection_factor([V|Deps], V1, Deps, [Sz|Szs], Szs, F, Sz) :-
V == V1, !,