CORNELL CS 611 - Lecture 18 Fixed Points and CPOs

Unformatted text preview:

CS611 Lecture 18 Fixed Points and CPOs 9-18-00Scribe: Chris Hardin, Michael Clarkson Lecturer: Andrew Myers1 Trouble with whileIf we try to define C[[ while b do c]] in the obvious manner, we getC[[ while b do c]] σ = if ¬B[[ b]] then σelse if C[[ c]] σ =⊥ then ⊥else C[[ while b do c]] ( C[[ c]] σ)However, C[[ while b do c]] appears on both sides—this is really an equation, not a definition1. Looking atthis more generally, C[[ while b do c]] is a solution to the equationx = F (x)whereF = λf ∈ Σ → Σ⊥.λσ ∈ Σ⊥. if ¬B[[ b]] then σ else f(C[[ c]] σ).(F is simplified here slightly, by ignoring the case where c fails to terminate.) What we would like to dois defineC[[ while b do c]] = fix(F )= fix(λf ∈ Σ → Σ⊥.λσ ∈ Σ. if ¬B[[ b]] σ then σ else f(C[[ c]] σ))But which fixed point of F do we want? We would like to take the “least” fixed point, in the sense that wewant C[[ while b do c]] to give a non-⊥ result only when required by the intended semantics. (For example,we want C[[ while true do skip]] σ = ⊥ for all σ.) The rest of this lecture will expand on this notion of leastfixed point, with a look at the underlying theory of partial orders.Iterating F applied to some “minimal” functio f⊥= λσ. ⊥ allows us to create a sequence of successivelybetter approximations for C[[ while b do c]] :f0= f⊥f1= F (f⊥)= λσ. if ¬B[[ b]] then σ else ⊥f2= F (F (f⊥))= λσ. if ¬B[[ b]] σ then σ elseif ¬B[[ b]] C[[ c]] σ then C[[ c]] σ else ⊥f3= F (F (F (f⊥)))= λσ. if ¬B[[ b]] σ then σ elseif ¬B[[ b]] C[[ c]] σ then C[[ c]] σ elseif ¬B[[ b]] C[[ c]] C[[ c]] σ then C[[ c]] C[[ c]] σ else ⊥...fn= Fn(f⊥)...The “limit” of this sequence will be the denotation of while b do c. To take this “limit”, we will considerthe approximations as an increasing sequence f0≤ f1≤ f2≤···, and then take the least upper bound. Wemust first study partial orders to get the needed machinery.1It’s important to point out here that our denotations will be defined by structural induction, so that it is okay in this caseto assume that B[[ b]] a n d C[[ c]] are defined.12PartialOrdersA partial order (also known as a partial ly ordered set or poset)isapair(S, ), where• S is a set of elements.•is a relation on S which is:i. reflexive: x  xii. transitive: (x  y ∧ y  z) ⇒ x  ziii. antisymmetric: (x  y ∧ y  x) ⇒ x = yExamples:• (Z, ≤), where Z is the integers and ≤ is the usual ordering.• (Z, =) (Note that unequal elements are incomparable in this order. Partial orders ordered by theidentity relation, =, are called discrete.)• (2S, ⊆)(Here,2Sdenotes the powerset of S, the set of all subsets of S, often written P(S), and inWinskel, Pow(S).)• (2S, ⊇)• (S, ), if we are given that (S, ) is a partial order.• (ω,|), where ω = {0, 1, 2,...} and a|b ⇔ (a divides b) ⇔ (b = ka for some k ∈ ω). Note that for anyn ∈ ω,wehaven|0; we call 0 an upper bound for ω (but only in this ordering, of course!).Non-examples:• (Z,<) is not a partial order, because < is not reflexive.• (Z, ), where m  n ⇔|m|≤|n|, is not a partial order because  is not anti-symmetric: −1  1and1 −1, but −1 =1.The “partial” in partial order comes from the fact that our definition does not require these orders tobe total; e.g., in the partial order (2{a,b}, ⊆), the elements {a} and {b} are incomparable: neither {a}⊆{b}nor {b}⊆{a} hold.Hasse diagrams Partial orders can be described pictorially using Hasse diagrams2. In a Hasse diagram,each element of the partial order is displayed as a (possibly labeled) point, and lines are drawn betweenthese points, according to these rules:1. If x and y are elements of the partial order, and x  y, then the point corresponding to x is drawnlower in the diagram than the point corresponding to y.2. A line is drawn between the points representing two elements x and y iff x  y and ¬∃z in the partialorder, distinct from x and y, such that x  z and z  y (i.e., the ordering relation between x and y isnot due to transitivity).An example of a Hasse diagram for the partial order on the set 2{a,b,c}using ⊆ as the binary relation is:2Named after Helmut Hasse, 1898-1979. Hasse published fundamental results in algebraic number theory, including theHasse (or “local-global”) principle. He succeeded Hilbert and Weyl as the chair of the Mathematical Institute at G¨ottingen.2{a}{b}{a,b}{c}{a,c}{b,c}{a,b,c}{ }Least upper bounds Given a partial order (S, ), and a subset B ⊆ S, y is an upper bound of B iff∀x ∈ B.x  y. In addition, y is a le ast upper bound iff y is an upper bound and y  z for all upper boundsz of B. We may abbreviate “least upper bound” as LUB or lub. We shall notate the LUB of a subset B asB. We may also make this an infix operator, as in{x1,...,xm} = x1 ... xm.Chains A chain is a pairwise comparable sequence of elements from a partial order (i.e.,elementsx0,x1,x2...such that x0 x1 x2 ...). For any finite chain, its LUB is its last element (e.g.,{x0,x1,...,xn} = xn).Infinite chains (Winskell: ω-chains) may also have LUBs.Complete partial orders A complete partial order (cpo or CPO) is a partial order in which every chainhas a LUB. Note that the requirement for every chain is trivial for finite chains (and thus finite partialorders) – it is the infinite chains that can cause trouble.Some examples of cpos:• (2S, ⊆)HereS itself is the LUB for the chain of all elements.• (ω ∪{∞}, ≤)Here∞ is the LUB for any infinite chain: ∀w ∈ ω.w ≤∞.• ([0, 1], ≤)where[0, 1] is the closed continuum, and 1 is a LUB for infinite chains. Note that makingthe continuum open at the top – [0, 1) – would cause this to no longer be a cpo, since there would beno LUB for infinite chains such as12,23,34,...• (S, =) This is a discrete cpo, just as it is a discrete partial order. The only infinite chains are of thesort xi xi xi...,ofwhichxiis itself a LUB.Even if (S, )isacpo,(S, ) is not necessarily a cpo. Consider ((0, 1], ≤), which is a cpo. Reversing itsbinary relation yields ((0, 1], ≥) which is not a cpo, just as ([0, 1), ≤)abovewasnot.CPOs can also have a least element, written ⊥, such that ∀x.⊥x. We call a cpo with such an elementa pointed cpo. Winskel instead uses cpo with bottom.3 Least fixed


View Full Document

CORNELL CS 611 - Lecture 18 Fixed Points and CPOs

Download Lecture 18 Fixed Points and CPOs
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 18 Fixed Points and CPOs and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 18 Fixed Points and CPOs 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?