Two wo Approa proach ches s to to In Inte terproc procedura dural l Data ta Flow w Analysi lysis
Micha a Sharir ir Amir Pnuel ueli
12.06.2010 Klaas Boesche
Two wo Approa proach ches s to to In Inte terproc procedura - - PowerPoint PPT Presentation
Two wo Approa proach ches s to to In Inte terproc procedura dural l Data ta Flow w Analysi lysis Micha a Sharir ir Amir Pnuel ueli Part one: The Functional Approach 12.06.2010 Klaas Boesche Int ntra raproc proced edura
12.06.2010 Klaas Boesche
12.06.2010 Klaas Boesche 2
T F
12.06.2010 Klaas Boesche 3
main
call p … if a=0 call p t := a * b return
p
a := a - 1 T F …
main
call x x := … …
12.06.2010 Klaas Boesche 4
𝑞
12.06.2010 Klaas Boesche 5
T F
12.06.2010 Klaas Boesche 6
1.
2.
⊥ 𝑦 = ⊥
12.06.2010 Klaas Boesche 7
12.06.2010 Klaas Boesche 8
⊤, 𝑔 1, 𝑗𝑒𝑀, 𝑔 ⊥
⊤ 𝑦 = ⊤, 𝑔 1 𝑦 = 1
12.06.2010 Klaas Boesche 9
T F
𝑞
1
1
⊤
⊤
⊤
1
12.06.2010 Klaas Boesche 10
𝑛,𝑜 ∈𝐹
𝑞( ⊤)|𝑞 ∈ 𝑞𝑏𝑢𝑖𝐻 𝑠, 𝑜 + 𝑜 ∈ 𝑂
𝑞=(𝑜1,…,𝑜𝑙) = 𝑔 (𝑜𝑙−1,𝑜𝑙) ∘ ⋯ ∘ 𝑔 (𝑜1,𝑜2)
12.06.2010 Klaas Boesche 11
12.06.2010 Klaas Boesche 12
1.
𝑞
𝑞
2.
𝑞
12.06.2010 Klaas Boesche 13
1
𝑞
0 ∪ 𝐹𝑞 1
𝑞 𝐹𝑞 Intraprocedural edges 𝐹𝑞
1
12.06.2010 Klaas Boesche 14
T F
𝑞
1
1
12.06.2010 Klaas Boesche 15
T F
𝑞
12.06.2010 Klaas Boesche 16
𝑠
𝑟
𝑓𝑟
𝑞
call q return 𝑛 𝑛′
12.06.2010 Klaas Boesche 17
𝑞𝑘
𝑞2
𝑞2, 𝑜)
𝑞𝑘, 𝑜)
12.06.2010 Klaas Boesche 18
𝑟′ ∥ 𝑞1 ∥ 𝑓𝑟′, 𝑛′ and 𝑞1 𝑗𝑡 𝑑𝑝𝑛𝑞𝑚𝑓𝑢𝑓
12.06.2010 Klaas Boesche 19 𝑠
𝑟′
𝑓𝑟′
call q ' return 𝑛 𝑛′
12.06.2010 Klaas Boesche 20
12.06.2010 Klaas Boesche 21
T F
𝑞
12.06.2010 Klaas Boesche 22
T F
𝑞
12.06.2010 Klaas Boesche 23 𝑠
𝑟
𝑓𝑟
𝑞
call q return 𝑛
𝑚
12.06.2010 Klaas Boesche 24
𝑛,𝑜 ∈ 𝐹𝑞
1, 𝑛 𝑑𝑏𝑚𝑚𝑡 𝑟
⊥ 𝑜 ∈ 𝑂𝑞 − *𝑠 𝑞+
𝑞+
12.06.2010 Klaas Boesche 25
1 ∘ 𝜚𝑠𝑛,𝑠𝑛
1 ∘ 𝜚𝑠𝑛,𝑜𝑛
T F
𝑛
𝑞
1
1
⊤
1
12.06.2010 Klaas Boesche 26
⊤ ∘ 𝜚𝑠𝑞,𝑜𝑞
T F
𝑛
𝑞
1
1
⊤
1
1 ∘ 𝜚𝑠𝑞,𝑛𝑞
12.06.2010 Klaas Boesche 27
𝜚𝑠𝑛,𝑠𝑛
𝜚𝑠𝑛,𝑑𝑛
⊥
1
1
1
𝜚𝑠𝑛,𝑜𝑛
⊥
⊥
1
1
𝜚𝑠𝑛,𝑓𝑛
⊥
1
1
1
𝜚𝑠𝑞,𝑠𝑞
𝜚𝑠𝑞,𝑜𝑞
⊥
𝜚𝑠𝑞,𝑑𝑞
⊥
⊤
⊤
⊤
𝜚𝑠𝑞,𝑛𝑞
⊥
⊥
⊤
⊤
𝜚𝑠𝑞,𝑓𝑞
⊥
1 ∘ 𝜚𝑠𝑛,𝑠𝑛
1 ∘ 𝜚𝑠𝑞,𝑛𝑞
⊤ ∘ 𝜚𝑠𝑞,𝑜𝑞
1 ∘ 𝜚𝑠𝑛,𝑜𝑛
12.06.2010 Klaas Boesche 28
12.06.2010 Klaas Boesche 29
𝑛
T F
𝑞
𝜚𝑠𝑛,𝑠𝑛 = 𝑗𝑒𝑀 𝜚𝑠𝑛,𝑑𝑛 = 𝑔
1
𝜚𝑠𝑛,𝑜𝑛 = 𝑔
1
𝜚𝑠𝑛,𝑓𝑛 = 𝑔
1
𝜚𝑠𝑞,𝑠𝑞 = 𝑗𝑒𝑀 𝜚𝑠𝑞,𝑜𝑞 = 𝑗𝑒𝑀 𝜚𝑠𝑞,𝑑𝑞 = 𝑔
⊤
𝜚𝑠𝑞,𝑛𝑞 = 𝑔
⊤
𝜚𝑠𝑞,𝑓𝑞 = 𝑗𝑒𝑀
1 𝑦𝑠𝑛 ∧ 𝑔 ⊤(𝑦𝑠𝑞)
12.06.2010 Klaas Boesche 30
12.06.2010 Klaas Boesche 31
𝑟1
𝑟2 …
12.06.2010 Klaas Boesche 32
𝑞
call q return
𝑟| 𝑟 ∈ 𝐽𝑊𝑄0 𝑠 𝑞, 𝑜
𝑞 then 𝜚𝑠𝑞,𝑜
𝜁 ≥ 𝑔 𝑟| 𝑟 ∈ 𝐽𝑊𝑄 0 𝑠 𝑞, 𝑠 𝑞
𝑞 then 𝜚𝑠𝑞,𝑜
⊥ ≥ 𝑔 ∈ 𝐺
12.06.2010 Klaas Boesche 33
𝑟 = 𝜚𝑠𝑞,𝑠𝑞 = 𝑗𝑒𝑀
12.06.2010 Klaas Boesche 34
12.06.2010 Klaas Boesche 35
12.06.2010 Klaas Boesche 36
0 ∪ 𝐹𝑑 1
1
12.06.2010 Klaas Boesche 37
1
𝑞
𝑡
1
1
12.06.2010 Klaas Boesche 38
1
𝑞
𝑡
1
𝑛,𝑜 ∈𝐹
12.06.2010 Klaas Boesche 39
𝑛,𝑠𝑞 ∈𝐹𝑑
1
𝑛,𝑠𝑞 ∈𝐹𝑑
1
𝑛,𝑑 ∈𝐹𝑑
1
12.06.2010 Klaas Boesche 40
1
𝑞
𝑡
1
𝑟| 𝑟 ∈ 𝐽𝑊𝑄 𝑠𝑛𝑏𝑗𝑜, 𝑜
𝑞( ⊤)|𝑞 ∈ 𝑞𝑏𝑢𝑖𝐻 𝑠, 𝑜 +
12.06.2010 Klaas Boesche 41
12.06.2010 Klaas Boesche 42
12.06.2010 Klaas Boesche 43
12.06.2010 Klaas Boesche 44
12.06.2010 Klaas Boesche 45
𝑛,𝑜 ∈ 𝐹𝑞
12.06.2010 Klaas Boesche 46
12.06.2010 Klaas Boesche 47
12.06.2010 Klaas Boesche 48 𝑠
𝑞
𝑓𝑞
𝑟
call p return
𝑞
12.06.2010 Klaas Boesche 49
𝑟
return 𝑠
𝑞
𝑑𝑞 𝑛𝑞
12.06.2010 Klaas Boesche 50
0:
𝑟
𝑛1
𝑛𝑙 …
12.06.2010 Klaas Boesche 51
𝑛, ⊤ = ⊤
𝑛
1
1
T F
𝑞
1
⊤
1 ⊤ , 𝑑𝑛
𝑛, ⊤
𝑞
𝑞, 1 𝑄𝐼𝐽 𝑠
𝑞, 1 = 1
12.06.2010 Klaas Boesche 52
𝑠
𝑟
𝑓𝑟
𝑞
call q return 𝑛 𝑛′
𝑞𝑘
call𝑞2
𝑞𝑘, 𝑜)
12.06.2010 Klaas Boesche 53 𝑠
𝑟
𝑓𝑟
𝑞
call q return 𝑛
𝑚
12.06.2010 Klaas Boesche 54
12.06.2010 Klaas Boesche 55