Two Approaches to Inte terprocedural l Data ta Flow w Analys lysis is
Micha Sharir ir Amir Pnueli li
12.06.2010 Nikolai Knopp
Part Two: The Call String g Approach ch
1
Two Approaches to Inte terprocedural l Data ta Flow w Analys - - PowerPoint PPT Presentation
Two Approaches to Inte terprocedural l Data ta Flow w Analys lysis is Micha Sharir ir Amir Pnueli li Part Two: The Call String g Approach ch 12.06.2010 Nikolai Knopp 1 Recap cap Functional approach main p if a=0 T
Micha Sharir ir Amir Pnueli li
12.06.2010 Nikolai Knopp
Part Two: The Call String g Approach ch
1
โ(๐1,๐2) ๐
๐๐๐๐
๐1 ๐
(๐ ๐๐๐๐,๐1)
๐
(๐2,๐๐๐๐๐)
12.06.2010 Nikolai Knopp 2
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Functional approach
๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t if a=0 return
โ(๐1,๐2) ๐
๐๐๐๐
๐1 ๐
(๐ ๐๐๐๐,๐1)
๐
(๐2,๐๐๐๐๐)
12.06.2010 Nikolai Knopp 3
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Functional approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t if a=0 return
โ(๐1,๐2) ๐
๐๐๐๐
๐1 ๐
(๐ ๐๐๐๐,๐1)
๐
(๐2,๐๐๐๐๐)
12.06.2010 Nikolai Knopp 4
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Functional approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
if a=0 return
โ(๐1,๐2) ๐
๐๐๐๐
๐1 ๐
(๐ ๐๐๐๐,๐1)
๐
(๐2,๐๐๐๐๐)
12.06.2010 Nikolai Knopp 5
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Functional approach
a*b avail.? ๐2
๐
๐
๐๐
read a, b t := a * b t := a * b print t
if a=0 return
๏ก Avoid expensive functional compositions ๏ก Possibility to trade off precision vs.
performance to reduce complexity
12.06.2010 Nikolai Knopp 6
1.
nition n of a new DF problem (๐ดโ,๐ฎโ)
12.06.2010 Nikolai Knopp 7
Two representations:
1.
๐ป = ๐๐
๐
, ๐น๐
๐
2.
๐ปโ = ๐๐
๐
, ๐นโ
12.06.2010 Klaas Boesche 8
p
โฆ โฆ call p
s
๐น๐ก ๐น๐ก ๐น๐ก
1
return โฆ
๐
๐
๐๐ ๐น1 ๐น1 ๐น๐ ๐น๐
๐น๐ = ๐น๐
0 โช ๐น๐ 1
๐นโ = ๐น0 โช ๐น1 ๐น0 = ๐น๐
๐
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 9
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 10
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 11
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( ,โค)
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 12
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( ,1)
๐2
if a=0
( ๐1 ,1)
return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 13
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 14
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( ๐1 ,1)
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 15
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( ๐1 ,โค)
๐2
if a=0
( ๐1๐2 , โค)
return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 16
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
( ๐1๐2 , โค)
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 17
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 18
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( ๐1 ,โค)
๐2
if a=0 return
( ๐1 ,1)
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 19
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
๐2
if a=0 return
๐
๐๐๐๐
๐1
12.06.2010 Nikolai Knopp 20
call p t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐
Call String (CS) approach
a*b avail.? ๐2 ๐
๐
๐๐
read a, b t := a * b t := a * b print t
( , 1)
๐2
๏ก Let ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐,๐
decomposed as:
๏ก
๐1๐2 โฆ ๐๐ =: ๐ฟ โ ฮ call string (CS) to ๐ in ๐ปโ.
๐ โ ฮ is empty call string (๐ = 0 in ๐๐๐๐).
๏ก ฮ = space of valid call strings in ๐ปโ ๏ก ๐ท๐: ๐ฝ๐๐ โ ฮ with ๐ท๐ ๐ = ๐ฟ
12.06.2010 Nikolai Knopp 21
๐๐๐๐
๐
call call
๐1 ๐๐
โฆ
๐1 ๐๐ ๐๐+1
๐๐ ๐๐+1
๏ก
๐โ,๐บโ โ โExtendedโ version of (L,F)
ural flow graph ๐ปโ
string and value
12.06.2010 Nikolai Knopp
๏ก ๐โ โ ฮ โ ๐ semi-lattice
๐1 โง ๐2 ๐ฟ = ๐1 ๐ฟ โง ๐2 ๐ฟ
๏ก โ๐ โ ๐โ maps call strings ๐ฟ
to values in ๐ propagated via all paths ๐ โ ๐ท๐โ1 ๐ฟ โ
12.06.2010 Nikolai Knopp 23
if a=0 call p a := a - 1
T F
๐
๐
๐2
๐
๏ก ๐โ โ ฮ โ ๐ semi-lattice
๐1 โง ๐2 ๐ฟ = ๐1 ๐ฟ โง ๐2 ๐ฟ
๏ก โ๐ โ ๐โ maps call strings ๐ฟ
to values in ๐ propagated via all paths ๐ โ ๐ท๐โ1 ๐ฟ โ
12.06.2010 Nikolai Knopp 24
๐ = ๐1 , 1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค ๐ ๐1 = 1 ๐ ๐2 = โฅ
if a=0 call p a := a - 1
T F
๐
๐
๐2
๐
๏ก ๐บโ โ ๐โ โ ๐โ embeds edge effects from ๐บ
into ๐โ domain
๏ก For ๐, ๐ โ ๐นโ and data ๐ = . . , ๐ฟโฒ, ๐คโฒ , . .
โ ๐โ at ๐, data at ๐ is ๐ ๐,๐
โ
๐ = . . , ๐ฟ, ๐ค ,. .
๐ฟ = ๐ฟโฒ โ ๐,๐
๐ค = ๐ ๐,๐ ๐คโฒ
12.06.2010 Nikolai Knopp 26
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1
call ๐1 return
๐1 ๐๐ ๐2
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
12.06.2010 Nikolai Knopp 27
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1 โ ๐
๐, ๐2 = โฉ๐1โช
๐1
call ๐1 return
๐1 ๐๐ ๐2 ๐1 โ ๐2,๐๐ = โฉ๐1โช
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
12.06.2010 Nikolai Knopp 28
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1 โ ๐2, ๐
๐ = โฉ๐1, ๐2โช
๐1 โ ๐
๐, ๐2 = โฉ๐1โช
๐1
call ๐1
๐ โ ๐1, ๐
๐ = โฉ๐1โช
return
๐1 ๐๐ ๐2 ๐1 โ ๐2,๐๐ = โฉ๐1โช
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
12.06.2010 Nikolai Knopp 29
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1 โ ๐2, ๐
๐ = โฉ๐1, ๐2โช
๐1 โ ๐
๐, ๐2 = โฉ๐1โช
๐1
call ๐1
๐ โ ๐1, ๐
๐ = โฉ๐1โช
return
๐1 ๐๐ ๐1 โ ๐๐, ๐1 = ๐ ๐1๐2 โ ๐๐, ๐2 = ๐1 ๐2 ๐1 โ ๐2,๐๐ = โฉ๐1โช
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
12.06.2010 Nikolai Knopp 30
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1 โ ๐2, ๐
๐ = โฉ๐1, ๐2โช
๐1 โ ๐
๐, ๐2 = โฉ๐1โช
๐1
call ๐1
๐ โ ๐1, ๐
๐ = โฉ๐1โช
return
๐1 ๐๐ ๐1 โ ๐๐, ๐1 = ๐ ๐1๐2 โ ๐๐, ๐2 = ๐1 ๐2 ๐1 โ ๐2,๐๐ = โฉ๐1โช
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
๐1 โ ๐๐, ๐2 undef. ๐1๐2 โ ๐๐, ๐1 undef.
12.06.2010 Nikolai Knopp 31
๐ ๐๐๐๐
๐2
call ๐1
๐
๐
๐1 โ ๐2, ๐
๐ = โฉ๐1, ๐2โช
๐1 โ ๐
๐, ๐2 = โฉ๐1โช
๐1
call ๐1
๐ โ ๐1, ๐
๐ = โฉ๐1โช
return
๐1 ๐๐ ๐1 โ ๐๐, ๐1 = ๐ ๐1๐2 โ ๐๐, ๐2 = ๐1 ๐2 ๐1 โ ๐2,๐๐ = โฉ๐1โช
๏ก โโถ ฮ ร ๐นโ โ ฮ updates call strings along edges
๐1 โ ๐๐, ๐2 undef. ๐1๐2 โ ๐๐, ๐1 undef.
๐1 โ ๐1, ๐
๐ undef.
๏ก ๐ฟโฒ โ ๐, ๐ = ๐ฟ only defined iff:
A path ๐โฒ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ exists with ๐ท๐ ๐โฒ = ๐ฟโฒ
๐ = ๐โฒ||(๐,๐) lies in ๐ฝ๐๐ ๐
๐๐๐๐, ๐ and ๐ท๐ ๐ = ๐ฟ
12.06.2010 Nikolai Knopp 32
๏ก ๐บโ โ ๐โ โ ๐โ embeds edge effects from ๐บ
into ๐โ domain
๏ก For ๐, ๐ โ ๐นโ and data ๐ = . . , ๐ฟโฒ, ๐คโฒ , . .
โ ๐โ at ๐, data at ๐ is ๐ ๐,๐
โ
๐ = . . , ๐ฟ, ๐ค ,. .
๐ฟ = ๐ฟโฒ โ ๐,๐
๐ค = ๐ ๐,๐ ๐คโฒ
๐1 , 1 , ๐1๐2 ,โค ๐
call p a := a - 1
๐2
๐ ๐,๐2
๐
โ
Defini nition: n: Let ๐, ๐ โ ๐นโ, ๐ ๐,๐ โ ๐บ, ๐ โ ๐โ.
12.06.2010 34 Nikolai Knopp
๐1 , 1 , ๐1๐2 ,โค ๐ ๐1 , โค , ๐1๐2 ,โค
call p a := a - 1
๐2
๐ ๐,๐2 ๐ ๐,๐2
โ
๐
๐
โ
Defini nition: n: Let ๐, ๐ โ ๐นโ, ๐ ๐,๐ โ ๐บ, ๐ โ ๐โ.
12.06.2010 35 Nikolai Knopp
๐1 , 1 , ๐1๐2 ,โค ๐ ๐1 , โค , ๐1๐2 ,โค
call p a := a - 1
๐2
๐ ๐,๐2 ๐ ๐1 ๐ ๐,๐2
โ
๐ ๐ ๐,๐2
โ
๐ ๐1
๐
โ
Defini nition: n: Let ๐, ๐ โ ๐นโ, ๐ ๐,๐ โ ๐บ, ๐ โ ๐โ.
12.06.2010 36 Nikolai Knopp
๐ ๐,๐ if โ๐ฟโฒ with ๐ฟ = ๐ฟโฒ โ ๐, ๐ else โฅ ๐ ๐,๐
โ
โ ๐ ๐ฟ ๐ ๐ฟโฒ โ ๐ฟ โ ฮ
Define ๐บโ โ ๐โ โ ๐โ such that
1.
๐บโ smallest set containing ๐ ๐,๐
โ
| ๐, ๐ โ ๐นโ โช ๐๐๐โ
2.
๐บโ closed under functional composition and โ
1.
๐บ monotone distributive in ๐ โ ๐บโ monotone distributive in ๐โ
2.
๐บ distributive in ๐ โ ๐บโ continuo nuous us in ๐โ: For an infinite collection ๐๐ ๐โฅ1 โ ๐โ and ๐, ๐ โ ๐นโ: ๐ ๐,๐
โ
๐๐
๐
= ๐ ๐,๐
โ
๐๐
๐
12.06.2010 Nikolai Knopp 38
โ
๏ก The dataflow problem for ๐บโ,๐โ :
โ
= ๐, โค
โ = โ
๐ ๐,๐
โ
๐ฆ๐
โ ๐,๐ โ๐นโ
๐ โ ๐โ โ ๐
๐๐๐๐
๏ก Claim:
โ maximum fixed-point solution (MFP MFPCS
CS) for
๐ฆ๐
โ ๐โ๐โ
12.06.2010 Nikolai Knopp 40
๏ก Iteratively solving the equations yields decreasing
(๐บโ monotone) chains ๐ฆ๐
โ ๐ โฅ ๐ฆ๐ โ ๐+1 โ๐ โ ๐โ.
Then โ๐ฟ โ ฮ ๐ฆ๐
โ ๐ ๐ฟ โฅ ๐ฆ๐ โ ๐+1 ๐ฟ
a decreasing chain in ๐ with limit lim๐ฆ๐
โ ๐ฟ (exists as
๐ bounded).
๏ก ๐ฆ๐
โ โ lim ๐โโ ๐ฆ๐ โ ๐ possibly infinite but well-defined
โ ๐ฆ๐
โ ๐โ๐โ is maximal FP solution to DF problem.
12.06.2010 Nikolai Knopp 41
12.06.2010 Nikolai Knopp 42
๏ก Initialise ๐ฆ๐
โ ๐โ๐โ with
โ 0
= ๐, โค
โ 0 = โฅโ
๏ก Result if ฮ
te: Any iterative algorithm terminates and reaches MFP.
nite te: Iteration may diverge, intermediate steps unsafe approx. of MFP ๐ โ ๐โ โ ๐
๐๐๐๐
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 43
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 44
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 45
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 46
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 โฉ๐1โช,1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 47
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 โฉ๐1โช,1 โฉ๐1โช,1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 48
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 โฉ๐1โช,1 โฉ๐1โช,1 ๐1 ,โค ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 49
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค โฉ๐1โช, 1 , ๐1๐2 , โค ๐, 1 โฉ๐1โช,1 ๐1 ,โค ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
โฉ๐1โช, 1 , ๐1๐2 , โค
12.06.2010 Nikolai Knopp 50
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค โฉ๐1โช, 1 , ๐1๐2 , โค ๐, 1 ๐1 ,โค ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
12.06.2010 Nikolai Knopp 51
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค โฉ๐1โช, 1 , ๐1๐2 , โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
12.06.2010 Nikolai Knopp 52
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
...
12.06.2010 Nikolai Knopp 53
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
Call string ng approach: ch:
๏ก New dataflow problem on top of (๐, ๐บ)
๏ก Existence of MFPCS
12.06.2010 Nikolai Knopp 54
2.
ution n to ๐ดโ, ๐ฎโ โก MOP solution
12.06.2010 Nikolai Knopp 55
CS
๏ก This chapter: Show that MOP solution
๐ง๐ = ๐
๐: ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐,๐
โค can be acquired from MFPCS.
๏ก Chapter outline:
โฒ โ ๐ from MFPCS
โฒ = MOP
12.06.2010 Nikolai Knopp 56
CS)
๏ก Propagation of data along paths in ๐ปโ
For ๐ = ๐
๐๐๐๐, ๐ก1, โฆ ,๐ก๐,๐ โ ๐๐๐ขโ๐ปโ:
๐
๐ โ โ ๐ ๐ก๐,๐ โ
โ ๐ ๐ก๐โ1,๐ก๐
โ
โ โฏโ ๐ ๐ก1,๐ก2
โ
โ ๐
(๐ ๐๐๐๐,๐ก1) โ
๏ก Call string MOP solution (MOPCS
CS)
โ๐ โ ๐โ: ๐ง๐
โ โ โ ๐ ๐ โ ๐ฆ๐ ๐๐๐๐ โ
โถ ๐ โ ๐๐๐ขโ๐ปโ ๐
๐๐๐๐, ๐
12.06.2010 Nikolai Knopp 57
๐๐๐๐
๐
๐๐๐๐
๐ ๐
๐1 โ
๐
๐2 โ โฆ
CS)
๏ก Propagation of data along paths in ๐ปโ
For ๐ = ๐
๐๐๐๐, ๐ก1, โฆ ,๐ก๐,๐ โ ๐๐๐ขโ๐ปโ:
๐
๐ โ โ ๐ ๐ก๐,๐ โ
โ ๐ ๐ก๐โ1,๐ก๐
โ
โ โฏโ ๐ ๐ก1,๐ก2
โ
โ ๐
(๐ ๐๐๐๐,๐ก1) โ
๏ก Call string MOP solution (MOPCS
CS)
โ๐ โ ๐โ: ๐ง๐
โ โ โ ๐ ๐ โ ๐ฆ๐ ๐๐๐๐ โ
โถ ๐ โ ๐๐๐ขโ๐ปโ ๐
๐๐๐๐, ๐
12.06.2010 Nikolai Knopp 58
๐๐๐ขโ๐ปโ โ ๐ฝ๐๐ ๐๐๐๐
๐
๐๐๐๐
๐ ๐
๐1 โ
๐
๐2 โ โฆ
?
Lemma: : Let ๐ โ ๐โ,๐ โ ๐๐๐ขโ๐ปโ ๐ ๐๐๐๐,๐ , ๐ฟ โ ฮ. Then
1.
๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ and ๐ท๐ ๐ = ฮณ
โ ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ defined
2.
๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ = ๐
๐ โค
โ โMOPCS only contains paths in ๐ฝ๐๐ and for each such ๐ yields the same result as ๐, ๐บ โ
12.06.2010 Nikolai Knopp 59
By induc uction on ๐ ๐ for ๐ = (๐ ๐๐๐๐, ๐ก1,โฆ ,๐ก๐, ๐):
๏ก ๐ ๐ = ๐: Let ๐ โ ๐โ.
๐ = ๐
๐๐๐๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐,๐ ๐๐๐๐ โ ๐ท๐ ๐ = ๐.
๐
๐ โ ๐ ๐๐๐๐ =
๐, โค
๐ โค .
12.06.2010 Nikolai Knopp 60
๏ก IH:
Iff ๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ , ๐ ๐ < ๐ and ๐ฟ = ๐ท๐ ๐
then ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ = ๐
๐ โค .
๏ก IH:
Iff ๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ , ๐ ๐ < ๐ and ๐ฟ = ๐ท๐ ๐
then ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ = ๐
๐ โค
๏ก IS: ๐ ๐ = ๐.
12.06.2010 Nikolai Knopp 61
๐
๐๐๐๐
๐ ๐ก๐โ1 ๐ก๐ ...
๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ ๐ โ ๐ ๐ก๐,๐ ๐ฆ๐ก๐
โ
๏ก IH:
Iff ๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ , ๐ ๐ < ๐ and ๐ฟ = ๐ท๐ ๐
then ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ = ๐
๐ โค
๏ก IS: ๐ ๐ = ๐.
12.06.2010 Nikolai Knopp 62
๐
๐๐๐๐
๐ ๐ก๐โ1 ๐ก๐ ...
๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ ๐
๐โฒ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟโฒ ๐โฒ ๐ ๐ฟ = ๐ฟโฒ โ ๐, ๐ , ๐ฟโฒ = ๐ท๐ ๐โฒ โ ๐ ๐ก๐,๐ ๐ฆ๐ก๐
โ
๏ก IH:
Iff ๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ , ๐ ๐ < ๐ and ๐ฟ = ๐ท๐ ๐
then ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ = ๐
๐ โค
๏ก IS: ๐ ๐ = ๐.
12.06.2010 Nikolai Knopp 63
๐
๐๐๐๐
๐ ๐ก๐โ1 ๐ก๐ ...
๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ ๐
๐โฒ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟโฒ ๐โฒ ๐ =๐ฑ๐ฐ ๐๐โฒ โค ๐ฟ = ๐ฟโฒ โ ๐, ๐ , ๐ฟโฒ = ๐ท๐ ๐โฒ โ ๐ ๐ก๐,๐ ๐ฆ๐ก๐
โ
๏ก IH:
Iff ๐ โ ๐ฝ๐๐ ๐
๐๐๐๐, ๐ , ๐ ๐ < ๐ and ๐ฟ = ๐ท๐ ๐
then ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ = ๐
๐ โค
๏ก IS: ๐ ๐ = ๐.
12.06.2010 Nikolai Knopp 64
๐
๐๐๐๐
๐ ๐ก๐โ1 ๐ก๐ ...
๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ ๐
๐โฒ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟโฒ = ๐ ๐ก๐,๐ ๐๐โฒ โค โ ๐
๐ โค
๐โฒ ๐ =๐ฑ๐ฐ ๐๐โฒ โค
โ
๐ฟ = ๐ฟโฒ โ ๐, ๐ , ๐ฟโฒ = ๐ท๐ ๐โฒ
CS:
โ = ๐ง๐ โ
Theorem: (๐, ๐บ) distributive โ โ๐ โ ๐โ: ๐ฆ๐
โ = ๐ง๐ โ
Proof:
๏ก ๐๐
โ โค ๐๐ โ : Let ๐ โ ๐๐๐ขโ๐ปโ = ๐ ๐๐๐๐,๐ก1, โฆ , ๐ก๐, ๐ .
12.06.2010 Nikolai Knopp 65
:๐
๐
๐๐๐๐
๐ ๐ก1 ๐ก2 ๐ข
๐ฆ๐ก1
โ โค ๐ ๐ ๐๐๐๐,๐ก1 โ
๐ฆ๐ ๐๐๐๐
โ
๐ฆ๐ก2
โ โค ๐ ๐ก1,๐ก2 โ
๐ฆ๐ก1
โ
๐ฆ๐
โ โค ๐ ๐ก๐,๐ โ
๐ฆ๐ก๐
โ
...
CS:
โ = ๐ง๐ โ
Theorem: (๐, ๐บ) distributive โ โ๐ โ ๐โ: ๐ฆ๐
โ = ๐ง๐ โ
Proof:
๏ก ๐๐
โ โค ๐๐ โ : Let ๐ โ ๐๐๐ขโ๐ปโ = ๐ ๐๐๐๐,๐ก1, โฆ , ๐ก๐, ๐ .
12.06.2010 Nikolai Knopp 66
:๐
๐
๐๐๐๐
๐ ๐ก1 ๐ก2 ๐ข
๐ฆ๐ก1
โ โค ๐ ๐ ๐๐๐๐,๐ก1 โ
๐ฆ๐ ๐๐๐๐
โ
๐ฆ๐ก2
โ โค ๐ ๐ก1,๐ก2 โ
๐ฆ๐ก1
โ
๐ฆ๐
โ โค ๐ ๐ก๐,๐ โ
๐ฆ๐ก๐
โ
...
By monotonicity โ ๐ฆ๐
โ โค ๐ ๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐๐๐๐ท๐ = โ ๐
๐ โ ๐
โ ๐ฆ๐
โ โค โ ๐ ๐ โ ๐ฆ๐ ๐๐๐๐ โ ๐
CS:
โ = ๐ง๐ โ
๏ก ๐๐
โ โฅ ๐๐ โ:
By induction on ๐: โ๐ โฅ 0, ๐ โ ๐โ: ๐ฆ๐
โ ๐ โฅ ๐ง๐ โ
๐ = ๐ ๐๐๐๐ โถ ๐ฆ๐ ๐๐๐๐
โ(0)
โ ๐, โค = ๐
๐0 โ ๐ฆ๐ ๐๐๐๐ โ
โฅ ๐ง๐ ๐๐๐๐
โ
๐ โ ๐ ๐๐๐๐ โถ ๐ฆ๐
โ 0 โ โฅโ โฅ ๐ง๐ โ
โ๐ โค ๐, ๐ โ ๐โ: ๐ฆ๐
โ ๐ โฅ ๐ง ๐ โ
๐ฆ๐
โ ๐+1 โ
๐ ๐,๐
โ
๐ฆ๐
โ ๐ ๐,๐ โ๐นโ
IH โฅ ๐ ๐,๐
โ
๐ง๐
โ ๐,๐ โ๐นโ
โฅ ๐ง๐
โ
12.06.2010 Nikolai Knopp 67
โ Cont.+Dist.
โ
CS
Define ๐ฆ๐
โฒ โ ๐ as follows:
๐ฆ๐
โฒ โ ๐ฆ๐ โ ๐ฟ ๐ฟโฮ
Claim: ๐ฆ๐
โฒ is the MOP solution in (๐, ๐บ)
12.06.2010 Nikolai Knopp 68
๐1 ,1 , ๐1๐2 , โค , ๐1๐2๐2 ,โค , โฆ
a := a - 1
= ๐ฆ๐
โ ๐ฆ๐
โฒ = ๐ฆ๐ โ ๐ โง ๐ฆ๐ โ
๐1 โง ๐ฆ๐
โ
๐1๐2 โง โฏ = โฅ โง 1 โง โค โง โฏ = 1 โง โค โง โฏ = โค
๐
CS โก MOP
Theorem: For each ๐ โ ๐โ: ๐ฆ๐
โฒ = ๐ง๐
Proof:
๐ฆ๐
โฒ
12.06.2010 Nikolai Knopp 69
= ๐ฆ๐
โ(๐ฟ) ๐ฟโฮ
= ๐
๐ โ ๐ฆ๐ ๐๐๐๐ โ
๐ฟ |๐ โ ๐๐๐ขโ๐ปโ(๐
๐๐๐๐,๐) ๐ฟโฮ
= ๐
๐ โค |๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐ sth. ๐ท๐ ๐ = ๐ฟ ๐ฟโฮ
= ๐
๐ โค |๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐
= ๐ง๐
โ
Def ๐ฆ๐
โฒ
MFPCS= MOPCS
Only-valid-path
๐ท๐โ1 ฮ โฉ ๐ฝ๐๐ = ๐ฝ๐๐
๏ก Shown:
โ โ ๐ฆ๐ โฒ straightforward and without
functional composition
โ Call string approach is actually useful
๏ก But: Computing MFPCS still problematic
12.06.2010 Nikolai Knopp 70
3.
cise variant nts
12.06.2010 Nikolai Knopp 71
๏ก 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
๐
๏ก ฮ0 is finite subset of ฮ fulfilling:
If ๐ฟ โ ฮ0 and ๐ฟโฒ initial subtuple of ๐ฟ โ ๐ฟโฒ โ ฮ0
๏ก ๐ฝ๐๐โฒ โ ๐ โ ๐ฝ๐๐ | โ prefix ๐โฒof ๐: ๐ท๐ ๐โฒ โ ฮ0 ๏ก Let โ0 only act in ฮ0
12.06.2010 Nikolai Knopp 73
Now consider ๐0
โ ,๐บ0 โ with ๐0 โ โ ฮ0 โ ๐ finite
๐ฆ๐
โฒ 0 โ ๐ฆ๐ โ ๐ฟ ๐ฟโฮ0
๐ง๐
โฒ 0 โ ๐ ๐ 0 | ๐ โ ๐ฝ๐๐โฒ ๐ ๐๐๐๐, ๐
12.06.2010 Nikolai Knopp 74
(MFPCS0) (MOPCS0)
Theorem: โ๐ โ ๐โ: ๐ฆ๐
โฒ 0 = ๐ง๐ โฒ
Proof:
replacing ฮ, ๐ฝ๐๐,โ by ฮ0, ๐ฝ๐๐โฒ,โ0
โ required
12.06.2010 Nikolai Knopp 75
โ
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 76
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 77
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 78
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 79
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
12.06.2010 Nikolai Knopp 80
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช, 1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค , ๐1๐2๐2๐2 ,โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
๏ก No information gain on further iteration ๏ก Stop if data tagged by longer CS โirrelevantโ
12.06.2010 Nikolai Knopp 81
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช,1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค โฉ๐1โช, 1 , ๐1๐2 ,โค , ๐1๐2๐2 , โค , ๐1๐2๐2๐2 ,โค
๐ ๐2,๐ ๐
โ
๐ ๐1,๐ ๐
โ
๏ก No information gain on further iteration ๏ก Stop if data tagged by longer CS โirrelevantโ
12.06.2010 Nikolai Knopp 82
if a=0
๐
๐๐๐๐
๐1
call p a := a - 1
T F
p
call p
main
๐
๐
read a, b t := a * b
๐2
๐, โค ๐, 1 ๐ ๐ ๐๐๐๐,๐1
โ
๐ ๐ ๐,๐2
โ
๐2
๐ ๐2,๐2
โ
โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค โฉ๐1โช, 1 , ๐1๐2 , โค
๏ก Why paths of arbitrary length?
โ only possible by recurring on call site(s)
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
Let
๏ก (๐, ๐บ) with ๐ finite ๏ก ๐ โ ๐ฟ โ ๐ 2
๏ก ฮ0 = ฮ๐.
Then โ ๐ โ ๐โ: If ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐ then exists ๐โฒ โ ๐ฝ๐๐โฒ(๐ ๐๐๐๐, ๐) with ๐
๐ 0 = ๐๐โฒ 0 .
12.06.2010 Nikolai Knopp
๐1 ๐๐๐๐
๐2
call ๐1
๐
๐2
๐1 call ๐1
return
๐1 ๐๐2 ๐2
84
Let
๏ก (๐, ๐บ) with ๐ finite ๏ก ๐ โ ๐ฟ โ ๐ 2
๏ก ฮ0 = ฮ๐.
Then โ ๐ โ ๐โ: If ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐ then exists ๐โฒ โ ๐ฝ๐๐โฒ(๐ ๐๐๐๐, ๐) with ๐
๐ 0 = ๐๐โฒ 0 .
12.06.2010 Nikolai Knopp
๐1 ๐๐๐๐
๐2
call ๐1
๐
๐2
๐1 call ๐1
return
๐1 ๐๐2 ๐2
85
Let
๏ก (๐, ๐บ) with ๐ finite ๏ก ๐ โ ๐ฟ โ ๐ 2
๏ก ฮ0 = ฮ๐.
Then โ ๐ โ ๐โ: If ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐ then exists ๐โฒ โ ๐ฝ๐๐โฒ(๐ ๐๐๐๐, ๐) with ๐
๐ 0 = ๐๐โฒ 0 .
12.06.2010 Nikolai Knopp
๐1 ๐๐๐๐
๐2
call ๐1
๐
๐2
๐1 call ๐1
return
๐1 ๐๐2 ๐2
86
๏ก Proof: By induction on ๐(๐) โ length of ๐.
๐๐๐๐, ๐ , ๐ ๐ = ๐.
Assume ๐ โ ๐ฝ๐๐โฒ ๐
๐๐๐๐, ๐ .
Let ๐โฒ the shortest prefix with ๐โฒ โ ๐ฝ๐๐โฒ ๐
๐๐๐๐, ๐ .
Then ๐โฒ contains ๐ + 1 unreturned calls.
By decomposition Lemma:
12.06.2010 Nikolai Knopp 87
๐โฒ = ๐0|| ๐1, ๐
๐1 ||๐1|| ๐2, ๐ ๐2 || โฆ || ๐๐+1, ๐ ๐๐+1 ||๐๐+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
๏ก By IH
IH, โ๐โฒ โ ๐ฝ๐๐โฒ ๐
๐๐๐๐,๐ for ๐
with ๐๐โฒ = ๐
๐ and thus
๐๐โฒ = ๐
๐.
12.06.2010 Nikolai Knopp 88
๐โฒ = ๐0|| ๐1, ๐
๐1 ||๐1|| ๐2, ๐ ๐2 || โฆ || ๐๐+1, ๐ ๐๐+1 ||๐๐+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
๏ก By IH
IH, โ๐โฒ โ ๐ฝ๐๐โฒ ๐
๐๐๐๐,๐ for ๐
with ๐๐โฒ = ๐
๐ and thus
๐๐โฒ = ๐
๐.
12.06.2010 Nikolai Knopp 89
๐โฒ = ๐0|| ๐1, ๐
๐1 ||๐1|| ๐2, ๐ ๐2 || โฆ || ๐๐+1, ๐ ๐๐+1 ||๐๐+1
โ
๏ก 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
๏ก ๐ impractically large for most problems ๏ก Lower bounds exists for certain problem
classes. Example: Decomposable frameworks
12.06.2010 Nikolai Knopp 91
๐ = , ๐ข , ๐ฃ , ๐ข, ๐ฃ , โฅ ๐ = 50
12.06.2010 Nikolai Knopp 92
if โฆ return
๐
๐๐๐๐
๐1
call p b := b + 1 t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐ ๐2 ๐
๐
๐๐
read a,b t := a * b u := 2 * b t := a * b u := 2 * b print t,u
๐2 a*b,2*b avail.?
๐ = , ๐ข , ๐ฃ , ๐ข, ๐ฃ , โฅ ๐ = 50
12.06.2010 Nikolai Knopp 93
if โฆ return
๐
๐๐๐๐
๐1
call p b := b + 1 t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐ ๐2 ๐
๐
๐๐
read a,b t := a * b u := 2 * b t := a * b u := 2 * b print t,u
๐2
+๐ข + ๐ฃ ๐๐ โ๐ข ๐๐ +๐ข โ ๐ฃ
a*b,2*b avail.?
๐ = , ๐ข , ๐ฃ , ๐ข, ๐ฃ , โฅ ๐ = 50
12.06.2010 Nikolai Knopp 94
if โฆ return
๐
๐๐๐๐
๐1
call p b := b + 1 t := a * b a := a - 1
T F
p
call p stop
main
๐๐๐๐๐ ๐2 ๐
๐
๐๐
read a,b t := a * b u := 2 * b t := a * b u := 2 * b print t,u
๐2
+๐ข + ๐ฃ ๐๐ โ๐ข ๐๐ +๐ข โ ๐ฃ ๐ฃ ๐ฃ ๐ข, ๐ฃ ๐ฃ ๐ข
a*b,2*b avail.?
๐๐ข = , ๐ข ,โฅ , ๐๐ฃ = , ๐ฃ , โฅ , โ ๐ = ๐๐ข ร ๐๐ฃ ๐ = 18
12.06.2010 Nikolai Knopp 95
if โฆ return call p b := b + 1 t := a * b a := a - 1
T F
call p stop read a,b t := a * b u := 2 * b t := a * b u := 2 * b print t,u
๐
๐๐๐๐
๐1
p main
๐๐๐๐๐ ๐2 ๐
๐
๐๐ ๐2
+๐ข +๐ฃ ๐ข ๐ฃ ๐ฃ id ๐๐ ๐ฃ โ๐ข ๐๐ ๐ฃ ๐๐ ๐๐ +๐ข โ๐ฃ ๐ข
a*b,2*b avail.?
๏ก Theorem: Let ๐, ๐บ decomposable into ๐
frameworks ๐๐,๐บ๐ ๐=1
๐
. Setting the maximum callstring length to ๐ = ๐ฟ โ max
๐โ 1..๐
๐๐
2
yields ๐ง๐
โฒ 0 = ๐ง๐ โ๐ โ ๐โ.
12.06.2010 Nikolai Knopp 96
๏ก 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.
๐ for each
expression ๐ with ๐๐ = โค, 1,โฅ , ๐บ
๐ = ๐๐, ๐ โค, ๐ 1, ๐ โฅ
12.06.2010 Nikolai Knopp 97
๏ก If ๐ finite, MFPCS iteratively computable on ฮ0
๏ก Enforce termination by limiting max. CS
length
theoretical value
12.06.2010 Nikolai Knopp 98
4.
utions ns
12.06.2010 Nikolai Knopp 99
๏ก Prefer a safe approximative solution ๐ฆ
๐ โค ๐ง๐
constraints
and computation of ๐ฆ ๐ โค ๐ง๐ feasible. โ Accept precision loss for less complexity.
12.06.2010 Nikolai Knopp 100
12.06.2010 Nikolai Knopp 101
๏ก Let โ an operation in ฮ
with left identity ๐ฅ โ ฮ .
๏ก Encoding function ๐: ฮ โ ฮ
๐ ๐ฟ = ๐ ๐1 โ โฏโ ๐ ๐๐ and ๐ ๐ฟ = ๐ฅ.
12.06.2010 Nikolai Knopp 102
๏ก For each ๐, ๐ โ ๐นโ, define transfer relation
๐ ๐,๐ โ ฮ ร ฮ :
โ๐ โ ฮ : ๐ ๐ ๐,๐ ๐
๐ ๐ฟโฒ ๐ ๐,๐ ๐ ๐ฟ โ ๐๐๐๐๐ = ๐๐ ๐๐ข๐ฃ๐ ๐
โ1
12.06.2010 Nikolai Knopp 103
๐ ๐ ๐โฒ ๐โฒ ๐ฟโฒ ๐ฟ ๐ฟ ๐ฟโฒ ๐ ๐ ๐ฟโฒ ๐ฟโฒ ๐ ๐ฟโฒ = ๐
Let ๐ = ๐1, ๐2, โฆ , ๐๐ โ ๐๐๐ขโ๐ปโ.
๏ก Define ๐๐ โ ๐ ๐1,๐2 โ ๐ ๐2,๐3 โ โฏ โ ๐ ๐๐โ1,๐๐ ๏ก ๐ acceptable โถโ ๐๐ โ โ ๏ก Intraprocedurally acceptable paths:
๐ฝ๐ต๐ ๐ ๐๐๐๐, ๐ โ ๐ โ ๐๐๐ขโ๐ปโ ๐ ๐๐๐๐,๐ |๐๐ ๐ฅ โ โ
12.06.2010 Nikolai Knopp 104
12.06.2010 Nikolai Knopp 105
๐ ๐ ๐,๐ ๐
๐
๐ท๐ ๐โฒ = ๐ฟโฒ ๐ท๐ ๐โฒ|| ๐, ๐ = ๐ฟ
๐ ๐ ๐ ๐
๐๐๐๐
๐โฒ
๐ฅ ๐๐โฒ ๐ ๐ฟ
12.06.2010 Nikolai Knopp 106
๐ ๐ ๐,๐ ๐
๐
๐ท๐ ๐โฒ = ๐ฟโฒ ๐ท๐ ๐โฒ|| ๐, ๐ = ๐ฟ
๐ ๐ฆ
๐
๐ ๐ ๐
๐๐๐๐
๐โฒ
๐ฅ ๐๐โฒ ๐ ๐ฟ
12.06.2010 Nikolai Knopp 107
๐ ๐ ๐,๐ ๐
๐
๐ท๐ ๐โฒ = ๐ฟโฒ ๐ท๐ ๐โฒ|| ๐, ๐ = ๐ฟ
๐
๐ท๐ ๐ = ๐ฟ
๐ ๐ฆ
๐
๐ ๐ ๐
๐๐๐๐
๐โฒ
๐ฅ ๐๐โฒ ๐ ๐ฟ
12.06.2010 Nikolai Knopp 108
๐ ๐ ๐,๐ ๐
๐
๐ท๐ ๐โฒ = ๐ฟโฒ ๐ท๐ ๐โฒ|| ๐, ๐ = ๐ฟ
๐
๐ท๐ ๐ = ๐ฟ
๐ ๐ฆ
๐
๐ ๐ ๐
๐๐๐๐
๐โฒ
๐ฅ ๐๐โฒ ๐ ๐ฟ ๐ฅ ๐๐
๐ ๐ฟ
12.06.2010 Nikolai Knopp 109
๐ ๐ ๐,๐ ๐
๐
๐ท๐ ๐โฒ = ๐ฟโฒ ๐ท๐ ๐โฒ|| ๐, ๐ = ๐ฟ
๐
๐ท๐ ๐ = ๐ฟ
๐ ๐ฆ
๐
๐ ๐ ๐
๐๐๐๐
๐โฒ
๐ฅ ๐๐โฒ ๐ ๐ฟ ๐ฅ ๐๐
๐ ๐ฟ
๐๐๐๐, ๐ โ ๐ฝ๐๐ ๐ ๐๐๐๐, ๐
Now define framework ๐ , ๐บ
โ ฮ โ ๐
from all ๐ โ ฮ to ๐ โ ฮ for which ๐ ๐ ๐,๐ ๐: ๐ ๐,๐
โ
๐๐ ๐ โ โ ๐ ๐,๐ ๐๐ ๐ |๐ ๐ ๐,๐ ๐
๐ฆ ๐
โ ๐โ๐โ (which exists as ฮ
finite), and the MOP solution ๐ง ๐ using ๐ฝ๐ต๐. โ Obviously ๐ง ๐ โค ๐ง๐, so a safe approximation.
12.06.2010 Nikolai Knopp 110
๏ก Without proof:
๐ฆ ๐ = ๐ง ๐ โค ๐ง๐
๐ฆ ๐ โค ๐ง ๐ โค ๐ง๐
๏ก Examples:
12.06.2010 Nikolai Knopp 111
๏ก ฮ
= ๐ฅ ๐: ๐ฟ โฆ ๐ฅ โ: ๐ฅ, ๐ฅ โฆ ๐ฅ โ intraproc. analysis
๏ก ฮ
= โค/๐โค, ๐ โ โ โ call ๐๐ โ ๐โ: ๐ ๐๐ = ๐ ๐ โ ๐ โ ๐ + ๐ ๐๐๐ ๐ โ only ๐ call strings
12.06.2010 Nikolai Knopp 112
๏ก CS approach makes interprocedural flow
explicit
functions
12.06.2010 Nikolai Knopp 113
Assume ๐, ๐บ distributive.
๏ก ๐ and ฮ finite:
MFPCS iteratively computable and yields MOP solution.
๏ก Only ๐ finite:
Iterative calculation of MFPCS will converge
diverge
12.06.2010 Nikolai Knopp 114
All other cases combinations of:
๏ก Convergence then only guaranteed if ฮ
embedded into finite subset ฮ
๏ก Solution then is safe approximation of MOP
12.06.2010 Nikolai Knopp 115
12.06.2010 Nikolai Knopp 116