Monotone functions Monotone functions on CCPOs Let ( D, ) and ( D - - PowerPoint PPT Presentation

monotone functions monotone functions on ccpo s let d and
SMART_READER_LITE
LIVE PREVIEW

Monotone functions Monotone functions on CCPOs Let ( D, ) and ( D - - PowerPoint PPT Presentation

Monotone functions Monotone functions on CCPOs Let ( D, ) and ( D , ) be ccpos and con- Lemma 4.30 sider a (total) function Let ( D, ) and ( D , ) be ccpos and let f : D D f : D D Then f is


slide-1
SLIDE 1

Monotone functions Let (D, ⊑) and (D′, ⊑′) be ccpo’s and con- sider a (total) function f : D → D′ Then f is monotone if whenever d1 ⊑ d2 also f d1 ⊑′ f d2 Examples f1, f2 : P({a,b,c}) → P({d,e}) X f1 X f2 X {a,b,c} {d,e} {d} {a,b} {d} {d} {a,c} {d,e} {d} {b,c} {d,e} {e} {a} {d} {d} {b} {d} {e} {c} {e} {e} ∅ ∅ {e}

XIV.1

Monotone functions on CCPO’s Lemma 4.30 Let (D, ⊑) and (D′, ⊑′) be ccpo’s and let f : D → D′ be a monotone function. If Y is a chain in D then {f d | d ∈ Y } is a chain in D′. Furthermore,

′{f d | d ∈ Y } ⊑′ f( Y )

Proof of Lemma 4.30 If Y = ∅ then the result follows from ⊥′ ⊑′ f ⊥. If Y = ∅ then there are two stages:

  • {f d | d ∈ Y } is a chain in D′
  • ′{f d | d ∈ Y } ⊑′ f(

Y )

XIV.2

slide-2
SLIDE 2

Example: Factorial program Sds[y := 1; while ¬(x=1) do (y:=y⋆x; x:=x−1)] s = (FIX F) (s[y → 1]) where (F g) s =

        

g(s[y → (s y ⋆ s x)] [x → (s x) − 1]) if s x = 1 s if s x = 1 Then F is monotone

XIV.3

Monotonicity is not enough Example 4.31 f : P(N ∪ {a}) → P(N ∪ {a}) defined by f X =

  

X if X is finite X ∪ {a} if X is infinite Then f is a monotone function. But

′{f d | d ∈ Y } = f( Y ) does not

always hold. Let Y = {{0, 1, · · ·, n} | n ≥ 0}. Then

{f X | X ∈ Y } = Y = N

But f(

Y ) = f N = N ∪ {a}

XIV.4

slide-3
SLIDE 3

Continuous functions Let (D, ⊑) and (D′, ⊑′) be ccpo’s and con- sider a (total) function f : D → D′. Then f is continuous if

  • f is monotone
  • ′{f d | d ∈ Y } = f (

Y )

for all non-empty chains Y of D Exercise 4.34 Let (D, ⊑) and (D′, ⊑′) be ccpo’s and let f : D → D′ be a (total) function satisfying

′{f d | d ∈ Y } = f ( Y )

for all non-empty chains Y of D. Then f is monotone

XIV.5

Example: Factorial program Sds[y := 1; while ¬(x=1) do (y:=y⋆x; x:=x−1)] s = (FIX F) (s[y → 1]) where (F g) s =

        

g(s[y → (s y ⋆ s x)] [x → (s x) − 1]) if s x = 1 s if s x = 1 Then F is continuous

XIV.6

slide-4
SLIDE 4

Fixed point theorem Theorem 4.37 Let f : D → D be a continuous function

  • n the ccpo (D, ⊑) with least element ⊥.

Then FIX f =

{fn⊥ | n ≥ 0}

defines an element of D and this element is the least fixed point of f. Notation: f0 = id fn+1 = f ◦ fn for nǫ0 Proof

  • 1. FIX f is well-defined
  • 2. FIX f is a fixed point of f
  • 3. FIX f is the least fixed point of f

XIV.7

Example: Factorial program Sds[y := 1; while ¬(x=1) do (y:=y⋆x; x:=x−1)] s = (FIX F) (s[y → 1]) where (F g) s =

        

g(s[y → (s y ⋆ s x)] [x → (s x) − 1]) if s x = 1 s if s x = 1 We must ensure that

  • (State ֒

→ State, ⊑) is a ccpo Lemma 4.25

  • F is a continuous function

Then Theorem 4.37 can be applied

XIV.8

slide-5
SLIDE 5

Example: Factorial program (F 0⊥)s = undef (F 1⊥)s =

  

undef if s x = 1 s if sx = 1 (F 2⊥)s =

              

undef if s x = 1and s x = 2 s[y → (s y) ⋆ 2][x → 1] if s x = 2 s if s x = 1 (F n⊥)s =

        

undef if s x < 1 or s x > n s[y → (s y) ⋆ j ⋆ . . . ⋆ 2 ⋆ 1][x → 1] if s x = j and 1 ≤ j ≤ n (FIX F)s =

        

undef if s x < 1 s[y → (s y) ⋆ n ⋆ . . . ⋆ 2 ⋆ 1][x → 1] if s x = n and 1 ≤ n

XIV.9