
## Algorithm 5 Yoyo®(Plan-Hierarchy M, Team-Hierarchy H, Beliefs B)

1: if no new messages are observed then T EA M- P RO PA GAT E- F O RWA RD ( b, M )
2:
3: else 4:
5:
Initialize distributions U t b t +1 ← 0 for all plans U ∈ M . ; Initialize I t E to be empty sets.

for all Messages m i do 6:
I ← I U {X | X E M, m, is a an initiation message, X consistent with m,}
E ← E U {Y | Y E M, m, is a termination message, Y consistent with m,}
7 8:
9:
10 :
11:
12:
13: 14:
15:
16:
17:
18:
19:
20:
21:
222 23 :
24:
25: 26:
27.

| P ← prent (P)   |
|-----------------|

for all plans X E I do T ← teamm sg (X) {T is the agent sending the message initiating X}
for all plans W ∈ M that precede X , where the transition W → X is allowed for T do b'(X, ¬block) ← b'(X, ¬block) + b ε (W, block)
for all plans X E E do T ← team m sg(X ) { T is the agent sending the message terminating X } for all plans Y ∈ M,Y φ I that succeed X, where the transition X → Y is allowed for T
do b'(Y, ¬block) ← b'(X, ¬block) + b t (X, block)µzyπzy Normalize distribution b ′ taking teams into account for all plans X where V ( X, ¬block ) > 0 do b (X, ¬ block) ← b ′ (X, ¬ block)
T EAM-P ROPAGAT E-D OWN (X, U (X, ¬block), b, M )
T ← team(X)
P ← X while parent(P) ≠ null do b t 1 (parent(P), ¬ block) ← b t + 1 (P, ¬ block)
if team(parent(P)) = parentteam (T) then SCALE(parent(P), T, P, b)
T = parenteam (T)