1:declare PathEdge, WorkList, SummaryEdge: global edge set
2:Let (N♯,E♯)=G♯
3:PathEdge := {(smain,0)→(smain,0)}
4:WorkList := {(smain,0)→(smain,0)}
5:SummaryEdge := ∅
6:ForwardTabulateSLRPs()
7:for each n∈N∗ do
8:Xn := {d2∈D∣∃d1∈(D∪{0}) such that (sprocOf(n),d1)→(n,d2)∈PathEdge}
9:
10:end for
11:
12:procedure Propagate(e)
13:if e∈/ PathEdge then
14:Insert e into PathEdge.
15:Insert e into WorkList.
16:end if
17:end procedure
18:
19:procedure ForwardTabulateSLRPs()
20:while WorkList =∅ do
21:Select and remove an edge (sp,d1)→(n,d2) from WorkList.
22:if n∈Callp then
23:for each d3 such that (n,d2)→(scalledProc(n),d3)∈E♯ do
24:Propagate((scalledProc(n),d3)→(scalledProc(n),d3))
25:
26:end for
27:for each d3 such that (n,d2)→(returnSite(n),d3)∈(E♯∪SummaryEdge) do
28:Propagate((sp,d1)→(returnSite(n),d3))
29:
30:end for
31:else if n=ep then
32:for each c∈callers(p) do
33:
34:for each d4,d5 such that (c,d4)→(dp,d1)∈E♯ and (ep,d2)→(returnSite(c),d5)∈E♯ do
35:if (c,d4)→(returnSite(c),d5)∈/ SummaryEdge then
36:Insert (c,d4)→(returnSite(c),d5) into SummaryEdge.
37:for each d3 such that (sprocOf(c),d3)→(c,d4)∈ PathEdge do
38:Propagate((sprocOf(c),d3)→(returnSite(c),d5))
39:end for
40:end if
41:end for
42:end for
43:else if n∈(Np−Callp−{ep}) then
44:for each (m,d3) such that (n,d2)→(m,d3)∈E♯ do
45:Propagate((sp,d1)→(m,d3))
46:end for
47:end if
48:end while
49:end procedure