Quick viewing(Text Mode)

Mathematical Foundations: (3) Lattice Theory --- Part I

Mathematical Foundations: (3) Lattice Theory --- Part I

« Mathematical foundations: (3) theory — Part I » Patrick Cousot Jerome C. Hunsaker Visiting Professor Posets Massachusetts Institute of Technology Department of Aeronautics and Astronautics cousot mit edu www.mit.edu/~cousot Course 16.399: “Abstract interpretation” http://web.mit.edu/afs/athena.mit.edu/course/16/16.399/www/

Course 16.399: “”, Thursday March 17th, 2005 — 1 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 3 — ľ P. Cousot, 2005

Binary

– Given sets X1; X2;:::;Xn, the is n def X1 X2 : : : Xn = x1; :::; xn ^ Xi ˆ ˆ ˆ fh i j 2 g i=1

– An n-ary relation r on X ; X ;:::;Xn is r }(X 1 2 2 1 ˆ X2 : : : Xn) i.e. r X1 X2 : : : Xn Garrett Birkhoff George Grätzer ˆ ˆ „ ˆ ˆ ˆ – If n =2, r is binary – A r on a X is r }(X X) 2 ˆ – We write xry for x; y r h i2

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 2 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 4 — ľ P. Cousot, 2005 Graph of a binary relation Poset – A relation can be seen as a graph where X is the set A poset X; is a set equipped with a partial order h »i » of vertices and r is the set of arcs. For example on X.

a b Examples: – N; is a poset (where x; y N : x y z X = a; b; c; d h »i 8 2 » () 9 2 f g N : x + z = y) r = c; b ; b; c ; c d fh i h i – N; is a poset (where x; y N : x y x b; d ; d; c h –i 8 2 – () » h i h ig y) – Familiar relations on R are <, , =, = while on }(X), – 6 where X is a set, we have , , etc. „ ff

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 5 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 7 — ľ P. Cousot, 2005

Partial order Strict partial order – A partial order on a set X is a binary relation on – if is a partial order then @ is its strict version x @ » » v X which is y def= x y x = y, sometimes denoted . v ^ 6 v6 - reflexive i.e. x X : x x – @, is the of @ and 8 2 » 6 6v v - antisymetric i.e. x; y X : (x y y x) = – x @ y y @ x means that x and y are not comparable 8 2 » ^ » ) 6 ^ 6 x = y (sometimes written x y). k - transitive i.e. x; y; z X : (x y y z) = – A strict partial order < on a set X is a binary relation 8 2 » ^ » ) (x z) < on X which is » where x y formally means x; y . - irreflexive i.e. x X : (x < x) » h i 2 » 8 2 : - transitive i.e. x; y; z X : (x

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 6 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 8 — ľ P. Cousot, 2005 Correspondence between partial and strict partial orders – A preorder on a set X is a binary relation on X Theorem. If < is a strict partial order on X then — » » which is defined by x y x

Theorem. If is a partial order on X then < defined def » Theorem. If is a preorder then x y = (x y) by x

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 10 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 12 — ľ P. Cousot, 2005 Quotient 1 poset of a preorder Restriction of a poset to a If r is a binary relation on a set X and Y X then „ Theorem. Let be a preorder on a set X. Let be — ” def the equivalence relation defined by x y (x r Y = x; y r x; y Y ” () — j fh i2 j 2 g y) (y x). Let X= be the quotient of X by . ^ — ” ” Theorem. If X; is a poset and Y X then X; Define 2 on X= by h »i „ h »jY i —” ” is also a poset def [x] [y] = x y Proof. – If x Y then x x = x x = tt ” —” ” — 2 »jY » – If x;y Y then x y y x implies x y y x so x = y Then X= ; is the quotient poset of the preorder 2 »jY ^ »jY » ^ » h ” —”i – If x;y;z Y then x Y y y Y z implies x y z so x z on X hence X; . x z on2 Y since x;»j z Y^. »j » » » h —i »jY 2 def 1 Recall that if is an equivalence relation on a set X then the quotient X= = [x] x X is the set of ” def ” f ” j 2 g ut equivalence classes [x] = y X x y . ” f 2 j ” g 2 In general, is denoted for short. —” — Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 13 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 15 — ľ P. Cousot, 2005

Proof. – First remark that the definition of on X= is independent of ” Intervals the choice of the representants x and y of the—” classes [x] and [y] since ” ” x0 x and y0 y implies x0 x y y0 so x0 y0 by transitivity and ” ” — — — — It follows that if X; is a poset and a, b X, then reciprocally, if x0 y0 then x x0 y0 y so x y — — — — — def h »i 2 – We have x x so [x] [y] – [a; b] = x X a x b — ” —” ” – If [x] [y] and [y] [x] then x y y x so x y proving that def f 2 j » » g [x] =[” —y”] ” ” —” ” — ^ — ” – [a; b[ = x X a x < b ” ” f 2 j » g – If [x] [y] and [y] [z] then x y y z whence x z by def ” —” ” ” —” ” — ^ — — – ]a; b] = x X a < x b transitivity proving that [x] [z] ” ” def f 2 j » g —” – ]a; b[ = x X a

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 14 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 16 — ľ P. Cousot, 2005 Theorem. Let X; be a poset. The covering relation is The only partial order which is also an equiv- h »i def alence relation is equality. x

Inverse of a partial order If X; is a finite poset (i.e. X is a finite set) then h »i Theorem. The inverse of a partial order is a partial x

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 18 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 20 — ľ P. Cousot, 2005 Hasse diagram Examples of Hasse diagrams Let X; be a finite poset. Its Hasse diagram is a set of points h »i – Cover: < 0, 0 < +, 0 < , p(a) a X ? ` ` ` ` f j 2 g + < , < ` > ` ` > in the Euclidean R2 and a set of lines – Partial order: - , 0, +, ‘(a; b) a; b X a < b ? » ? ? » ? » ? » f j 2 ^ ` g , ` ? » > joining p(a) and p(b) such that: - 0 0, 0 +, 0 , 0 – if a < b then p(a) is lower than p(b) (that is the second » » » ` » > ` - + +, + coordinate of p(a) is strictly less than that of p(b)) » » > - +, – no point p(c) belongs to the line ‘(a; b) when c = a and c = b ` » ` » > 6 6 - > » >

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 21 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 23 — ľ P. Cousot, 2005

Example: ; a; b with < a, < b can be drawn Bad diagrams for this partial order: f? g ? ` ? ` as

0 < + but + lower than 0 ` line ‘(0; +) cut by `

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 22 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 24 — ľ P. Cousot, 2005 Can be intuitively extended to infinity for regular struc- tures, as shown by the following examples: – A antichain of a poset X; is a subset A X such h »i „ that x; y A :(x y) = (x = y) 8 2 » ) – A poset X; is an antichain iff X is a antichain of h »i X; h »i – Example: N; = h i

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 25 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 27 — ľ P. Cousot, 2005

Chain Example of chain and antichain – A chain of a poset X; is a subset C X such that h »i „ x; y C :(x y) (y x) 8 2 » _ » – A poset X; is a chain iff X is a chain of X; h »i h »i – Example: N; h »i

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 26 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 28 — ľ P. Cousot, 2005 Chain conditions: infinite chains Chain conditions: DCC – A poset P; has no infinite chain iff all chains in P – Aposet P; satisfies the descending chain condition h »i h »i are finite (DCC) iff any infinite sequence x x : : : xn 0 – 1 – – – : : : of elements xn of P is not strictly decreasing that is k 0 : j k : x = x 9 – 8 – k j – Example:

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 29 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 31 — ľ P. Cousot, 2005

Chain conditions: ACC Toset, Woset – A poset P; satisfies the ascending chain condition – A poset P; is total whenever any two elements are h »i h »i (ACC) iff any infinite sequence x x : : : xn comparable: 0 » 1 » » » : : : of elements xn of P is not strictly increasing that is k 0 : j k : x = x x; y P :(x y) (y x) 9 – 8 – k j 8 2 » _ » – Example: – A toset P; is a poset such that is total h »i » – A woset P; is a toset satisfying DCC h »i – Examples and counter-examples: - If X is a set with at least two different elements then }(X); h „i is not a toset (since not all are comparable) - N; is a woset h »i - Z; is a toset but not a woset h »i Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 30 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 32 — ľ P. Cousot, 2005 Minimum and maximum – If P; is a poset and x P then the downset of x Note the difference with h »i 2 is x def= y P y x – the minimum min(X) of X, if any: # f 2 j » g – A tree is a poset T; such that for all x T , min(X) X x X : min(X) x h »i 2 2 ^ 8 2 » x; is a woset h# »i – the maximum max(X) of X, if any: – Example: max(X) X x X : x max(X) 2 ^ 8 2 »

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 33 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 35 — ľ P. Cousot, 2005

Minimal and maximal elements of a poset Top and bottom elements of a poset, if any – Let X be a subset of a poset P; A poset P; has h »i h »i – The minimal elements of X are – a top /supremum/maximum iff def > MIN(X) = m X ( x X : x < m) P x P : x f 2 j: 9 2 g >2 ^ 8 2 » > – The maximal elements of X are def MAX(X) = M X ( x X : M < x) – a bottom element/infimumminimum iff f 2 j: 9 2 g ? – Example : let N; be the poset of natural numbers with the P x P : x h »i ?2 ^ 8 2 ? » natural ordering : » - MIN(N) = 0 f g - MAX(N) = – By antisymmetry, the top and bottom elements are ; unique, if any

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 34 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 36 — ľ P. Cousot, 2005 Absence of infinite chains in posets satisfying the ACC and DCC

Theorem. A poset P; has no infinite chain iff it h »i satisfies both ACC and DCC – The bottom element of !; is 0. There is no top. Proof. Clearly if P does not satisfies the ACC and DCC then P has either an h »i infinite strictly inceasing chain of a strict decreasing chain. By contraposition, – The bottom element of ! +1; is 0. The top is !. a poset without infinite chain satisfies both ACC and DCC. h »i Conversely, let P; satisfying bothh ACC and DCC. Assume by re- h »i dution ad absurdum, that *P* contains an infinite chain C: x;y C : x = y = (x

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 37 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 39 — ľ P. Cousot, 2005

Ascending chain condition (ACC) revisited Let x1 be the greatest element of C, let x2 be the greatest element of C x1 , ..., xn be the greatest element of C x1;:::;xn 1 ; Then x1 > x n> f xg > ::: > x > ::: is an infinite decreasing,n f covering` g chain in P`, Theorem. A poset P; satisfies the ACC iff every 2 ` 3 ` ` n ` h »i in contardiction withh DCC. non-empty subset X of P has a maximal element. ut Proof. We prove by contradiction that P; does not satisfies the ACC iff h »i evry non-empty subset X of P has no maximal element.

– Assume x0 < x1 <::: x , provingf that weg„ 9 n=1 n+1 n can construct x0 < ::: < xn < xn+1. In this way, we can construct an infinite strictly increasing chain x0

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 41 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 43 — ľ P. Cousot, 2005

Dual statement Example 1 of dual statement

– To each statement ˘ about a poset P; corre- If they exist, the bottom of a poset is less than » h »i sponds a dual statement ˘ about the dual P; or equal to the top – h –i – Examples: dual ;

Statement ˘» Dual statement ˘– If they exist, the top of a poset is greater than x y x y or equal to the bottom xy– is the bottom is the top ? MAX(X) >MIN(X) min max ......

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 42 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 44 — ľ P. Cousot, 2005 Example 2 of dual statement – Example:

Theorem. The top element of a poset, if any, is unique.

Proof. Let P and 0 P be two top elements of a poset P; . So > 2 > 2 h »i x P : x and y P : y 0. In particular for x = 0 and y = we 8 2 » > 8 2 »> > > get 0 and 0 whence = 0 by antisymetry. > »> >»> > > ut – Notations (X P , x P ): Theorem. The bottom element of a poset, if any, is „ 2 def unique. X = y P x X : y x # def f 2 j 9 2 » g Proof. By duality. x = x ut # #f g X def= y P x X : y x " f 2 j 9 2 – g x def= x " "f g Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 45 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 47 — ľ P. Cousot, 2005

Upset, downset – Let P; be a poset, x; y P . The following are h »i 2 equivalent: – Let P; be a poset h »i – D P is a down-set (or decreasing set or order- x y „ » or ideal) iff x y () #X „# (P ) : y X = x X x D : y P :(y x) = (y D) () 8 2I 2 ) 2 8 2 8 2 » ) 2 – X is a downset of P; if and only if P X is an h »i n upset of P; – Dually, U P is a up-set (or increasing set or order- h »i „ filter or filter) iff x U : y P :(y x) = (y U) 8 2 8 2 – ) 2

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 46 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 48 — ľ P. Cousot, 2005 The poset of all downsets of a poset – Example: – The set (P ) of all downsets of a poset P; is a I h »i poset (P ); hI „i – Example:

– A subset X of a poset P; is directed iff for any h »i finite subset X0 of X there exists z X such that x X : x z. 2 8 2 0 » Proof. By induction on the X0 of X0. j j ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 49 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 51 — ľ P. Cousot, 2005

Directed set – A subset X of a poset P; is directed if and only if – Let P; be a poset h »i h »i – M P is an upper bound of S P if and only if x; y X : z X : x z y z 2 „ 8 2 9 2 » ^ » x S : x M. 8 2 » – Dually, m P is a lower bound of S P if and only 2 „ if x S : m x. 8 2 » – Note: it is not required that M S or m S as for 2 2 the maximum and minimum

– If X is directed on P; then X; is also called a h »i h »i directed order.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 50 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 52 — ľ P. Cousot, 2005 – S is said to be bounded above (by M) or, respectively, – The dual notion is that of greatest lower bound of X bounded below (by m) (glbX, infX, V X, d X, ...) – Su def= M P x S : x M – Example: def f 2 j 8 2 » g S‘ = m P x S : m x f 2 j 8 2 » g – Example:

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 53 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 55 — ľ P. Cousot, 2005

(Move S right in the above picture). Least upper/greatest lower bound t – Let P; be a poset and X P h »i „ – The least upper bound of X, if any, is x such that: - x is an upper bound of X (i.e. y X : x y) 8 2 – - x is the least of the upper bounds of X (i.e. u P : 8 2 ( y X : u y) = (x u)) 8 2 – ) » – Notation: if the least upper bound of X exists, it is denoted lubX, supX, W X, F X, ... def def – G f(x) = G f(x) x ´ , a b = a; b f j 2 g t Ff g x ´ 2

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 54 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 56 — ľ P. Cousot, 2005 Uniqueness of the lub/glb If S‘ Su P and both S‘ and Su exist in P; „ „ t t h vi the pS‘ ľSu. Theorem. Let P; be a poset and X P . If X Proof. v: F By def. of Su: x Su : x Su. Since S‘ Su, x S‘ : x Su, h »i „ so by definition of thet lub8 of2S , S vt S . „ 8 2 vt exists, then it is unique. ‘ t ‘ „t u ut Proof. If S Su P and both S and Su exist in P; Assume F X exists and X has another lub z. We have ‘ „ „ u ‘ u h vi – x X : x z since z is an upper bound of X the S‘ Su. 8 2 » u wu – z :( x X : x z)= X z by def. lub so X z Proof. By duality. 8 8 2 » ) F » F » ut – x X : x X since X is an upper bound of X so z X since z 8 2 » F F » F is the least upper bound of X – So z = F X by antisymmetry ut Theorem. Let P; be a poset and X P . If d X h »i „ exists, then it is unique. Proof. By duality. ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 57 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 59 — ľ P. Cousot, 2005

The /meet of -comparable subsets of a Lub and glb properties „ Theorem. Let P; be a poset. The has poset h »i ; a lub in P if and only if P has a bottom (in which t; – Let P; be a poset and S‘ Su P be two subsets case = ). h »i „ „ t; ? of P Proof. – x :(x ) holds vacuously 8 2 ; » t; – z P :( x : x z)= ( z) – The join (and by duality) of meet of S‘ or Su may 8 2 8 2 ; » ) t; » z P : tt = ( z) exist, while the other does’nt: () 8 2 ) t; » z P :( z) () 8 2 t; » = is the infimum of P; () t; ? h »i ut Theorem. Let P; be a poset. The empty set has h »i ; a glb in P if and only if P has a supremum (in which u; case = . u; > Proof. By duality. Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 58 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 60 — ľ P. Cousot, 2005ut Theorem. Let P; be a poset. Then P exists in The predicate ordering h »i t P if and only if P has a supremum , in which case > – A subset X }(S) is characterized by the character- P = . 2 t > istic Proof. If P exixts then x P : x P and P P so P = is the t 8 2 » t t 2 t > supremum of P; . h »i ut f S B X 2 7! Theorem. Let P; be a poset. Then P exists in P def h »i u fX(x) = ( x X ? tt : ¸) = (x X) if and only if P has a infimum , in which case P = . 2 2 ? u ?

Proof. By duality. – If we define f g iff x S : f(x) = g(x) then ut » 8 2 ) X Y f f „ () X » Y

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 61 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 63 — ľ P. Cousot, 2005

The subset ordering So, by : – S B; is a poset – Let S be a set h 7! »i – –x . ¸ is the infimum – }(S); is a poset h „i – –x . tt is the supremum – is the infimum ; – If F (S B) then – S is the supremum „ 7! . - lub F = –x Wf F f(x) – if X }(S) then lub X = X . 2 „ [ - glb F = –x Vf F f(x) – if X }(S) then glb X = X 2 „ \ where / is the lub/glb in the poset B; with or- _ ^ h »i dering (i.e. B; = ). h )i

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 62 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 64 — ľ P. Cousot, 2005 Lattice – A lattice P; ; ; is both a join semi lattice P; ; h » t ui h » ti and a meet semi lattice P; ; . h » ui Lattices – Examples

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 65 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 67 — ľ P. Cousot, 2005

Join/meet semi-lattice Characterization of the partial order of a join/meet semi-lattice – A join semi lattice P; ; is a poset P; such h » ti h »i that any two elements x; y P have a least upper Theorem. In a join semi-lattice P; ; we have (for 2 h » ti bound x y. all a; b P ): t 2 – Dually, a meet semi lattice P; ; is a poset P; h » ui h »i a b a b = b such that any two elements x; y P have a greatest » () t 2 lower bound x y. u Proof. – If a b then b a and b b by reflexivity so b is an upper bound » – – of a; b . Let c be another upper bound of a; b so that a c and b c provingf gb to be the least upper bound of a;f b thatg is a b =» b. » f g t – Reciprocally, if a; b P the a b exists in a join semi-lattive. If a b = b 2 t t then b = a b a by def. of lubs. t – ut Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 66 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 68 — ľ P. Cousot, 2005 – By duality, a b a = a b in a meet semi-lattice Proof. – (a b) is an upper bound of a; b , (a b) c is an upper bound of – () u a; b and ct whence of a; b; c whencef ofg a; bt c tproving that (a b) c f g f g f g f t g t t » – In a lattice, a b a b = b a = a b a (b c). The inverse is proved in the same way and we conclude by » () t () u antisymmetry.t t – a b and b a are upper bounds of a; b = b; a and being the lub, t t f g f g a b b a and b a a b so a b = b a by antisymmetry t » t t » t t t – a is an upper bound of a = a; a , whence the least, proving that a a = a f g f g t – a a x by def. glb. a a b so a is a lower bound of a; a b whence » u » t f t g a (a b) a proving a = a (a b) by antisymmetry. u t » t t ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 69 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 71 — ľ P. Cousot, 2005

Algebraic properties of Algebraic definition of a semi-lattice join/meet semi-lattices and lattices Theorem. Let L be a set with a binary In a join semi-lattice P; ; , we have t h » ti such that: – (a b) c = a (b c) associativity t t t t – (a b) c = a (b c) associativity – a b = b a commutativity t t t t t t – a b = b a commutativity – a a = a t t t – a a = a idempotence In a lattice P; ; ; , we have as well: t def h » t ui Define a b = a b = b. Then P; ; is a join – a (a b) = a absorption » t h » ti u t semi-lattice. – as well as the dual identities A dual result holds for meet semi-lattices.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 70 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 72 — ľ P. Cousot, 2005 Proof. – a a since a a = a, so is reflexive Proof. def » t » – We know that P; 1; is a join semi lattice, with a 1 b = – a b b a implies a b = b and b a = a so a = a b = b a = b by h » ti » def » ^ » t t t t a b = b and dually that P; 2; is a meet semi lattice, with a 1 b = commutativity, proving to be antisymmetric t h » ui » » a b = a. – a b b c implies a b = b and b c = c so a c = a (b c) = u » ^ » t t t t t – If a 1 b then a b = b so a = a (a b)= a b proving a 2 b. Reciprocally, (a b) c = b c = c proving a c so that is transitive if a » b then at= a b so b = bu (bt a)= bu (a b)= b »a = a b proving t t t » » »2 u t u t u t t – We have a (a b)=(a a) b) = a b so a a b. b (a b) = that a b. We conclude that = which we now write . t t t t t » t t t 1 1 2 b (b a)=(b b) a = b a = a b proving b (a b) so that (a b) is » » » » t t t t t t » t t – Because P; ; is a join semi-lattice, any two elements have a lub a b an upper bound of a; b . h » ti t f g – Because P; ; is a meet semi-lattice, any two elements have a glb a b – Let x be another upper bound of a; b so a x and b x. We have h » ui u f g » » – We conclude that P; ; ; is a lattice in the order-theoretic sense. a x = x and b x = x so a (b x) = x hence (a b) x = x proving h » t ui t t t t t t a b x ut t » – If follows that a b = lub( a; b ). t f g ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 73 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 75 — ľ P. Cousot, 2005

Algebraic definition of a lattice Equivalence of the order-theoretic and algebraic definition of a lattice Theorem. Let P; ; be a set equipped with binary h t ui operators such that P; is a join semi-lattice and We have shown the equivalence of the following two def- h ti def P; is a meet semi-lattice, and the absorption laws initions (where a b = a b = b or equivalently a b h ui def » t » do hold: = a b = a): u – a (a b) = a absorption – Order-theoretic definition: u t – a (a b) = a A lattice is a poset P; such that any two t u h »i Then a b = b if and only if a b = a and so P; ; ; elements a; b P have a lub a b and a glb t u h » t ui 2 t is a lattice, with (a b) def= (a b = b). a b. » t u

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 74 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 76 — ľ P. Cousot, 2005 – Algebraic definition: – Counter-examples: A lattice is a set P equipped with two binary operators (join) and (meet) satisfying 3: t u - (a b) c = a (b c) associativity t t t t - (a b) c = a (b c) u u u u - a b = b a commutativity t t - a b = b a u u - a a = a idempotence t - a a = a u - a (a b)= a absorption u t - a (a b)= a t u

3 Note that these laws extend to finite sets (but not to infinite ones).

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 77 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 79 — ľ P. Cousot, 2005

Sublattices – Let L; ; ; be a lattice. S L is a sublattice of h » t ui „ L if and only if x; y S : x y S s y S 8 2 t 2 ^ u 2 CPOs and Complete Lattices

– Examples:

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 78 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 80 — ľ P. Cousot, 2005 Infinite meet and join may be missing in a lattice – Examples: On the left is represented the (infinite) Hasse diagram of the lattice Z; ; min; max equipped with h » i def a b = c N : a + c = b natural ordering » def 9 2 min(a; b) = ( a b ? a : b) glb def » max(a; b) = ( a b ? b : a) lub » Any finite subset has a lub and a glb. However the infinite subsets – x x n have no lub f j – g – x x n have no glb f j » g – Z has neither lub nor glb

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 81 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 83 — ľ P. Cousot, 2005

(Pointed) (cpo, pcpo) – A complete partial order (cpo) P; ; is a poset A complete lattice is a poset P; such that any subset h v ti h vi P; such that any increasing chain of P has a lub X P has a lub X in P . h vi „ t in P Examples: – An !-cpo P; ; is a poset P; such that any h v ti h vi – }(S); ; ; is a complete lattice increasing !-chain 4 of P has a lub in P h „ [ \i – On the left is represented the complete lattice – A pointed cpo (pcpo) P; ; ; is a cpo P; ; Z ; + ; ; min; max with the following ex- h v ? ti h v ti h [ f`1 1g » i which has a bottom tension of , min and max: ? » The definition using directed chains instead of increasing –

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 82 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 84 — ľ P. Cousot, 2005 Bottom and top of a complete lattice A complete lattice has both lubs and glbs – A complete lattice P; ; has an infimum = Theorem. Let P; ; ; ; be a complete where h v ti ? t; h v ? > ti t – A complete lattice P; ; has an supremum = is the lub. Then the glb is: h v ti ? P def t X = y x X : y x – Examples: u tf j 8 2 v g - In }(S); ; ; the infimum is and the supre- h „ [ \i ; Proof. – Since P has a bottom , the set y x X : y x contains mum is S, written }(S); ; ; S; ; ? f j8 2 v g ? h „ ; [ \i whence is not empty - In Z ; + ; ; min; max the infimum is – Any element of X P is an upper bound of y x X : y x so is h [ f`1 1g » i `1 „ f j 8 2 v g and the supremum is + , written greater than or equal to the least upper bound: Z 1 x X : y x X : y x x ; + ; ; + ; ; min; max 8 2 tf j8 2 v gv h [ f`1 1g `1 1 » i x X : X x 8 2 u v proving that X is a lower bound of X. u Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 85 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 87 — ľ P. Cousot, 2005

A complete lattice is not empty – Let z be any lower bound of X: x X : z x – It follows that a complete lattice is never empty 8 2 v so z y x X : y x that is z X proving that q X is the 2 f j 8 2 v g v u u – Example: greatest lower bound of X - The smallest lattice is ut ; =; ; ; –X . ; –X . hf›g › › › ›i By duality, a complete lattice can be defined as a poset P; such that any subset X P has a glb X in h vi „ u P .

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 86 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 88 — ľ P. Cousot, 2005 Finite lattices are complete Example For Z ; + ; ; ; + ; min; max , Theorem. h [ f`1 1g » `1 1 i Finite lattices are complete. we get the complete lattice of intervals: Proof. Let L; ; ; be a finite lattice. Let S L be a subset of L. h v t ui „ if S has one element x then S = x = x . Assume by induction hy- 0 t tf 0g 0 pothesis that x0;:::;xn 1 does exists and S = x0;:::;xn . Then S = x ;:::;x tfx which exists` g in L. So by recurrencef X existsg for allt finite tf 0 ngt n t non-empty subsets of L which, being finite, has no other subsets than the empty set. But L is finite so L = x ;:::;x and x ::: x is the infimum f 0 ng 0 u u n of L. So = also exists. The existence of all lubs implies that L; ; ?; ; ; t;is a complete? lattice. h v ? > t ui ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 89 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 91 — ľ P. Cousot, 2005

Example: the complete lattice of intervals Equivalent definition of a complete lattice

Given a complete lattice L; ; ; ; ; , the lattice Theorem. Let P; be a non-empty poset. Then the h v ? > t ui h vi (L) of intervals over L is followin are equivalent I def – (L) = [a; b] a; b L a b I f?g[f j 2 ^ v g (i) P is a complete lattice P; ; ; ; ; – The ordering is [a; b] [c; d] provided a c h v ? > t ui ?v?v v v (ii) P has a top element, and X exists in P for every and c d u v non-empty subset X P – The lub is X = X = X and [a; b] [c; d] def= „ ?t t ? t [a c; b d] Proof. u t def – (i) = (ii) since = P = and X exists in P for every – The glb is X = X = and [a; b] [c; d] = non-empty subset) X P > t u; u ?u u ? ? t „ let m = a c; M = b d in ( m M ? [m; M] : ) – If X exists in P for every non-empty subset X P the X exists for t u v ? everyu subset X of P which has an upper bound u in„ P : t – The infimum is while the supremum is [ ; ] - Let U = y P x X : x y ? ? > f 2 j8 2 v g Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 90 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 92 — ľ P. Cousot, 2005 - U is not empty since u U so U exists in P being a non-empty subset So m = F for some finite F X. Let x X, then (F x ) Y 2 u U P and m =t F (F x ) „m since m is2 maximal intY proving[ f g 2 that „ t v t [ f g „ - x X : y U : x y m = F = (F x ) by antisymmetry. We have x m by def. lub 8 2 8 2 v t t [ f g „ = x X : x U by def. glb proving that m is an upper bound of X. =)8U is2 an uppervu bound of X Let u be any other upper bound of X. Then u is an upper bound of ) - Let u be any other upper bound of X. We have x X : x u so u U F X and hence m = F u proving that m is the lub pf X, that is 8 2 v 2 „ t v so U u proving U to be the lub of X. X = m = F . u v u t t – Since P has a top, every subset X of P has an upper bound in P and so – It L has a bottom and satisfies ACC, the X exists for every non-empty t > subset X L, so L is complete (we proved the dual). X = y P x X : x y „ t uf 2 j8 2 v g – If L has no infinite chains, it has a bottom and ACC. is the lub in P ut ut

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 93 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 95 — ľ P. Cousot, 2005

ACC and lattice completeness Theorem. Let L; ; ; be a lattice. h v t ui – If L has a bottom and satisfies the ACC then it is a complete lattice Boolean – If L has no infinite chains then it is a complete lattice

Proof. – Let us first prove that if L satisfies ACC then for every non-empty subset X of P , there exists a finite subset F of X such that X = F . t t Since F exists for all finite subset of L, we can define t Y def= F F is a finite non-empty subset of X ft j g X is non-empty so Y is non-empty and, being included in L, it satisfies the ascending chain condition, whence has a maximal element m.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 94 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 96 — ľ P. Cousot, 2005 Distributive and modular inequalities in a lattice Equivalence of distributive equalities in a lattice

Theorem. The following inequalities hold in any lattice Theorem. The following equalities are equivalent in a L; ; ; : lattice L; ; ; : h » _ ^i h » _ ^i (i) (x y) (x z) x (y z) (i) (x y) (x z) = x (y z) ^ _ ^ » ^ _ ^ _ ^ _ ^ (ii) x (y z) (x y) (x z) (ii) (x y) (x z) = x (y z) _ ^ » _ ^ _ _ ^ _ ^ _ (iii) (x y) (y z) (z x) (x y) (y z) (z x) (iii) (x y) z x (y z) ^ _ ^ _ ^ » _ ^ _ ^ _ _ ^ » _ ^ distributive inequalities (iv) (x y) (x z) x (y (x z)) ^ _ ^ » ^ _ ^ modular inequalities

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 97 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 99 — ľ P. Cousot, 2005

Proof. – (iv) Proof. – Assume (i), with x = a b, y = a, z = c, we get _ x y x def. glb (a) ((a b) a) (a b c)=(a b) (a c) (a) ^ » H I _ ^ _ _ ^ _ _ ^ H I x z x def. glb (b) a ((a b) c)=(a b) (a c) since a =(a b) a (b) ^ » H I _ _ ^ _ _ ^ H _ ^ I (x y) (x z) x (a), (b), def. lub (c) (c a) (c b)= c (a b) by (i) with x = c, y = a, z = b (c) ^ _ ^ » H I ^ _ ^ _ ^ H I x y y def. glb (d) (a b) (a c)= a (a c) (b c) (b), (c), commutativity (d) ^ » H I _ ^ _ _ ^ _ ^ H I y y (x z) def. glb (e) (a b) (a c)= a (b c) since a (a c)= a, proving (ii) » _ ^ H I _ ^ _ _ ^ H _ ^ I (x z) y (x z) def. lub (f) – By duality, (ii) = (i) ^ » _ ^ H I ) (x y) (x z) y (x z) (d), (e), (f), transitivity, def. lub (g) – Assume (ii) holds in L. Then ^ _ ^ » _ ^ H I (x y) (x z) x (y (x z)) (c), (g), def. lub Q.E.D. x (y z)=(x y) (x z) (x y) z ^ _ ^ » ^ _ ^ H I _ ^ _ ^ _ – _ ^ since x z z thus proving (iii) – The proof of the distributive inequalities (i), (ii) and (ii) is similar. _ – – Conversely, assuming (iii) with x = a, y = b, z = a c in (iii), we get ut _ (a b) (a c) a (b (a c)) (a) _ ^ _ » _ ^ _ H I (a b) (a c) a ((a c) b) commutativity (b) _ ^ _ » _ _ ^ H I Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 98 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 100 — ľ P. Cousot, 2005 (a c) b a (c b) by (iii) with x = a, y = c, z = b (c) _ ^ » _ ^ H I – The dual of a is distributive (since a ((a c) b) a (c b) (c) and def. lub (d) _ _ ^ » _ ^ H I (ii) is the dual of (i)). a ((a c) b) a (c b) (d), associativity, (a a)= a (e) _ _ ^ » _ ^ H _ I – Counter-examples: (a b) (a c) a (b c) (b), (e), transitivity (f) _ ^ _ – _ ^ H I (a b) (a c) a (b c) as proved earlier in any lattice (g) _ ^ _ – _ ^ H I (a b) (a c)= a (b c) (f), (g), commutativity, antisymmetry, _ ^ _ _ ^ proving (ii) H I ut

(Even more precisely, a lattice is distributive, if and only if it has no sublattice isomorphic to one of the lattices 5 N5 or M3 )

5 See G. Grätzer, “Lattice theory, first concepts and distributive lattices”, Freeman Pub. Co., 1971, Th. 1, p. 70.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 101 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 103 — ľ P. Cousot, 2005

Distributive lattice (Semi)-infinitely distributive lattice – A lattice L; ; ; is distributive if and only if one A lattice L; ; ; is semi-infinitely distributive if h » _ ^i h » _ ^i of the following equivalent conditions is satisfied: and only if it satisfies either of the following conditions (i) (x y) (x z) = x (y z) (where when the lefthand side of the equation exists, ^ _ ^ _ ^ () (ii) (x y) (x z) = x (y z) then so does the righth and side, and then they are equal, _ ^ _ ^ _ () S L and x L): (iii) (x y) z x (y z) „ 2 _ ^ » _ ^ – Examples x (_ S) = _ (x s) Infinite meet distributivity ^ ^ - }(S); ; ; is a distributive lattice s S h „ [ \i 2 - Any chain is a distributive lattice x (^ S) = ^ (x s) Infinite join distributivity _ _ s S 2

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 102 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 104 — ľ P. Cousot, 2005 A lattice L; ; ; is infinitely distributive if and The dual of (1) is h » _ ^i only if it satisfies both conditions. _ ^ a¸˛ = ^ _ a (2) Examples: ¸‚(¸) ¸ A ˛ B¸ ‚ ` ¸ A – }(S); ; ; is infinitely distributive 2 2 2 2 h „ [ \i – A complete lattice is meet completely distributive iff – any chain is infinitely distributive it satisfies (1) – any finite distributive lattice is infinitely distribu- – A complete lattice is join completely distributive iff it tive satisfies (2) – A complete lattice is completely distributive iff it sat- isfies both (1) and (2) – Example: - }(S); ; ; S; ; is completely distributive h „ ; [ \i Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 105 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 107 — ľ P. Cousot, 2005

Completely distributive lattice By recurrence, we get: Let P; ; ; be a poset with infimum and supre- n h » ? >i ? r j n1 nr mum . ^ _ ajk = _ : : : _ (a1j : : : arj ) > 1 ^ ^ r We say that a P has a complement b in P iff j=1 k=1 j1=1 jr=1 2 which, by defining a b = and ^ ? – A = 1;:::;r a b = f g _ > 6 – B = 1;:::;n , ..., Br = 1;:::;nr In general the complement may not be unique : 1 f 1g f g – ` = ‚ j A : ‚(j) B f j8 2 2 jg can be rewritten as:

^ _ a¸˛ = _ ^ a¸‚(¸) (1) ¸ A ˛ B¸ ‚ ` ¸ A 2 2 2 2 6 Note that a has complements b1 and b2 while b1 and b2 have a unique complement a.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 106 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 108 — ľ P. Cousot, 2005 In general the complement may not exist at all: De Morgan identities Theorem. In a distributive lattice L; ; 0; 1; ; , h » _ ^i if a and b have complements, hence unique ones a and : b, then: : (a b) = a b :(a ^ b) = :a _:b : _ : ^:

Proof. – (a b) ( a b) = (a b ^a) ^(a: b_: b) ^ ^: _ ^ ^: In case a has a unique complement, then it is written a0, = 0 0 = 0 _ a, a, etc. – (a b) ( a b) ^ _ : _: : = (a a b) (b a b) = 1 _:1 =_: 1 ^ _: _: ^ – So (a b)=( a b) by def. complement : ^ : _: Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 109 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 111 — ľ P. Cousot, 2005

Uniqueness of the complement in distributive – The second law is the dual of the first in the dual lattice L; ; 1; 0; ; which is also distributive, whence holds by the above proofh – of the first^ _i lattices with top and bottom elements equality. Theorem. Let L; ; 0; 1; ; be a distributive lattice ut h » _ ^i with bottom 0, top 1. Then any element x of L has at most one complement. Proof. – Assume than b and b are both complement of a L 0 1 2 – b0 = b 1 0 ^ = b (a b ) 0 ^ _ 1 = (b0 a) (b0 b1) = 0 ^(b _b ) ^ _ 0 ^ 1 = b0 b1 – b = ^b b , as above, exchanging b and b 1 0 ^ 1 0 1 – b0 = b1 by transitivity ut Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 110 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 112 — ľ P. Cousot, 2005 Bounded poset Boolean lattice A bounded poset is a poset P; which has a top – A Boolean lattice is a complemented distributive lat- h »i > and a bottom element tice ?

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 113 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 115 — ľ P. Cousot, 2005

Complemented lattice Boolean A is a bounded lattice L; ; ; – A P; ; ; ; ; ; is a Boolean h » ? h » ? > _ ^ :i ; ; in which every element x L has a complement lattice in which which , , and are also consid- > t ui 2 » ? > : in L ered as operations: - P; ; is a distributive lattice h _ def^i - x y = x y = y x y = x » _ () ^ - a = a and a = a for all a P _ ? ^ > 2 - a a = and a a = for all a P _: > ^: ? 2

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 114 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 116 — ľ P. Cousot, 2005 Boolean subalgebra – An (also called field of sets) is a Boolean subalgebra of some powerset algebra – A boolean subalgebra of P; ; ; ; ; ; is h » ? > _ ^ :i }(X); ; ; X; ; ; Q; ; ; ; ; ; h „ ; [ \ :i h » ? > _ ^ :i – 2n 2 where 2 = 0; 1 is a boolean algebra such that: 7! f g 2n 2; _ ; 0_; 1_; _ ; _ ; _ such that: - Q P h 7! » ^ _ :i „ def - , Q f _ g = x1;:::;xn 2 : f(x1;:::;xn) g(x1;:::;xn) ? >2 » def 8 2 » - a Q : a Q 0_ = –(x ;:::;x ) . 0 8 2 : 2 1 n def - Q; ; ; is a sublattice of P; ; ; _ . h » _ ^i h » _ ^i 1 = –(x1;:::;xn) 1

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 117 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 119 — ľ P. Cousot, 2005

Examples of Boolean algebras _ def _ fi = –(x1;:::;xn) . _ fi(x1;:::;xn) i ´ i ´ – 0; 1 ; ; 0; 1; ; ; with 0 0 < 1 1 and 2 2 hf g » _ ^ :i » » _ def 0 1 0 1 ^ fi = –(x1;:::;xn) . ^ fi(x1;:::;xn) _ ^ : 0 0 1 0 0 0 0 1 i ´ i ´ 2 def 2 1 1 1 1 0 1 1 0 _ f = –(x ;:::;xn) . f(x ;:::;xn) : 1 : 1 – For any set X, let A = X A then : n }(X); ; ; X; ; ; h „ ; [ \ :i is a boolean algebra (called the powerset algebra)

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 118 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 120 — ľ P. Cousot, 2005 Identities in Boolean lattices Bibliography

Theorem. Let L; ; 0; 1; ; ; be a Boolean lattice. Then: – B.A. Davey & H.A. Priestley h » _ ^ :i (i) 0 = 1 and 1 = 0 “Introduction to lattices and order” : : (ii) a L : a = a Cambridge University Press, 2nd edition, 2002, 298 p. 8 2 :: (iii) a; b L : (a b) = a b and (a b) = a b (De 8 2 : _ : ^: : ^ : _: – G. Birkhoff Morgan laws) “Lattice theory” (iv) a; b L : a b = ( a b) and a; b L : a b = ( a b) 8 2 ^ : : _: 8 2 _ def: : ^: American mathematical Society, Colloquium Publica- (v) a; b L : a b = 0 a b where a b = a b = rd 8 2 ^: () » » _ tions, Vol. 25, 3 edition, 1979, 418 p. b a b = a () ^ – G. Grätzer “General Lattice Theory” Birkhüser verlag, Basel, 2nd edition, 1998, 663 p.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 121 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 123 — ľ P. Cousot, 2005

Proof. – To prove p = q in L, it is sufficient to prove that p q = 1 and : _ p q = 0 since the complement is unique in distributive whence Boolean lattices^ – This observation makes the proof of (i), (ii) and (iii) entirely routine – Part (iv) follows from (ii) and (iii) – Part (v) is an easy exercice ut THE END

My MIT web site is http://www.mit.edu/~cousot/

The course web site is http://web.mit.edu/afs/athena.mit.edu/course/16/16.399/www/.

Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 122 — ľ P. Cousot, 2005 Course 16.399: “Abstract interpretation”, Thursday March 17th, 2005 — 124 — ľ P. Cousot, 2005