Example: Summation program (preconditions for Fixed Point Theorem) S - - PowerPoint PPT Presentation

example summation program preconditions for fixed point
SMART_READER_LITE
LIVE PREVIEW

Example: Summation program (preconditions for Fixed Point Theorem) S - - PowerPoint PPT Presentation

Example: Summation program (preconditions for Fixed Point Theorem) S ds [ [ y := 0 ; while ( x = 0) do ( y := y + x ; x := x 1)] ] s = ( FIX F )( s [ y 0]), where g ( s [ y ( s y + s x )][ x ( s x 1)]) , if s x


slide-1
SLIDE 1

Example: Summation program (preconditions for Fixed Point Theorem)

Sds[ [y := 0 ; while ¬(x = 0) do (y := y + x; x := x − 1)] ]s = (FIX F)(s[y → 0]), where (F g) s =    g(s[y → (s y + s x)][x → (s x − 1)]), if s x = 0 s, if s x = 0 To be shown for the (constructive) computation of the denotational semantics via the Fixed Point Theorem (established in “Main Results” once and for all): (1) (State ֒ → State, ⊑) is a ccpo. (2) F is a continuous function.

1

slide-2
SLIDE 2

Example: Summation program (constructive fixed point computation (1))

(F g) s = ( g(s[y → (s y + s x)][x → (s x − 1)]), if s x = 0 s, if s x = 0 Notation: s′ = s[y → (s y + s x)][x → (s x − 1)] Hence: s′ x = 0 ⇐ ⇒ s x = 1 (F 0⊥) s = undef, (F 1⊥) s = ( undef, if s x = 0 s, if s x = 0 (F 2⊥) s = F (F ⊥) s = ( (F ⊥) s′, if s x = 0 s, if s x = 0 = 8 > > < > > : undef, if s x = 0 and s′ x = 0 s′, if s x = 0 and s′ x = 0 s, if s x = 0 = 8 > > < > > : undef, if s x = 0 and s x = 1 s′, if s x = 1 s, if s x = 0 = ( undef, if s x = 0 and s x = 1 s[y → (s y + s x)][x → 0], if 0 ≤ s x ≤ 1 2

slide-3
SLIDE 3

Example: Summation program (constructive fixed point computation (2))

(F g) s = ( g(s[y → (s y + s x)][x → (s x − 1)]), if s x = 0 s, if s x = 0 (F 0⊥) s = undef (F 1⊥) s = ( undef, if s x = 0 s, if s x = 0 (F 2⊥) s = ( undef, if s x = 0 and s x = 1 s[y → (s y + s x)][x → 0], if 0 ≤ s x ≤ 1 . . . (F n⊥) s = 8 > > < > > : undef, if s x < 0 or s x > n − 1 s[y → (s y + s x + (s x − 1)+ . . . + 1][x → 0], if 0 ≤ s x ≤ n − 1 (FIX F ) s = ( undef, if s x < 0 s[y → (s y + Pm

k=1 k)][x → 0],

if m = s x ≥ 0 3

slide-4
SLIDE 4

Example: Summation program (denotational semantics: final result)

Sds[ [P] ]s = Sds[ [y := 0 ; while ¬(x = 0) do (y := y + x; x := x − 1)] ]s = (FIX F)(s[y → 0]), where (F g) s = 8 < : g(s[y → (s y + s x)][x → (s x − 1)]), if s x = 0 s, if s x = 0 Morever: (FIX F) s = 8 < : undef, if s x < 0 s[y → (s y + Pm

k=1 k)][x → 0],

if m = s x ≥ 0 Hence: Sds[ [P] ]s = (FIX F)(s[y → 0]) = 8 < : undef, if s x < 0 s[y → Ps x

k=1 k)][x → 0],

if s x ≥ 0

4