CS updat ate operat ation on ∘ ∘∶ Γ × 𝐹 ∗ → Γ updates call strings along edges 𝑛𝑏𝑗𝑜 𝑞 𝑞 = 〈𝑑 1 〉 𝜇 ∘ 𝑑 1 , 𝑠 𝑞 𝑑 1 𝑠 call 𝑞 1 𝑞 , 𝑑 2 = 〈𝑑 1 〉 𝑑 1 ∘ 𝑠 1. Interproc. 𝑞 = 〈𝑑 1 , 𝑑 2 〉 𝑑 1 ∘ 𝑑 2 , 𝑠 2. Call 𝑑 2 call 𝑞 1 3. Return 𝑜 2 𝑑 1 𝑑 2 ∘ 𝑓 𝑞 , 𝑜 2 = 𝑑 1 𝑑 1 ∘ 𝑜 2 ,𝑓 𝑞 = 〈𝑑 1 〉 𝑜 1 𝑓 𝑞 return 𝑑 1 ∘ 𝑓 𝑞 , 𝑜 1 = 𝜇 12.06.2010 Nikolai Knopp 29
CS updat ate operat ation on ∘ ∘∶ Γ × 𝐹 ∗ → Γ updates call strings along edges 𝑛𝑏𝑗𝑜 𝑞 𝑞 = 〈𝑑 1 〉 𝜇 ∘ 𝑑 1 , 𝑠 𝑞 𝑑 1 𝑠 call 𝑞 1 𝑞 , 𝑑 2 = 〈𝑑 1 〉 𝑑 1 ∘ 𝑠 1. Interproc. 𝑞 = 〈𝑑 1 , 𝑑 2 〉 𝑑 1 ∘ 𝑑 2 , 𝑠 2. Call 𝑑 2 call 𝑞 1 3. Return 𝑜 2 4. invalid 𝑑 1 𝑑 2 ∘ 𝑓 𝑞 , 𝑜 2 = 𝑑 1 𝑑 1 ∘ 𝑓 𝑞 , 𝑜 2 undef. 𝑑 1 ∘ 𝑜 2 ,𝑓 𝑞 = 〈𝑑 1 〉 𝑜 1 𝑓 𝑞 return 𝑑 1 ∘ 𝑓 𝑞 , 𝑜 1 = 𝜇 𝑑 1 𝑑 2 ∘ 𝑓 𝑞 , 𝑜 1 undef. 12.06.2010 Nikolai Knopp 30
CS updat ate operat ation on ∘ ∘∶ Γ × 𝐹 ∗ → Γ updates call strings along edges 𝑛𝑏𝑗𝑜 𝑞 𝑞 = 〈𝑑 1 〉 𝜇 ∘ 𝑑 1 , 𝑠 𝑞 𝑑 1 𝑠 call 𝑞 1 𝑞 undef. 𝑑 1 ∘ 𝑑 1 , 𝑠 𝑞 , 𝑑 2 = 〈𝑑 1 〉 𝑑 1 ∘ 𝑠 1. Interproc. 𝑞 = 〈𝑑 1 , 𝑑 2 〉 𝑑 1 ∘ 𝑑 2 , 𝑠 2. Call 𝑑 2 call 𝑞 1 3. Return 𝑜 2 4. invalid 𝑑 1 𝑑 2 ∘ 𝑓 𝑞 , 𝑜 2 = 𝑑 1 𝑑 1 ∘ 𝑓 𝑞 , 𝑜 2 undef. 𝑑 1 ∘ 𝑜 2 ,𝑓 𝑞 = 〈𝑑 1 〉 𝑜 1 𝑓 𝑞 return 𝑑 1 ∘ 𝑓 𝑞 , 𝑜 1 = 𝜇 𝑑 1 𝑑 2 ∘ 𝑓 𝑞 , 𝑜 1 undef. 12.06.2010 Nikolai Knopp 31
∘ consi sist stent with 𝐽𝑊𝑄 𝛿 ′ ∘ 𝑛, 𝑜 = 𝛿 only defined iff: 1. (By definition) A path 𝑟 ′ ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑛 exists with 𝐷𝑁 𝑟 ′ = 𝛿 ′ 2. (Lemma) 𝑟 = 𝑟 ′ ||(𝑛,𝑜) lies in 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 and 𝐷𝑁 𝑟 = 𝛿 ⇒ “ ∘ only updates and yields call strings for interprocedurally valid paths” 12.06.2010 Nikolai Knopp 32
Edge effect cts s doma main 𝐺 ∗ 𝐺 ∗ ≔ 𝑀 ∗ → 𝑀 ∗ embeds edge effects from 𝐺 into 𝑀 ∗ domain For 𝑛, 𝑜 ∈ 𝐹 ∗ and data 𝜊 = . . , 𝛿 ′ , 𝑤 ′ , . . ∈ 𝑀 ∗ at 𝑛 , data at 𝑜 is 𝑔 𝑛,𝑜 ∗ 𝜊 = . . , 𝛿, 𝑤 ,. . update each 𝛿 ′ to reflect 𝑛, 𝑜 taken: 𝛿 = 𝛿 ′ ∘ 𝑛,𝑜 propagate effect 𝑔 𝑛,𝑜 ∈ 𝑀 applied to each 𝑤 ′ : 𝑤 = 𝑔 𝑛,𝑜 𝑤 ′
Edge effect cts s 𝑔 𝑛,𝑜 ∗ Defini nition: n: Let 𝑛, 𝑜 ∈ 𝐹 ∗ , 𝑔 𝑛,𝑜 ∈ 𝐺, 𝜊 ∈ 𝑀 ∗ . 𝑑 1 , 1 , 𝜊 a := a - 1 𝑑 1 𝑑 2 ,⊤ 𝑛 𝑔 𝑛,𝑑 2 call p 𝑑 2 12.06.2010 Nikolai Knopp 34
Edge effect cts s 𝑔 𝑛,𝑜 ∗ Defini nition: n: Let 𝑛, 𝑜 ∈ 𝐹 ∗ , 𝑔 𝑛,𝑜 ∈ 𝐺, 𝜊 ∈ 𝑀 ∗ . 𝑑 1 , 1 , 𝜊 a := a - 1 𝑑 1 𝑑 2 ,⊤ 𝑛 𝑔 𝑛,𝑑 2 𝑑 1 , ⊤ , 𝜊 ∗ 𝑔 𝑛,𝑑 2 call p 𝑑 1 𝑑 2 ,⊤ 𝑑 2 12.06.2010 Nikolai Knopp 35
Edge effect cts s 𝑔 𝑛,𝑜 ∗ Defini nition: n: Let 𝑛, 𝑜 ∈ 𝐹 ∗ , 𝑔 𝑛,𝑜 ∈ 𝐺, 𝜊 ∈ 𝑀 ∗ . 𝜊 𝑑 1 𝑑 1 , 1 , 𝜊 a := a - 1 𝑑 1 𝑑 2 ,⊤ 𝑛 𝑔 𝑛,𝑑 2 ∗ 𝑑 1 , ⊤ , 𝑔 𝑛,𝑑 2 𝜊 𝑑 1 𝜊 ∗ 𝑔 𝑛,𝑑 2 call p 𝑑 1 𝑑 2 ,⊤ 𝑑 2 if ∃𝛿 ′ with ∀ 𝛿 ∈ Γ 𝛿 = 𝛿 ′ ∘ 𝑛, 𝑜 𝜊 𝛿′ 𝑔 𝑛,𝑜 𝜊 𝛿 ∗ 𝑔 𝑛,𝑜 ≔ ⊥ else 12.06.2010 Nikolai Knopp 36
Edge effect cts s doma main 𝐺 ∗ Define 𝐺 ∗ ⊆ 𝑀 ∗ → 𝑀 ∗ such that 𝐺 ∗ smallest set containing 1. | 𝑛, 𝑜 ∈ 𝐹 ∗ ∪ 𝑗𝑒 𝑀 ∗ ∗ 𝑔 𝑛,𝑜 𝐺 ∗ closed under functional composition and ⋀ 2.
Lemm mma: a: Prop operties s of 𝐺 ∗ monotone monotone distributive in 𝑀 ⇒ 𝐺 ∗ distributive in 𝑀 ∗ 𝐺 1. 𝐺 distributive in 𝑀 ⇒ 𝐺 ∗ continuo nuous us in 𝑀 ∗ : 2. For an infinite collection 𝜊 𝑙 𝑙≥1 ⊆ 𝑀 ∗ and 𝑛, 𝑜 ∈ 𝐹 ∗ : ∗ ∗ 𝑔 𝑛,𝑜 𝜊 𝑙 = 𝑔 𝑛,𝑜 𝜊 𝑙 𝑙 𝑙 12.06.2010 Nikolai Knopp 38
Dataf aflow equat ations ons 𝑦 𝑜 ∗ The dataflow problem for 𝐺 ∗ ,𝑀 ∗ : ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 = 𝜇, ⊤ ∗ = ⋀ 𝑜 ∈ 𝑂 ∗ − 𝑠 𝑛𝑏𝑗𝑜 ∗ ∗ 𝑦 𝑜 𝑔 𝑛,𝑜 𝑦 𝑛 𝑛,𝑜 ∈𝐹 ∗ Claim: ∃ maximum fixed-point solution ( MFP MFP CS CS ) for 𝑜∈𝑂 ∗ ∗ 𝑦 𝑜 12.06.2010 Nikolai Knopp 40
Proo oof: Exist stence ce of max. FP solution on Iteratively solving the equations yields decreasing ( 𝐺 ∗ monotone) chains ∗ 𝑗 ≥ 𝑦 𝑜 ∗ 𝑗+1 ∀𝑜 ∈ 𝑂 ∗ . 𝑦 𝑜 Then ∀𝛿 ∈ Γ ∗ 𝑗 𝛿 ≥ 𝑦 𝑜 ∗ 𝑗+1 𝛿 𝑦 𝑜 ∗ 𝛿 (exists as a decreasing chain in 𝑀 with limit lim𝑦 𝑜 𝑀 bounded). ∗ 𝑗 possibly infinite but well-defined ∗ ≔ lim 𝑦 𝑜 𝑗→∞ 𝑦 𝑜 𝑜∈𝑂 ∗ is maximal FP solution to DF problem. ∗ ⇒ 𝑦 𝑜 12.06.2010 Nikolai Knopp 41
Maximum mum FP solution on of (𝑀 ∗ , 𝐺 ∗ ) Initialise 𝑦 𝑜 𝑜∈𝑂 ∗ with ∗ ∗ 0 𝑦 𝑠 𝑛𝑏𝑗𝑜 = 𝜇, ⊤ ∗ 0 = ⊥ ∗ 𝑜 ∈ 𝑂 ∗ − 𝑠 𝑛𝑏𝑗𝑜 𝑦 𝑜 Result if Γ finite te: Any iterative algorithm terminates and reaches MFP. infini nite te: Iteration may diverge, intermediate steps unsafe approx. of MFP 12.06.2010 Nikolai Knopp 42
Exam ample main p 𝑞 if a=0 T 𝑠 read a, b F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 call p 𝑑 2 call p 12.06.2010 Nikolai Knopp 43
Exam ample main p 𝑞 if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 call p 𝑑 2 call p 12.06.2010 Nikolai Knopp 44
Exam ample main p 𝑞 if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 call p 12.06.2010 Nikolai Knopp 45
Exam ample main p 𝑞 〈𝑑 1 〉,1 if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 call p 12.06.2010 Nikolai Knopp 46
Exam ample main p 𝑞 〈𝑑 1 〉,1 if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 〈𝑑 1 〉,1 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 call p 12.06.2010 Nikolai Knopp 47
Exam ample main p 𝑞 〈𝑑 1 〉,1 if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 〈𝑑 1 〉,1 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 𝑑 1 ,⊤ call p 12.06.2010 Nikolai Knopp 48
Exam ample main p 〈𝑑 1 〉, 1 , 𝑞 𝑑 1 𝑑 2 , ⊤ if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 ∗ 𝑜 2 〈𝑑 1 〉,1 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 𝑑 1 ,⊤ call p 12.06.2010 Nikolai Knopp 49
Exam ample main p 〈𝑑 1 〉, 1 , 𝑞 𝑑 1 𝑑 2 , ⊤ if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 𝑑 2 𝑑 1 ,⊤ call p 12.06.2010 Nikolai Knopp 50
Exam ample main p 〈𝑑 1 〉, 1 , 𝑞 𝑑 1 𝑑 2 , ⊤ if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p 12.06.2010 Nikolai Knopp 51
Exam ample main p 〈𝑑 1 〉,1 , 𝑞 𝑑 1 𝑑 2 ,⊤ , if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑑 1 𝑑 2 𝑑 2 , ⊤ 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p 12.06.2010 Nikolai Knopp 52
Exam ample main p 〈𝑑 1 〉,1 , 𝑞 𝑑 1 𝑑 2 ,⊤ , if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑑 1 𝑑 2 𝑑 2 , ⊤ 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p ... 12.06.2010 Nikolai Knopp 53
Chap apter summ mmar ary Call string ng approach: ch: New dataflow problem on top of (𝑀, 𝐺) Data “tagged” with propagation history Interprocedural flow explicit Existence of MFP CS No functional compositions Only iteratively computable if Γ finite 12.06.2010 Nikolai Knopp 54
Struct cture 1. Definition of a new DF problem (𝑀 ∗ , 𝐺 ∗ ) n to 𝑴 ∗ , 𝑮 ∗ ≡ MOP solution 2. Proof: Solut ution 2. 3. Feasibility and precise variants 4. Approximative solution 12.06.2010 Nikolai Knopp 55
MOP P solution on and MFP CS CS This chapter: Show that MOP solution 𝑧 𝑜 = 𝑔 𝑟 : 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 ,𝑜 ⊤ can be acquired from MFP CS . Chapter outline: 1. Define MOP CS 2. Show MOP CS = MFP CS ′ ∈ 𝑀 from MFP CS 3. Extract results 𝑦 𝑜 ′ = MOP 4. Using MOP CS and MFP CS , show 𝑦 𝑜 12.06.2010 Nikolai Knopp 56
MOP P solution on for call strings s (MOP CS CS ) Propagation of data along paths in 𝐻 ∗ For 𝑟 = 𝑠 𝑛𝑏𝑗𝑜 , 𝑡 1 , … ,𝑡 𝑙 ,𝑜 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ : ∗ ≔ 𝑔 𝑡 𝑙 ,𝑜 ∗ ∗ ∗ ∗ 𝑔 ∘ 𝑔 𝑡 𝑙−1 ,𝑡 𝑙 ∘ ⋯∘ 𝑔 𝑡 1 ,𝑡 2 ∘ 𝑔 𝑟 (𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 ) Call string MOP solution ( MOP CS CS ) ∗ ≔ ⋀ 𝑔 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∀𝑜 ∈ 𝑂 ∗ : 𝑧 𝑜 ∗ ∶ 𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 𝑟 𝑛𝑏𝑗𝑜 𝑛𝑏𝑗𝑜 𝑠 ∗ ∗ … 𝑔 𝑔 𝑟 1 𝑟 2 𝑜 12.06.2010 Nikolai Knopp 57
MOP P solution on for call strings s (MOP CS CS ) Propagation of data along paths in 𝐻 ∗ For 𝑟 = 𝑠 𝑛𝑏𝑗𝑜 , 𝑡 1 , … ,𝑡 𝑙 ,𝑜 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ : ∗ ≔ 𝑔 𝑡 𝑙 ,𝑜 ∗ ∗ ∗ ∗ 𝑔 ∘ 𝑔 𝑡 𝑙−1 ,𝑡 𝑙 ∘ ⋯∘ 𝑔 𝑡 1 ,𝑡 2 ∘ 𝑔 𝑟 (𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 ) Call string MOP solution ( MOP CS CS ) ∗ ≔ ⋀ 𝑔 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∀𝑜 ∈ 𝑂 ∗ : 𝑧 𝑜 ∗ ∶ 𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 𝑟 𝑞𝑏𝑢ℎ 𝐻 ∗ ⊇ 𝐽𝑊𝑄 𝑛𝑏𝑗𝑜 𝑛𝑏𝑗𝑜 𝑠 ∗ ∗ … ? 𝑔 𝑔 𝑟 1 𝑟 2 𝑜 12.06.2010 Nikolai Knopp 58
Valid – pat ath-only prop opag agat ation on Lemma: : Let 𝑜 ∈ 𝑂 ∗ ,𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ 𝑠 𝑛𝑏𝑗𝑜 ,𝑜 , 𝛿 ∈ Γ . Then 𝑛𝑏𝑗𝑜 , 𝑜 and 𝐷𝑁 𝑟 = γ 𝑟 ∈ 𝐽𝑊𝑄 𝑠 1. ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝛿 defined ∗ ⇔ 𝑔 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗ 𝑔 𝛿 = 𝑔 𝑟 ⊤ 2. 𝑟 ⇒ “MOP CS only contains paths in 𝐽𝑊𝑄 and for each such 𝑞 yields the same result as 𝑀, 𝐺 ” 12.06.2010 Nikolai Knopp 59
Valid – pat ath-only prop opag agat ation on (Proo oof) By induc uction on 𝑚 𝑟 for 𝑟 = (𝑠 𝑛𝑏𝑗𝑜 , 𝑡 1 ,… ,𝑡 𝑙 , 𝑜) : 𝒎 𝒓 = 𝟏 : Let 𝑜 ∈ 𝑂 ∗ . 𝑛𝑏𝑗𝑜 ⇒ 𝐷𝑁 𝑟 = 𝜇 . 𝑟 = 𝑠 𝑛𝑏𝑗𝑜 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 ,𝑠 ∗ 𝑠 only def. for 𝜇 with ⊤ = 𝑔 𝑟 ⊤ . 𝑔 𝑛𝑏𝑗𝑜 = 𝜇, ⊤ 𝑟 IH: Iff 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 < 𝑙 and 𝛿 = 𝐷𝑁 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 then 𝑔 𝑞 ⊤ . ∗ 𝜇 = 𝑔 𝑟 12.06.2010 Nikolai Knopp 60
Valid – pat ath-only prop opag agat ation on (Proo oof) IH: Iff 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 < 𝑙 and 𝛿 = 𝐷𝑁 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 then 𝑔 𝑞 ⊤ ∗ 𝜇 = 𝑔 𝑟 IS: 𝑚 𝑟 = 𝑙 . 𝑛𝑏𝑗𝑜 𝑠 ... 𝑡 𝑙−1 𝑟 𝑡 𝑙 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝛿 ∗ ∗ 𝑜 ≝ 𝑔 𝑡 𝑙 ,𝑜 𝑦 𝑡 𝑙 𝑔 𝑟 12.06.2010 Nikolai Knopp 61
Valid – pat ath-only prop opag agat ation on (Proo oof) IH: Iff 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 < 𝑙 and 𝛿 = 𝐷𝑁 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 then 𝑔 𝑞 ⊤ ∗ 𝜇 = 𝑔 𝑟 IS: 𝑚 𝑟 = 𝑙 . 𝑛𝑏𝑗𝑜 𝑠 ... 𝛿 ′ = 𝐷𝑁 𝑟 ′ 𝛿 = 𝛿 ′ ∘ 𝑛, 𝑜 , 𝑟 ′ 𝑡 𝑙−1 𝑟 𝛿 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝑡 𝑙 ∗ 𝑔 𝑟 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝛿 ∗ ∗ 𝑜 ≝ 𝑔 𝑡 𝑙 ,𝑜 𝑦 𝑡 𝑙 𝑔 𝑟 12.06.2010 Nikolai Knopp 62
Valid – pat ath-only prop opag agat ation on (Proo oof) IH: Iff 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 < 𝑙 and 𝛿 = 𝐷𝑁 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 then 𝑔 𝑞 ⊤ ∗ 𝜇 = 𝑔 𝑟 IS: 𝑚 𝑟 = 𝑙 . 𝑛𝑏𝑗𝑜 𝑠 ... 𝛿 ′ = 𝐷𝑁 𝑟 ′ 𝛿 = 𝛿 ′ ∘ 𝑛, 𝑜 , 𝑟 ′ 𝑡 𝑙−1 𝑟 𝛿 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 = 𝑱𝑰 𝑔 𝑟 ′ ⊤ 𝑡 𝑙 ∗ 𝑔 𝑟 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝛿 ∗ ∗ 𝑜 ≝ 𝑔 𝑡 𝑙 ,𝑜 𝑦 𝑡 𝑙 𝑔 𝑟 12.06.2010 Nikolai Knopp 63
Valid – pat ath-only prop opag agat ation on (Proo oof) IH: Iff 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 < 𝑙 and 𝛿 = 𝐷𝑁 𝑟 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 then 𝑔 𝑞 ⊤ ∗ 𝜇 = 𝑔 𝑟 IS: 𝑚 𝑟 = 𝑙 . 𝑛𝑏𝑗𝑜 𝑠 ... 𝛿 ′ = 𝐷𝑁 𝑟 ′ 𝛿 = 𝛿 ′ ∘ 𝑛, 𝑜 , 𝑟 ′ 𝑡 𝑙−1 𝑟 𝛿 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 = 𝑱𝑰 𝑔 𝑟 ′ ⊤ 𝑡 𝑙 ∗ 𝑔 𝑟 ′ ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 𝑟 ⊤ 𝛿 ∗ 𝑜 = 𝑔 𝑡 𝑙 ,𝑜 𝑔 𝑟 ′ ⊤ ≝ 𝑔 𝑔 ∎ 𝑟 12.06.2010 Nikolai Knopp 64
∗ = 𝑧 𝑜 MFP CS = MOP CS CS : : 𝑦 𝑜 ∗ ∗ = 𝑧 𝑜 Theorem: (𝑀, 𝐺) distributive ⇒ ∀𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 ∗ Proof: ∗ : Let 𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ = 𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 , … , 𝑡 𝑙 , 𝑜 . ∗ ≤ 𝒛 𝒐 𝒚 𝒐 𝑛𝑏𝑗𝑜 𝑠 : 𝑟 ∗ ≤ 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 ∗ 𝑢 𝑡 1 ∗ 𝑦 𝑡 1 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗ ≤ 𝑔 𝑡 1 ,𝑡 2 ∗ ∗ 𝑡 2 𝑦 𝑡 2 𝑦 𝑡 1 ... ∗ ∗ ≤ 𝑔 𝑡 𝑙 ,𝑜 ∗ 𝑜 𝑦 𝑜 𝑦 𝑡 𝑙 12.06.2010 Nikolai Knopp 65
∗ = 𝑧 𝑜 MFP CS = MOP CS CS : : 𝑦 𝑜 ∗ ∗ = 𝑧 𝑜 Theorem: (𝑀, 𝐺) distributive ⇒ ∀𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 ∗ Proof: ∗ : Let 𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ = 𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 , … , 𝑡 𝑙 , 𝑜 . ∗ ≤ 𝒛 𝒐 𝒚 𝒐 𝑛𝑏𝑗𝑜 𝑠 : 𝑟 ∗ ≤ 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑡 1 ∗ 𝑢 𝑡 1 ∗ 𝑦 𝑡 1 𝑦 𝑠 𝑛𝑏𝑗𝑜 By monotonicity ∗ ≤ 𝑔 𝑡 1 ,𝑡 2 ∗ ∗ 𝑡 2 𝑦 𝑡 2 𝑦 𝑡 1 ∗ ≤ 𝑔 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗ ⇒ 𝑦 𝑜 ... 𝑟 ∗ 𝑁𝑃𝑄 𝐷𝑇 = ⋀ 𝑔 ∗ 𝑟 𝑟 ∗ ≤ 𝑔 𝑡 𝑙 ,𝑜 ∗ 𝑜 𝑦 𝑜 𝑦 𝑡 𝑙 ∗ ≤ ⋀ 𝑔 ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗ ⇒ 𝑦 𝑜 𝑟 𝑟 12.06.2010 Nikolai Knopp 66
∗ = 𝑧 𝑜 MFP CS = MOP CS CS : : 𝑦 𝑜 ∗ ∗ ≥ 𝒛 𝒐 ∗ : 𝒚 𝒐 ∗ 𝑗 ≥ 𝑧 𝑜 By induction on 𝑗: ∀𝑗 ≥ 0, 𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 ∗ 𝒋 = 𝟏 : ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗(0) ∗ ∗ 𝑜 = 𝑠 𝑛𝑏𝑗𝑜 ∶ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ≝ 𝜇, ⊤ = 𝑔 ≥ 𝑧 𝑠 𝑛𝑏𝑗𝑜 𝑟 0 ∗ 0 ≝ ⊥ ∗ ≥ 𝑧 𝑜 ∗ 𝑜 ≠ 𝑠 𝑛𝑏𝑗𝑜 ∶ 𝑦 𝑜 IH: ∗ 𝑗 ≥ 𝑧 ∗ ∀𝑗 ≤ 𝑙, 𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 𝑜 IS: Cont.+Dist. of 𝑔 𝑛,𝑜 ∗ IH ∗ 𝑙+1 ≝ ∗ ∗ 𝑙 ∗ ∗ ∗ 𝑦 𝑜 𝑔 𝑛,𝑜 𝑦 𝑛 𝑔 𝑛,𝑜 𝑧 𝑛 ≥ 𝑧 𝑜 ≥ 𝑛,𝑜 ∈𝐹 ∗ 𝑛,𝑜 ∈𝐹 ∗ ∎ 12.06.2010 Nikolai Knopp 67
Resu sult for 𝑀, 𝐺 from om MFP CS CS ′ ∈ 𝑀 as follows: Define 𝑦 𝑜 ′ ≔ 𝑦 𝑜 ∗ 𝛿 𝑦 𝑜 𝛿∈Γ ′ = 𝑦 𝑜 ∗ 𝜇 ∧ 𝑦 𝑜 ∗ 𝑦 𝑜 𝑑 1 ∧ 𝑑 1 ,1 , ∗ 𝑦 𝑜 𝑑 1 𝑑 2 ∧ ⋯ 𝑑 1 𝑑 2 , ⊤ , ∗ 𝑜 = 𝑦 𝑜 a := a - 1 = ⊥ ∧ 1 ∧ ⊤ ∧ ⋯ 𝑑 1 𝑑 2 𝑑 2 ,⊤ , = 1 ∧ ⊤ ∧ ⋯ = ⊤ … ′ is the MOP solution in (𝑀, 𝐺) Claim: 𝑦 𝑜 12.06.2010 Nikolai Knopp 68
MFP CS CS ≡ MOP ′ = 𝑧 𝑜 Theorem: For each 𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 Proof: ′ ′ Def 𝑦 𝑜 ∗ (𝛿) 𝑦 𝑜 = 𝑦 𝑜 𝛿∈Γ MFP CS = ∗ 𝑦 𝑠 𝑛𝑏𝑗𝑜 ∗ = 𝑔 𝛿 |𝑟 ∈ 𝑞𝑏𝑢ℎ 𝐻 ∗ (𝑠 𝑛𝑏𝑗𝑜 ,𝑜) MOP CS 𝑟 𝛿∈Γ Only-valid-path = 𝑔 𝑟 ⊤ |𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 sth. 𝐷𝑁 𝑟 = 𝛿 propag. Lemma 𝛿∈Γ 𝐷𝑁 −1 Γ ∩ 𝐽𝑊𝑄 = 𝑔 𝑟 ⊤ |𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 = 𝐽𝑊𝑄 = 𝑧 𝑜 ∎ 12.06.2010 Nikolai Knopp 69
Chap apter summ mmar ary Shown: Get MOP solution from MFP CS ′ straightforward and without ∗ → 𝑦 𝑜 Conversion 𝑦 𝑜 functional composition ⇒ Call string approach is actually useful But: Computing MFP CS still problematic 12.06.2010 Nikolai Knopp 70
Struct cture 1. Definition of a new DF problem (𝑀 ∗ , 𝐺 ∗ ) 2. Proof: Solution to 𝑀 ∗ ,𝐺 ∗ ≡ MOP solution 3. Feasibility and preci cise variant nts 3. 4. Approximative solution 12.06.2010 Nikolai Knopp 71
Motivat ation Observation: 𝑀 finite ⇒ functional approach converges, CS approach not necessarily Idea: Ensure termination of CS approach by limiting to finite CS subset Γ 0 ⊆ Γ Show: Can be done for all (𝑀, 𝐺) with finite 𝑀 without losing precision 12.06.2010 Nikolai Knopp 72
Redefinitions ons using Γ 𝑝 Γ 0 is finite subset of Γ fulfilling: If 𝛿 ∈ Γ 0 and 𝛿 ′ initial subtuple of 𝛿 ⇒ 𝛿 ′ ∈ Γ 0 𝐽𝑊𝑄 ′ ≔ 𝑟 ∈ 𝐽𝑊𝑄 | ∀ prefix 𝑟 ′ of 𝑟: 𝐷𝑁 𝑟 ′ ∈ Γ 0 Let ∘ 0 only act in Γ 0 discards 𝛿 ′ entirely iff 𝛿 ′ ∘ 0 𝑛,𝑜 ∉ Γ 0 ∘ 0 is consistent with 𝐽𝑊𝑄 ′ 12.06.2010 Nikolai Knopp 73
Definitions: ons: DF anal alysis s with Γ 0 ∗ with 𝑀 0 ∗ ,𝐺 0 ∗ ≔ Γ 0 → 𝑀 finite Now consider 𝑀 0 Dataflow equations now iteratively solvable ∗ 𝛿 ( MFP CS0 ) ′ 𝑦 𝑜 0 ≔ 𝑦 𝑜 𝛿∈Γ 0 MOP solution using only paths in 𝐽𝑊𝑄 ′ 𝑟 0 | 𝑟 ∈ 𝐽𝑊𝑄 ′ 𝑠 ( MOP CS0 ) ′ 𝑧 𝑜 0 ≔ 𝑔 𝑛𝑏𝑗𝑜 , 𝑜 12.06.2010 Nikolai Knopp 74
MOP CS0 = MFP CS0 Theorem: ∀𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 ′ ′ 0 = 𝑧 𝑜 0 Proof: Completely analogous to MOP CS =MFP CS proof by replacing Γ, 𝐽𝑊𝑄,∘ by Γ 0 , 𝐽𝑊𝑄 ′ ,∘ 0 No reasoning about infinite meets or continuity of 𝐺 0 ∗ required ∎ 12.06.2010 Nikolai Knopp 75
Motivat ation: CS of limi mited length main p 〈𝑑 1 〉, 1 , 𝑞 𝑑 1 𝑑 2 , ⊤ if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p 12.06.2010 Nikolai Knopp 76
Motivat ation: CS of limi mited length main p 〈𝑑 1 〉,1 , 𝑞 𝑑 1 𝑑 2 ,⊤ , if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑑 1 𝑑 2 𝑑 2 , ⊤ 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p 12.06.2010 Nikolai Knopp 77
Motivat ation: CS of limi mited length main p 〈𝑑 1 〉,1 , 𝑞 𝑑 1 𝑑 2 ,⊤ , if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑑 1 𝑑 2 𝑑 2 , ⊤ 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉,1 , ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 𝑑 1 𝑑 2 ,⊤ , 𝑑 1 𝑑 2 𝑑 2 , ⊤ ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p 12.06.2010 Nikolai Knopp 78
Motivat ation: CS of limi mited length main p 〈𝑑 1 〉,1 , 𝑞 𝑑 1 𝑑 2 ,⊤ , if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑑 1 𝑑 2 𝑑 2 , ⊤ 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉,1 , ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 𝑑 1 𝑑 2 ,⊤ , 𝑑 1 𝑑 2 𝑑 2 , ⊤ ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉,1 , 𝑑 2 𝑑 1 𝑑 2 ,⊤ , call p 𝑑 1 𝑑 2 𝑑 2 , ⊤ 12.06.2010 Nikolai Knopp 79
Motivat ation: CS of limi mited length 〈𝑑 1 〉, 1 , main p 𝑑 1 𝑑 2 ,⊤ , 𝑞 if a=0 T 𝑠 read a, b 𝜇, ⊤ 𝑑 1 𝑑 2 𝑑 2 , ⊤ , F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑑 1 𝑑 2 𝑑 2 𝑑 2 ,⊤ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉,1 , ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 𝑑 1 𝑑 2 ,⊤ , 𝑑 1 𝑑 2 𝑑 2 , ⊤ ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉,1 , 𝑑 2 𝑑 1 𝑑 2 ,⊤ , call p 𝑑 1 𝑑 2 𝑑 2 , ⊤ 12.06.2010 Nikolai Knopp 80
Motivat ation: CS of limi mited length 〈𝑑 1 〉, 1 , main p 𝑑 1 𝑑 2 ,⊤ , 𝑞 if a=0 T 𝑠 read a, b 𝜇, ⊤ 𝑑 1 𝑑 2 𝑑 2 , ⊤ , F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑑 1 𝑑 2 𝑑 2 𝑑 2 ,⊤ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉,1 , ∗ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 𝑑 1 𝑑 2 ,⊤ , 𝑑 1 𝑑 2 𝑑 2 , ⊤ ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉,1 , 𝑑 2 𝑑 1 𝑑 2 ,⊤ , call p 𝑑 1 𝑑 2 𝑑 2 , ⊤ No information gain on further iteration Stop if data tagged by longer CS „irrelevant“ 12.06.2010 Nikolai Knopp 81
Motivat ation: CS of limi mited length main p 〈𝑑 1 〉, 1 , 𝑞 𝑑 1 𝑑 2 , ⊤ if a=0 T 𝑠 read a, b 𝜇, ⊤ F t := a * b 𝑛𝑏𝑗𝑜 𝑠 ∗ 𝑔 𝑠 𝑞 ,𝑜 2 〈𝑑 1 〉, 1 , ∗ 𝑑 1 𝑑 2 , ⊤ 𝑜 2 𝑔 𝑠 𝑛𝑏𝑗𝑜 ,𝑑 1 a := a - 1 ∗ ∗ ∗ 𝑔 𝑑 1 ,𝑠 𝑞 𝑔 𝑑 2 ,𝑠 𝑞 𝑔 𝑜 2 ,𝑑 2 𝑑 1 𝜇, 1 call p 〈𝑑 1 〉, 1 , 𝑑 2 𝑑 1 𝑑 2 , ⊤ call p No information gain on further iteration Stop if data tagged by longer CS „irrelevant“ 12.06.2010 Nikolai Knopp 82
Redundan ant inform ormat ation on in anal alysis Why paths of arbitrary length? 𝐿 ≔ number of call sites in program ∈ ℕ ⇒ only possible by recurring on call site(s) At each call, analysis arrives with value 𝑦 ∈ 𝑀 and returns with value 𝑧 ∈ 𝑀 . 𝑀 is finite ⇒ 𝑀 2 many distinct begin/end value combinations per call Idea: Recurring on any of the 𝐿 calls more than 𝑀 2 times is redundant. 12.06.2010 Nikolai Knopp 83
Lemm mma: a: Path short ortening Let 𝑛𝑏𝑗𝑜 𝑞 1 (𝑀, 𝐺) with 𝑀 finite 𝑁 ≔ 𝐿 ∗ 𝑀 2 𝑞 2 𝑑 1 call 𝑞 1 𝑠 𝐿 ≔ # call blocks in 𝐻 ∗ Γ 0 = Γ 𝑁 . 𝑑 2 call 𝑞 1 Then ∀ 𝑜 ∈ 𝑂 ∗ : 𝑜 2 If 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 then exists 𝑟 ′ ∈ 𝐽𝑊𝑄 ′ (𝑠 𝑛𝑏𝑗𝑜 , 𝑜) with 𝑜 1 𝑓 𝑞 2 𝑟 0 = 𝑔 𝑟 ′ 0 . 𝑔 return 12.06.2010 Nikolai Knopp 84
Lemm mma: a: Path short ortening Let 𝑛𝑏𝑗𝑜 𝑞 1 (𝑀, 𝐺) with 𝑀 finite 𝑁 ≔ 𝐿 ∗ 𝑀 2 𝑞 2 𝑑 1 call 𝑞 1 𝑠 𝐿 ≔ # call blocks in 𝐻 ∗ Γ 0 = Γ 𝑁 . 𝑑 2 call 𝑞 1 𝑟 Then ∀ 𝑜 ∈ 𝑂 ∗ : 𝑜 2 If 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 then exists 𝑟 ′ ∈ 𝐽𝑊𝑄 ′ (𝑠 𝑛𝑏𝑗𝑜 , 𝑜) with 𝑜 1 𝑓 𝑞 2 𝑟 0 = 𝑔 𝑟 ′ 0 . 𝑔 return 12.06.2010 Nikolai Knopp 85
Lemm mma: a: Path short ortening Let 𝑛𝑏𝑗𝑜 𝑞 1 (𝑀, 𝐺) with 𝑀 finite 𝑁 ≔ 𝐿 ∗ 𝑀 2 𝑞 2 𝑑 1 call 𝑞 1 𝑠 𝐿 ≔ # call blocks in 𝐻 ∗ Γ 0 = Γ 𝑁 . 𝑑 2 call 𝑞 1 𝑟 ′ Then ∀ 𝑜 ∈ 𝑂 ∗ : 𝑜 2 If 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 then exists 𝑟 ′ ∈ 𝐽𝑊𝑄 ′ (𝑠 𝑛𝑏𝑗𝑜 , 𝑜) with 𝑜 1 𝑓 𝑞 2 𝑟 0 = 𝑔 𝑟 ′ 0 . 𝑔 return 12.06.2010 Nikolai Knopp 86
Lemm mma: a: Path short ortening (proo oof) Proof: By induction on 𝑚(𝑟) ≔ length of 𝑟 . 𝒎 𝒓 = 𝟏 : 𝜇 ∈ Γ and 𝜇 ∈ Γ 0 . IH: Lemma holds for all paths with 𝑚 𝑟 < 𝑙, 𝑙 ∈ ℕ + . IS: Let 𝑜 ∈ 𝑂 ∗ , 𝑟 ∈ 𝐽𝑊𝑄 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 , 𝑚 𝑟 = 𝑙. Assume 𝑟 ∉ 𝐽𝑊𝑄 ′ 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 . Let 𝑟 ′ the shortest prefix with 𝑟 ′ ∉ 𝐽𝑊𝑄 ′ 𝑠 𝑛𝑏𝑗𝑜 , 𝑜 . Then 𝑟′ contains 𝑁 + 1 unreturned calls. By decomposition Lemma: 𝑟 ′ = 𝑟 0 || 𝑑 1 , 𝑠 𝑞 𝑁+1 ||𝑟 𝑁+1 𝑞1 ||𝑟 1 || 𝑑 2 , 𝑠 𝑞2 || … || 𝑑 𝑁+1 , 𝑠 12.06.2010 Nikolai Knopp 87
Lemm mma: a: Path short ortening (proo oof) 𝑟 ′ = 𝑟 0 || 𝑑 1 , 𝑠 𝑞 𝑁+1 ||𝑟 𝑁+1 𝑞1 ||𝑟 1 || 𝑑 2 , 𝑠 𝑞2 || … || 𝑑 𝑁+1 , 𝑠 𝑁 + 1 calls, but max. 𝑁 distinct elements. Let 𝑑 , 𝑠 𝑞 a duplicate call. If 𝑑 returns, let 𝑓 𝑞 , 𝑜 the return edge. Rewrite 𝑟 as ′ || 𝑓 𝑞 ′ || 𝑑 , 𝑠 𝑞 ′ || 𝑑 , 𝑠 𝑞 ′ || 𝑓 𝑞 ′ 𝑟 0 || 𝑟 1 || 𝑟 2 , 𝑜 || 𝑟 3 ,𝑜 || 𝑟 4 Shorter 𝑟 𝑛𝑏𝑗𝑜 , 𝑜 with 𝑔 𝑟 by dropping ∈ 𝐽𝑊𝑄 𝑠 = 𝑔 𝑟 redundant parts IH, ∃𝑟 ′ ∈ 𝐽𝑊𝑄 ′ 𝑠 By IH 𝑛𝑏𝑗𝑜 ,𝑜 for 𝑟 with 𝑔 𝑟 ′ = 𝑔 and thus 𝑟 𝑟 . 𝑔 𝑟 ′ = 𝑔 ∎ 12.06.2010 Nikolai Knopp 88
Lemm mma: a: Path short ortening (proo oof) 𝑟 ′ = 𝑟 0 || 𝑑 1 , 𝑠 𝑞 𝑁+1 ||𝑟 𝑁+1 𝑞1 ||𝑟 1 || 𝑑 2 , 𝑠 𝑞2 || … || 𝑑 𝑁+1 , 𝑠 𝑁 + 1 calls, but max. 𝑁 distinct elements. Let 𝑑 , 𝑠 𝑞 a duplicate call. If 𝑑 returns, let 𝑓 𝑞 , 𝑜 the return edge. Rewrite 𝑟 as ′ || 𝑓 𝑞 ′ || 𝑑 , 𝑠 𝑞 ′ || 𝑑 , 𝑠 𝑞 ′ || 𝑓 𝑞 ′ 𝑟 0 || 𝑟 1 || 𝑟 2 , 𝑜 || 𝑟 3 ,𝑜 || 𝑟 4 Shorter 𝑟 𝑛𝑏𝑗𝑜 , 𝑜 with 𝑔 𝑟 by dropping ∈ 𝐽𝑊𝑄 𝑠 = 𝑔 𝑟 redundant parts IH, ∃𝑟 ′ ∈ 𝐽𝑊𝑄 ′ 𝑠 By IH 𝑛𝑏𝑗𝑜 ,𝑜 for 𝑟 with 𝑔 𝑟 ′ = 𝑔 and thus 𝑟 𝑟 . 𝑔 𝑟 ′ = 𝑔 ∎ 12.06.2010 Nikolai Knopp 89
MOP CS0 =MOP For 𝑁 ∈ ℕ ≥ 0 , define Γ 𝑁 as set of all 𝛿 ∈ Γ with length ≤ 𝑁 . Theorem: Let 𝑀, 𝐺 a distributive DF framework with 𝑀 finite, and Γ 0 = Γ 𝑁 with 𝑁 = 𝐿 ∗ 𝑀 2 . Then 0 = 𝑧 𝑜 ∀𝑜 ∈ 𝑂 ∗ : 𝑦 𝑜 ′ ⇒ “If 𝛿 is too long and gets discarded, a shorter one in the set represents the same data.” 12.06.2010 Nikolai Knopp 90
Better bounds s for 𝑁 𝑁 impractically large for most problems Lower bounds exists for certain problem classes. Example: Decomposable frameworks 12.06.2010 Nikolai Knopp 91
Decom omposab sable fram amework orks main p read a,b 𝑞 if … T 𝑠 t := a * b F 𝑛𝑏𝑗𝑜 𝑠 u := 2 * b a := a - 1 𝑑 1 call p 𝑑 2 call p t := a * b a*b,2*b 𝑜 2 avail.? b := b + 1 u := 2 * b t := a * b print t,u 𝑓 𝑛𝑏𝑗𝑜 𝑓 𝑞 stop return , 𝑢 , 𝑣 , 𝑢, 𝑣 , ⊥ 𝑁 = 50 𝑀 = 12.06.2010 Nikolai Knopp 92
Decom omposab sable fram amework orks main p read a,b 𝑞 if … T 𝑠 t := a * b F 𝑛𝑏𝑗𝑜 𝑗𝑒 𝑠 u := 2 * b +𝑢 + 𝑣 a := a - 1 𝑑 1 −𝑢 call p 𝑑 2 𝑗𝑒 call p t := a * b a*b,2*b 𝑜 2 avail.? b := b + 1 u := 2 * b t := a * b print t,u +𝑢 − 𝑣 𝑓 𝑛𝑏𝑗𝑜 𝑓 𝑞 stop return , 𝑢 , 𝑣 , 𝑢, 𝑣 , ⊥ 𝑁 = 50 𝑀 = 12.06.2010 Nikolai Knopp 93
Decom omposab sable fram amework orks main p read a,b 𝑞 𝑣 if … T 𝑠 t := a * b F 𝑛𝑏𝑗𝑜 𝑗𝑒 𝑠 u := 2 * b +𝑢 + 𝑣 𝑣 a := a - 1 𝑑 1 𝑢, 𝑣 −𝑢 call p 𝑑 2 𝑣 𝑗𝑒 call p t := a * b a*b,2*b 𝑜 2 𝑢 avail.? b := b + 1 u := 2 * b t := a * b print t,u +𝑢 − 𝑣 𝑓 𝑛𝑏𝑗𝑜 𝑓 𝑞 stop return , 𝑢 , 𝑣 , 𝑢, 𝑣 , ⊥ 𝑁 = 50 𝑀 = 12.06.2010 Nikolai Knopp 94
Decom omposab sable fram amework orks main p read a,b 𝑞 𝑣 if … T 𝑠 t := a * b F 𝑛𝑏𝑗𝑜 id 𝑗𝑒 𝑠 u := 2 * b 𝑣 +𝑢 +𝑣 a := a - 1 𝑑 1 𝑢 𝑣 −𝑢 𝑗𝑒 call p 𝑑 2 𝑣 𝑗𝑒 𝑗𝑒 call p t := a * b a*b,2*b 𝑜 2 𝑢 avail.? b := b + 1 u := 2 * b t := a * b print t,u +𝑢 −𝑣 𝑓 𝑛𝑏𝑗𝑜 𝑓 𝑞 stop return , 𝑢 ,⊥ , 𝑀 𝑣 = , 𝑣 , ⊥ , ⇒ 𝑀 = 𝑀 𝑢 × 𝑀 𝑣 𝑁 = 18 𝑀 𝑢 = 12.06.2010 Nikolai Knopp 95
Bound for decom compos osab able framew mework orks Theorem: Let 𝑀, 𝐺 decomposable into 𝑙 frameworks 𝑀 𝑗 ,𝐺 𝑗 𝑗=1 . 𝑙 Setting the maximum callstring length to 2 𝑁 = 𝐿 ∗ max 𝑀 𝑗 𝑗∈ 1..𝑙 yields 𝑧 𝑜 0 = 𝑧 𝑜 ∀𝑜 ∈ 𝑂 ∗ . ′ 12.06.2010 Nikolai Knopp 96
1-relat ated fram amework orks Defini nition: n: A decomposable DF framework (L,F) is 1-related if each 𝐺 𝑗 only consists of constant and identity functions. Theorem: In this case, using Γ 0 = Γ 3𝐿 yields 0 = 𝑧 𝑜 ∀𝑜 ∈ 𝑂 ∗ . ′ 𝑧 𝑜 Example: Available expressions is 1-related. Decomp. into subproblems 𝑀 𝑓 ,𝐺 𝑓 for each expression 𝑓 with 𝑀 𝑓 = ⊤, 1,⊥ , 𝐺 ⊥ 𝑓 = 𝑗𝑒, 𝑔 ⊤ , 𝑔 1 , 𝑔 12.06.2010 Nikolai Knopp 97
Chap apter summ mmar ary If 𝑀 finite, MFP CS iteratively computable on Γ 0 Precision/safeness depending on choice for Γ 0 Enforce termination by limiting max. CS length Precision preserving bounds exist, but only of theoretical value Better bounds exist for special problem classes 12.06.2010 Nikolai Knopp 98
Struct cture 1. Definition of a new DF problem (𝑀 ∗ , 𝐺 ∗ ) 2. Proof: Solution to 𝑀 ∗ ,𝐺 ∗ ≡ MOP solution 3. Feasibility and precise variants 4. Approximative solut utions ns 4. 12.06.2010 Nikolai Knopp 99
Motivat ation Prefer a safe approximative solution 𝑦 𝑜 ≤ 𝑧 𝑜 over MFP CS if MFP CS not (iteratively) computable computation not feasible MFP CS by time/space constraints and computation of 𝑦 𝑜 ≤ 𝑧 𝑜 feasible. ⇒ Accept precision loss for less complexity. 12.06.2010 Nikolai Knopp 100
Reduci cing comp mplexity of CS approa oach ch 𝜏 Γ Γ 12.06.2010 Nikolai Knopp 101
Recommend
More recommend