Concurrent Models of Computation

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

CSCI 115 Chapter 6 Order Relations and Structures.
Primitive Recursive Functions (Chapter 3)
Relations Relations on a Set. Properties of Relations.
Event structures Mauro Piccolo. Interleaving Models Trace Languages:  computation described through a non-deterministic choice between all sequential.
Equivalence, Order, and Inductive Proof
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
CS21 Decidability and Tractability
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
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.
Programming Language Semantics Denotational Semantics Chapter 5 Based on a lecture by Martin Abadi.
6th Biennial Ptolemy Miniconference Berkeley, CA May 12, 2005 Some Developments in the Tagged Signal Model Xiaojun Liu With J. Adam Cataldo, Edward A.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Programming Language Semantics Denotational Semantics Chapter 5 Part II.
Data Flow Analysis Compiler Design Nov. 3, 2005.
FSM Decomposition using Partitions on States 290N: The Unknown Component Problem Lecture 24.
A Denotational Semantics For Dataflow with Firing Edward A. Lee Jike Chong Wei Zheng Paper Discussion for.
Administrative stuff Office hours: After class on Tuesday.
Data Flow Analysis Compiler Design Nov. 8, 2005.
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
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
Partially Ordered Sets (POSets)
Sets, POSets, and Lattice © Marcelo d’Amorim 2010.
Solving fixpoint equations
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
CS201: Data Structures and Discrete Mathematics I
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
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)
1 Section 4.3 Order Relations A binary relation is an partial order if it transitive and antisymmetric. If R is a partial order over the set S, we also.
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.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Data Flow Analysis II AModel Checking and Abstract Interpretation Feb. 2, 2011.
Semilattices presented by Niko Simonson, CSS 548, Autumn 2012 Semilattice City, © 2009 Nora Shader.
Chaotic Iterations Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Iterative Dataflow Problems Taken largely from notes of Alex Aiken (UC Berkeley) and Martin Rinard (MIT) Dataflow information used in optimization Several.
Prepared By Meri Dedania (AITS) Discrete Mathematics by Meri Dedania Assistant Professor MCA department Atmiya Institute of Technology & Science Yogidham.
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.
Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation is a relation on.
Chapter 5 Relations and Operations
Partial Orderings: Selected Exercises
Chapter 6 Order Relations and Structures
Fixpoints and Reachability
Models of Definite Programs
Unit-III Algebraic Structures
Week 7 - Monday CS322.
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Copyright © Cengage Learning. All rights reserved.
Modeling Arithmetic, Computation, and Languages
Concurrent Models of Computation
Basis and Dimension Basis Dimension Vector Spaces and Linear Systems
Alternating tree Automata and Parity games
COUNTING AND PROBABILITY
Concurrent Models of Computation
CS21 Decidability and Tractability
Lecture 20: Dataflow Analysis Frameworks 11 Mar 02
Concurrent Models of Computation for Embedded Software
Formal Languages, Automata and Models of Computation
Lecture 10: Fixed Points ad Infinitum M.C. Escher, Moebius Ants
Background material.
Instructor: Aaron Roth
교환 학생 프로그램 내년 1월 중순부터 6월 초 현재 학부 2,3 학년?
Background material.
Models of Definite Programs
Presentation transcript:

Concurrent Models of Computation Edward A. Lee Robert S. Pepper Distinguished Professor, UC Berkeley EECS 219D Concurrent Models of Computation Fall 2011 Copyright © 2011, Edward A. Lee, All rights reserved Week 2: Fixed-Point Semantics

Review Sets, tuples, relations, functions, powersets Partially ordered sets Chains Well ordered sets (chains where every non-empty subset has a least element) The set T ** of all finite and infinite sequences from T Prefix order

Join (Least Upper Bound) An upper bound of a subset B  A of a poset (A, ) is an element a  A such that for all b  B we have b  a. A least upper bound (LUB) or join of B is an upper bound a such that for all other upper bounds a' we have a  a'. The join of B is written  B. When the join of B exists in A, then B is said to be joinable.

Meet (Greatest Lower Bound) A lower bound of a subset B  A of a poset (A, ) is an element a  A such that for all b  B we have a  b. A greatest lower bound (GLB) or meet of B is a lower bound a such that for all other lower bounds a' we have a'  a. The meet of B is written  B.

Example of Join and Meet Example: Given a set A and its powerset (set of all subsets) P(A), then (P(A), ) is a poset. For any B  P(A), we have  B =  B (the union of the subsets) and  B =  B (the intersection of the subsets)

Directed Sets, Bottom A non-empty subset B  A of a poset (A, ) is directed if every pair of elements in B has an upper bound in B. Equivalently, B is directed if every non-empty finite subset of B is joinable. A poset (A, ) has a bottom element if  A exists and is in A. We write it  =  A.

Complete Partial Order A complete partial order (CPO) is a partially ordered set with a bottom where every directed set is joinable. Example: Every finite poset with a bottom is a CPO. Example: (N,  ) is not a CPO. Example: (N  {},  ) is a CPO. Example: (T **, ) is a CPO. The bottom element is the empty sequence. Every directed set is chain The join of any infinite chain is an infinite sequence. Example: (T *, ) is not a CPO. T * is the set of all finite sequences.

Equivalent definition: Complete Partial Order A poset A is a CPO iff every chain has a least upper bound in A. The equivalence is nontrivial. See Davey & Priestley, theorem 8.11. The equivalence is trivial for A =T **, because every directed set in T ** is a chain.

Monotonic (Order Preserving) Functions Let (A,  ) and (B,  ) be posets. A function f : A  B is called monotonic if a  a'  f (a)  f (a' ) Example: PN actors are monotonic with the prefix order.

PN Actors are Monotonic Functions on a CPO Set of signals with the prefix order is a CPO. Actors are monotonic functions: a a'  f (a) f (a' ) This is a timeless causality condition.

Example of a Non-Monotonic but Functional Actor Unfair merge f : A  A  A where (A, ) is a poset where the period indicates concatenation. Exercise: show that this function is not monotonic under the prefix order.

Fixed Point Semantics Start with the empty sequence. type T sequence in T ** Start with the empty sequence. Apply the (monotonic) function. Apply the function again to the result. Repeat forever. The result “converges” to the least fixed point.

Fixed Point Theorem 2 Let f : A  A be a monotonic function on CPO A. Then f has a least fixed point. Take the “meaning” or “semantics” of this process network to be that the (one and only) signal in the system is the least fixed point of f .

Continuous (Limit Preserving) Functions Let (A,  ) and (B,  ) be CPOs. A function f : A  B is called continuous if for all chains C  A , Notation: Given a function f : A  B, define a new function , where for any C  A ,

Continuous vs. Monotonic Fact: Every continuous function is monotonic. Easy to show (consider chains of length 2) Fact: If every chain in A is finite, then every monotonic function f : A  B is continuous. But: If A has infinite chains, the monotonic does not imply continuous. Consider a chain $C = \{a, a'\} \subseteq A$, where $a \prefix a'$. Continuity implies that $f(\join C) = \join \hat{f}(C)$, which since $\join C = a'$ implies that $f(a') = \join \{ f(a), f(a') \}$. This means that $f(a) \prefix f(a')$, so the function is monotonic.

Counterexample Showing that Monotonic Does Not Imply Continuous Let A = (N  {},  ) (a CPO). Let f : A  A be given by This function is obviously monotonic. But it is not continuous. To see that, let C = {1, 2, 3, …}, and note that  C = . Hence, f ( C) = 2  f (C) = 1 which are not equal.

Intuition Under the prefix order, for any monotonic function that is not continuous, there is a continuous function that yields the same result for every finite input. For practical purposes, we can assume that any monotonic function is continuous, because the only exceptions will be functions that wait for infinite input before producing output.

Kleene Fixed Point Theorem Let (A,  ) be a CPO Let f : A  A be a monotonic function Let C = { f n(), n  N } If  C = f ( C), then  C is the least fixed point of f If f is continuous, then  C = f ( C) Intuition: The least fixed point of a continuous function is obtained by applying the function first to the empty sequence, then to the result, then to that result, etc.

Proof (Least Fixed Point Part) NOTE: This part does not require continuity. Let a be another fixed point: f (a) = a Show that  C is the least fixed point:  C  a Since f is monotonic:   a f ()  f (a) = a … f k()  f k(a) = a So a is an upper bound of the chain C, hence  C  a.

Proof (Continuous Part) Note that C is a chain in a CPO (show this) and hence has a LUB  C. Let C' = C  {  } and note that  C =  C'. Note further that and hence By continuity, Hence QED (  C is a fixed point of f )

Fixed Point Semantics Start with the empty sequence. type T sequence in T ** Start with the empty sequence. Apply the (continuous) function. Apply the function again to the result. Repeat forever. The result “converges” to the least fixed point.

Fixed Point Theorem 2 Let f : A  A be a monotonic function on CPO (A,  ). Then f has a least fixed point. Intuition: If a function is monotonic (but not continuous), then it has a least fixed point, but the execution procedure of starting with the empty sequence and iterating may not converge to that fixed point. This is obvious, since monotonic but not continuous means it waits forever to produce output.

Example 1: Identity Function Let A = T ** and f : A  A be such that a  A, f ( a ) = a. This is obviously continuous (and hence monotonic) under the prefix order. Then the model below has many fixed points, but only one least fixed point (the empty sequence).

Example 2: Delay Function Let A = T ** and f : A  A be such that a  A, f ( a ) = t .a (concatenation), where t  T. This is obviously continuous (and hence monotonic) under the prefix order. Then the model below has only one fixed point, the infinite sequence ( t, t, t, … ) Why is this called a “delay?”

Taking Stock: Fixed Point Semantics type T sequence in T ** Start with the empty sequence. Apply the (continuous) function. Apply the function again to the result. Repeat forever. The result “converges” to the least fixed point.

Semantics of a PN Model is the Least Fixed Point of a Monotonic Function type T sequence in T ** Chain: C = { f (), f ( f ()), … , f n(), …} Continuity: Limits

Summary Posets CPOs Fixed-point theorems Gives meaning to simple programs With composition, gives meaning to all programs Next time: expressiveness of PN (Turing computability) develop an execution policy sequential functions, stable functions, and continuous functions