Sets, POSets, and Lattice © Marcelo d’Amorim 2010.

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

CSCI 115 Chapter 6 Order Relations and Structures.
Relations Relations on a Set. Properties of Relations.
Equivalence, Order, and Inductive Proof
Foundations of Data-Flow Analysis. Basic Questions Under what circumstances is the iterative algorithm used in the data-flow analysis correct? How precise.
CSE 231 : Advanced Compilers Building Program Analyzers.
Worklist algorithm Initialize all d i to the empty set Store all nodes onto a worklist while worklist is not empty: –remove node n from worklist –apply.
Sets, Relation and Functions A set is a collection of objects (elements) or a container of objects. Defining sets –Empty set (Ø): no elements –Universal.
Administrative stuff Office hours: After class on Tuesday.
Course Outline Traditional Static Program Analysis –Theory Compiler Optimizations; Control Flow Graphs, Data-flow Analysis Data-flow Frameworks --- today’s.
San Diego October 4-7, 2006 Over 1,000 women in computing Events for undergraduates considering careers and graduate school Events for graduate students.
Recap: Reaching defns algorithm From last time: reaching defns worklist algo We want to avoid using structure of the domain outside of the flow functions.
Orderings and Bounds Parallel FSM Decomposition Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 10 Update and modified by Marek.
Partial Orderings: Selected Exercises
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Section 7.6: Partial Orderings Def: A relation R on a set S is called a partial ordering (or partial order) if it is reflexive, antisymmetric, and transitive.
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Partially Ordered Sets (POSets)
Lecture 9 Illustrations Lattices. Fixpoints Abstract Interpretation.
Relations Chapter 9.
Chapter 6. Order Relations and Structure
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
Solving fixpoint equations
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Discrete Structures – CNS2300
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
2.6 Equivalence Relation §1.Equivalence relation §Definition 2.18: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric,
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
Sets, Relations, and Lattices
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
1 Equivalence relations Binary relations: –Let S1 and S2 be two sets, and R be a (binary relation) from S1 to S2 –Not every x in S1 and y in S2 have such.
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Advanced Digital Designs Jung H. Kim. Chapter 1. Sets, Relations, and Lattices.
Semilattices presented by Niko Simonson, CSS 548, Autumn 2012 Semilattice City, © 2009 Nora Shader.
Lub and glb Given a poset (S, · ), and two elements a 2 S and b 2 S, then the: –least upper bound (lub) is an element c such that a · c, b · c, and 8 d.
Chapter 5 Relations and Operations
Partial Orderings: Selected Exercises
Chapter 6 Order Relations and Structures
Fixpoints and Reachability
CSE 2813 Discrete Structures
Unit-III Algebraic Structures
Partial Orderings CSE 2813 Discrete Structures.
Equivalence Relations
Atmiya Institute of Technology & Science
Relations and Digraphs
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
CS201: Data Structures and Discrete Mathematics I
Introductory Material
Discrete Math & Fixed points
Discrete Math (2) Haiming Chen Associate Professor, PhD
Concurrent Models of Computation
Sungho Kang Yonsei University
Mathematical Background 1
Lecture 20: Dataflow Analysis Frameworks 11 Mar 02
MCS680: Foundations Of Computer Science
Background material.
9.5 Equivalence Relations
교환 학생 프로그램 내년 1월 중순부터 6월 초 현재 학부 2,3 학년?
Background material.
Foundations of Discrete Mathematics
Introductory Material
Presentation transcript:

Sets, POSets, and Lattice © Marcelo d’Amorim 2010

SETS © Marcelo d’Amorim 2010

Set Collection of objects (elements) that carry no particular order Two ways of expression – Intentional A is the set of all odd integers – Extensional B = {2, 4, 5} – Obs. Ø is the empty set © Marcelo d’Amorim 2010

Set builder notation A = {a | a: int, a % 2 = 0} © Marcelo d’Amorim 2010 Set A includes integer elements with a 0 remainder for division by 2

Cardinality |A| denotes the number of elements in A © Marcelo d’Amorim 2010

Set relations Membership a ∈ A iff A includes a Subset A ⊂ B iff a ∈ A implies a ∈ B Superset A ⊃ B iff a ∈ B implies a ∈ A © Marcelo d’Amorim 2010

Set factories Intersection A ∩ B = {x | x ∈ A and x ∈ B} Union A U B = {x | x ∈ A or x ∈ B} Difference A - B = {x | x ∈ A and not (x ∈ B)} © Marcelo d’Amorim 2010

Power Set Def.: The set of all subsets of A Notations: P(A), 2 A Example – A={1,2,3}, 2 A ={ Ø,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3} } © Marcelo d’Amorim 2010

Cartesian Product Def.: Set of ordered pairs from two sets: the first (resp., second) component comes from the first (resp., second) set. More formally: A x B = { (a,b) | a ∈ A and b ∈ B} Notes – | A x B | = | A | x | B | – A 2 is shorthand for A x A © Marcelo d’Amorim 2010

Relation Def.: Particular subset of a cartesian product Triple (A,B,G) defines relation R – A is the relation domain and B the codomain – G is the binary relationship Example: R = (Int,Int,<=) ⊂ Int x Int = {(a,b)| a,b: Int, a <= b} Notation aRb = (a,b) ∈ R © Marcelo d’Amorim 2010

Relation properties Reflexive Symmetric Anti-symmetry Transitive © Marcelo d’Amorim 2010

Relation properties Reflexive: ∀ a. aRa Symmetric: ∀ a,b. aRb implies bRa Anti-symmetry: ∀ a,b. aRb and bRa implies a=b Transitive: ∀ a, b, c. aRb and bRc implies aRc © Marcelo d’Amorim 2010

Function Def.: Relation R s.t. aRb and aRc implies b = c Notation f : A => B Mapping – Injective: f(a) = f(b) implies a = b – Surjective: ∀ y. ∃ _. f(_) = y © Marcelo d’Amorim 2010

PARTIAL ORDERING © Marcelo d’Amorim 2010

Partial Ordering Def.: Relation ≤ : L x L => {true,false} that is reflexive, transitive, and anti-symmetric Examples? © Marcelo d’Amorim 2010

Partial Ordering Def.: Relation ≤ : L x L => {true,false} that is reflexive, transitive, and anti-symmetric Examples? – ancestor of – phenomena causality © Marcelo d’Amorim 2010 Note: Important to characterize semantics of concurrent systems!

Total order Def.: Relation that is transitive, anti-symmetric and…total Total: ∀ a, b. aRb or bRa © Marcelo d’Amorim 2010 reflexivity implied

POSETS © Marcelo d’Amorim 2010

POSET Set L with a partial ordering ≤ Notation – (L, ≤) to describe POSET – l1 ≤ l2 to describe a particular pair © Marcelo d’Amorim 2010 ≤ is not necessarily the subset relation

Upper and Lower bounds For any subset Y of a poset L – u is an upper bound of Y if ∀ a. a ≤ u – l is a lower bound of Y if ∀ a. l ≤ a © Marcelo d’Amorim 2010

Least upper bound (lub) lub is an upper bound s.t. for any other upper bound u, lub ≤ u © Marcelo d’Amorim 2010 lub, when exist, is unique

Greatest lower bound (glb) Dual of lub… © Marcelo d’Amorim 2010

Meet and Join © Marcelo d’Amorim 2010 a b d f gh c d is the meet of {a,b,c} f is the join of {g,h}

COMPLETE LATTICE © Marcelo d’Amorim 2010

Complete lattice Poset (L,≤) s.t. all subsets of L have lubs and glbs. Also, Top = lub L and Bottom = glb L © Marcelo d’Amorim 2010

Exercises Considering the following cases, answer the questions: – What is L? – What is ≤? – Is the (Hasse) diagram a lattice? © Marcelo d’Amorim 2010

Example 1 © Marcelo d’Amorim 2010

Example 2 © Marcelo d’Amorim 2010

Example 3 © Marcelo d’Amorim 2010

Dataflow analysis encodes program information as an element in the lattice. Ordering denotes precision: l 0 ≤ l 1 indicates that l 1 carries more information than l 0. Dataflow analysis encodes program information as an element in the lattice. Ordering denotes precision: l 0 ≤ l 1 indicates that l 1 carries more information than l 0.

Dataflow analysis encodes program information as an element in the lattice. Ordering denotes precision: l 0 ≤ l 1 indicates that l 1 carries more information than l 0. Dataflow analysis encodes program information as an element in the lattice. Ordering denotes precision: l 0 ≤ l 1 indicates that l 1 carries more information than l 0. © Marcelo d’Amorim 2010 Accumulation of information (i.e., progress in the analysis) conceptually corresponds to ordered movements in the lattice. But when to stop such iteractive process?

Chain A subset Y of L is a chain if the elements are totally ordered © Marcelo d’Amorim 2010

Ascending (Descending) Chain A sequence [y0,y1,y2,…] denotes an ascending chain if y0 ≤ y1 ≤ y2 ≤ … Similar for descending chains © Marcelo d’Amorim 2010

Ascending chain condition A poset satisfies ascending chain conditions iff all ascending chains stabilize © Marcelo d’Amorim ∞ … satisfies ascending chain condition, but not descending

Fix Points Consider a monotone function f : L => L © Marcelo d’Amorim 2010 if L satisfies ascending chain condition and f is monotonic increasing then exists n such that f n (Bottom)=f n+1 (Bottom)

© Marcelo d’Amorim 2010 Lattices considered in program analysis typically have finite height. For example, due to finite number of program locations and variable names.

© Marcelo d’Amorim Recommended Bibliography – Appendix A from “Principles of Program Analysis”, Nielson, Nielson and Hanking, Springer 2005 – First chapters from “Introduction to Lattices and Order”, Davey and Priestley, Cambridge Press, 1990