Algorithm 4: Elim -Cons PE |
|
input: A belief network ℬ = {P1, …, Pn} where Pi's are assume to have a sparse representation; A constraint expression over k variables, ℛ = {RQ1, …, RQt} an ordering d = {X1, …, Xn} |
|
output: The belief P(ℛ). |
1 |
Place buckets with observed variables last in d (to be processed first) |
// Initialize
|
|
Partition ℬ and ℛ into bucket1, …, bucketn, where bucketi contains all CPTs and constraints whose highest variable is Xi
|
|
Let S1, …, Sj be the scopes of the CPTs, and Q1, …Qt be the scopes of the constraints. |
|
We denote probabilistic functions as λ s and constraints by Rs |
2 |
for p ← n down to 1 do
|
// Backward
|
|
Let λ1, …, λj be the functions and R1, …, Rr be the constraints in bucketp
|
|
Process-bucket-RELp(Σ, (λ1, …, λj),(R1, …, Rr)) |
3 |
return P(ℛ) as the result of processing bucket1. |