COSE312: Compilers. Lecture 14 Semantic Analysis (4)

Size: px
Start display at page:

Download "COSE312: Compilers. Lecture 14 Semantic Analysis (4)"

Transcription

1 COSE312: Compilers Lecture 14 Semantic Analysis (4) Hakjoo Oh 2017 Spring Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

2 Denotational Semantics In denotational semantics, we are interested in the mathematical meaning of a program. Compositional semantics: The meaning of an expression is defined with the meanings of its immediate subexpressions. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

3 Denotational Semantics of Expressions a n x a 1 + a 2 a 1 a 2 a 1 a 2 b true false a 1 = a 2 a 1 a 2 b b 1 b 2 c x := a skip c 1; c 2 if b c 1 c 2 while b c A[[ a ]] : State Z A[[ n ]](s) = n A[[ x ]](s) = s(x) A[[ a 1 + a 2 ]](s) = A[[ a 1 ]](s) + A[[ a 2 ]](s) A[[ a 1 a 2 ]](s) = A[[ a 1 ]](s) A[[ a 2 ]](s) A[[ a 1 a 2 ]](s) = A[[ a 1 ]](s) A[[ a 2 ]](s) B[[ b ]] : State T B[[ true ]](s) = true B[[ false ]](s) = false B[[ a 1 = a 2 ]](s) = A[[ a 1 ]](s) = A[[ a 2 ]](s) B[[ a 1 a 2 ]](s) = A[[ a 1 ]](s) A[[ a 2 ]](s) B[[ b ]](s) = B[[ b ]](s) = false B[[ b 1 b 2 ]](s) = B[[ b 1 ]](s) B[[ b 2 ]](s) Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

4 Denotational Semantics of Commands where C [ x := a ](s) = s[x A [ a ](s)] C [ skip ] = id C [ c 1 ; c 2 ] = C [ c 2 ] C [ c 1 ] C [ if b c 1 c 2 ] = cond(b [ b ], C [ c 1 ], C [ c 2 ]) C [ while b c ] = fix F { g(s) f(s) = true cond(f, g, h) = λs. h(h) f(s) = false F (g) = cond(b [ b ], g C [ c ], id) Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

5 Denotational Semantics of Loops Note that the meaning of the while loop is the mathematical object (i.e. partial function in State State) that satisfies the equation: C [ while b c ] = cond(b [ b ], C [ while b c ] C [ c ], id). We can rewrite the equation: where C [ while b c ] = F (C [ while b c ]) F (g) = cond(b [ b ], g C [ c ], id). The meaning of the while loop is defined to be the fixed point of F : C [ while b c ] = fix F where fix F denotes the least fixed point of F. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

6 Example while (x = 0) skip F fix F Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

7 Some Questions Does the least fixed point fix F exist? Is fix F unique? How to compute fix F? Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

8 Fixed Point Theory Theorem Let f : D D be a continuous function on a CPO D. Then f has a (unique) least fixed point, fix (f), and fix (f) = n 0 The denotational semantics is well-defined if State State is a CPO, and f n ( ). F : (State State) (State State) is a continuous function. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

9 Plan Complete Partial Order Continuous Functions Least Fixed Point Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

10 Partially Ordered Set Definition (Partial Order) We say a binary relation is a partial order on a set D iff is reflexive: p D. p p transitive: p, q, r D. p q q r = p r anti-symmetric: p, q D. p q q p = p = q We call such a pair (D, ) partially ordered set, or poset. Lemma If a partially ordered set (D, ) has a least element d, then d is unique. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

11 Exercise Let S be a non-empty set. Prove that (P(S), ) is a partially ordered set. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

12 Exercise Let X Y be the set of all partial functions from a set X to a set Y, and define f g iff Dom(f) Dom(g) x Dom(f). f(x) = g(x). Prove that (X Y, ) is a partially ordered set. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

13 Least Upper Bound Definition (Least Upper Bound) Let (D, ) be a partially ordered set and let Y be a subset of D. An upper bound of Y is an element d of D such that d Y. d d. An upper bound d of Y is a least upper bound if and only if d d for every upper bound d of Y. The least upper bound of Y is denoted by Y. Lemma If Y has a least upper bound d, then d is unique. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

14 Chain Definition (Chain) Let (D, ) be a poset and Y a subset of D. Y is called a chain if Y is totally ordered: Example y 1, y 2 Y.y 1 y 2 or y 2 y 1. Consider the poset (P({a, b, c}), ). Y 1 = {, {a}, {a, c}} Y 2 = {, {a}, {c}, {a, c}} Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

15 Complete Partial Order (CPO) Definition (CPO) A poset (D, ) is a CPO, if every chain Y D has Y D. Definition (Complete Lattice) A poset (D, ) is a complete lattice, if every subset Y D has Y D. Lemma If (D, ) is a CPO, then it has a least element given by =. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

16 Examples Example Let S be a non-empty set. Then, (P(S), ) is a CPO. The lub Y for Y is Y. The least element is. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

17 Examples Example The poset (X Y, ) of all partial functions from a set X to a set Y, equipped with the partial order Dom(f) Dom(g) x Dom(f). f(x) = g(x) is a CPO (but not a complete lattice). The lub of a chain Y is the partial function f with Dom(f) = f i Y Dom(f i) and { fn (x) x Dom(f f(x) = i ) for some f i Y undef otherwise The least element = λx.undef. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

18 Monotone Functions Definition (Monotone Functions) A function f : D E between posets is monotone iff d, d D. d d = f(d) f(d ). Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

19 Example Consider (P({a, b, c}), ) and (P({d, e}), ) and two functions f 1, f 2 : P({a, b, c}) P({d, e}) X {a, b, c} {a, b} {a, c} {b, c} {a} {b} {c} f 1 (X) {d, e} {d} {d, e} {d, e} {d} {d} {e} X {a, b, c} {a, b} {a, c} {b, c} {a} {b} {c} f 2 (X) {d} {d} {d} {e} {d} {e} {e} {e} Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

20 Exercise Determine which of the following functionals of are monotone: 1 F 0 (g) = g. (State State) (State State) { g1 g 2 F 1 (g) = 1 = g 2 where g g 2 otherwise 1 g 2. { 3 g(s) s(x) 0 F 2 (g) = λs. s s(x) = 0 Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

21 Properties of Monotone Functions Lemma Let (D 1, 1 ), (D 2, 2 ), and (D 3, 3 ) be CPOs. Let f : D 1 D 2 and g : D 2 D 3 be monotone functions. Then, g f : D 1 D 3 is a monotone function. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

22 Properties of Monotone Functions Lemma Let (D 1, 1 ) and (D 2, 2 ) be CPOs. Let f : D 1 D 2 be a monotone function. If Y is a chain in D 1, then f(y ) = {f(d) d Y } is a chain in D 2. Furthermore, f(y ) f( Y ). Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

23 Continuous Functions Definition (Continuous Functions) A function f : D 1 D 2 defined on posets (D 1, 1 ) and (D 2, 2 ) is continuous if it is monotone and it preserves least upper bounds of chains: f(y ) = f( Y ) for all non-empty chains Y in D 1. If f( Y ) = f(y ) holds for the empty chain (that is, = f( )), then we say that f is strict. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

24 Properties of Continuous Functions Lemma Let f : D 1 D 2 be a monotone function defined on posets (D 1, 1 ) and (D 2, 2 ) and D 1 is a finite set. Then, f is continuous. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

25 Properties of Continuous Functions Lemma Let (D 1, 1 ), (D 2, 2 ), and (D 3, 3 ) be CPOs. Let f : D 1 D 2 and g : D 2 D 3 be continuous functions. Then, g f : D 1 D 3 is a continuous function. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

26 Least Fixed Points Definition (Fixed Point) Let (D, ) be a poset. A fixed point of a function f : D D is an element d D such that f(d) = d. We write fix (f) for the least fixed point of f, if it exists, such that f(fix (f)) = fix (f) d D. f(d) = d = fix (f) d Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

27 Fixed Point Theorem Theorem (Kleene Fixed Point) Let f : D D be a continuous function on a CPO D. Then f has a least fixed point, fix (f), and where f n ( ) = fix (f) = n 0 f n ( ) { n = 0 f(f n 1 ( )) n > 0 Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

28 Proof We show the claims of the theorem by showing that n 0 f n ( ) exists and it is indeed equivalent to fix (f). First note that n 0 f n ( ) exists because f 0 ( ) f 1 ( ) f 2 ( )... is a chain. We show by induction that n N.f n ( ) f n+1 ( ): f( ) ( is the least element) f n ( ) f n+1 ( ) = f n+1 ( ) f n+2 ( ) (monotonicity of f) Now, we show that fix (f) = n 0 f n ( ) in two steps: We show that n 0 f n ( ) is a fixed point of f: f( f n ( )) = f(f n ( )) n 0 n 0 = n 0 = n 0 f n+1 ( ) f n ( ) continuity of f Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

29 Proofs We show that n 0 f n ( ) is smaller than all the other fixed points. Suppose d is a fixed point, i.e., f(d) = d. Then, f n ( ) d since n N.f n ( ) d: n 0 f 0 ( ) = d, f n ( ) d = f n+1 ( ) f(d) = d. Therefore, we conclude fix (f) = n 0 f n ( ). Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

30 Well-definedness of the Semantics The function F F (g) = cond(b [ b ], g C [ c ], id) is continuous. Lemma Let g 0 : State State, p : State T, and define F (g) = cond(p, g, g 0 ). Then, F is continuous. Lemma Let g 0 : State State, and define F (g) = g g 0. Then F is continuous. Hakjoo Oh COSE Spring, Lecture 14 May 8, / 30

AAA616: Program Analysis. Lecture 3 Denotational Semantics

AAA616: Program Analysis. Lecture 3 Denotational Semantics AAA616: Program Analysis Lecture 3 Denotational Semantics Hakjoo Oh 2018 Spring Hakjoo Oh AAA616 2018 Spring, Lecture 3 March 28, 2018 1 / 33 Denotational Semantics In denotational semantics, we are interested

More information

Lecture 2. Least Fixed Points

Lecture 2. Least Fixed Points Lecture 2 Least Fixed Points 20 Thesis All domains of computation are partial orders with a least element. All computable functions are mononotic. 21 Partially ordered sets A binary relation on a set D

More information

CS422 - Programming Language Design

CS422 - Programming Language Design 1 CS422 - Programming Language Design Denotational Semantics Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 Denotational semantics, also known as fix-point semantics,

More information

What does the partial order "mean"?

What does the partial order mean? What does the partial order "mean"? Domain theory developed by Dana Scott and Gordon Plotkin in the late '60s use partial order to represent (informally): approximates carries more information than better

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ws-1718/sv-sw/ Recap: The Denotational Approach Semantics

More information

Denotational Semantics

Denotational Semantics 5 Denotational Semantics In the operational approach, we were interested in how a program is executed. This is contrary to the denotational approach, where we are merely interested in the effect of executing

More information

CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers. 1 Complete partial orders (CPOs) 2 Least fixed points of functions

CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers. 1 Complete partial orders (CPOs) 2 Least fixed points of functions CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers We saw that the semantics of the while command are a fixed point. We also saw that intuitively, the semantics are the limit

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2017 Fall Hakjoo Oh COSE212 2017 Fall, Lecture 1 September 4, 2017 1 / 9 Inductive Definitions Inductive definition (induction)

More information

Denotational Semantics

Denotational Semantics Q Lecture Notes on Denotational Semantics Part II of the Computer Science Tripos 2010/11 Dr Marcelo Fiore Cambridge University Computer Laboratory c A. M. Pitts, G. Winskel, M. Fiore Contents Notes ii

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ss-15/sv-sw/ The Denotational Approach Denotational

More information

Denotational Semantics of Programs. : SimpleExp N.

Denotational Semantics of Programs. : SimpleExp N. Models of Computation, 2010 1 Denotational Semantics of Programs Denotational Semantics of SimpleExp We will define the denotational semantics of simple expressions using a function : SimpleExp N. Denotational

More information

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω 1 Preliminaries In this chapter we first give a summary of the basic notations, terminology and results which will be used in this thesis. The treatment here is reduced to a list of definitions. For the

More information

Formal Techniques for Software Engineering: Denotational Semantics

Formal Techniques for Software Engineering: Denotational Semantics Formal Techniques for Software Engineering: Denotational Semantics Rocco De Nicola IMT Institute for Advanced Studies, Lucca rocco.denicola@imtlucca.it May 2013 Lesson 4 R. De Nicola (IMT-Lucca) FoTSE@LMU

More information

Denotational Semantics

Denotational Semantics Q Lecture Notes on Denotational Semantics for Part II of the Computer Science Tripos Andrew M. Pitts Cambridge University Computer Laboratory c A. M. Pitts, 1997-9 First edition 1997. Revised 1998, 1999.

More information

Denotational Semantics

Denotational Semantics Q Lecture Notes on Denotational Semantics for Part II of the Computer Science Tripos Dr Andrew M. Pitts Cambridge University Computer Laboratory c A. M. Pitts, 1997-9 First edition 1997. Revised 1998,

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2018 Fall Hakjoo Oh COSE212 2018 Fall, Lecture 1 September 5, 2018 1 / 10 Inductive Definitions Inductive definition (induction)

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics Introduction to Axiomatic Semantics Meeting 9, CSCI 5535, Spring 2009 Announcements Homework 3 is out, due Mon Feb 16 No domain theory! Homework 1 is graded Feedback attached 14.2 (mean), 13 (median),

More information

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation Program Analysis and Understanding Fall 2017 Abstract Interpretation Based on lectures by David Schmidt, Alex Aiken, Tom Ball, and Cousot & Cousot What is an Abstraction? A property from some domain Blue

More information

The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders

The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders Stephen Forrest October 31, 2005 Complete Lattices Let (X, ) be a be partially ordered set, and let S X. Then S ( the meet of S ) denotes

More information

Towards a Denotational Semantics for Discrete-Event Systems

Towards a Denotational Semantics for Discrete-Event Systems Towards a Denotational Semantics for Discrete-Event Systems Eleftherios Matsikoudis University of California at Berkeley Berkeley, CA, 94720, USA ematsi@eecs. berkeley.edu Abstract This work focuses on

More information

Consistency of a Programming Logic for a Version of PCF Using Domain Theory

Consistency of a Programming Logic for a Version of PCF Using Domain Theory Consistency of a Programming Logic for a Version of PCF Using Domain Theory Andrés Sicard-Ramírez EAFIT University Logic and Computation Seminar EAFIT University 5 April, 3 May 2013 A Core Functional Programming

More information

Reading: Chapter 9.3. Carnegie Mellon

Reading: Chapter 9.3. Carnegie Mellon I II Lecture 3 Foundation of Data Flow Analysis Semi-lattice (set of values, meet operator) Transfer functions III Correctness, precision and convergence IV Meaning of Data Flow Solution Reading: Chapter

More information

COSE312: Compilers. Lecture 17 Intermediate Representation (2)

COSE312: Compilers. Lecture 17 Intermediate Representation (2) COSE312: Compilers Lecture 17 Intermediate Representation (2) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 17 May 31, 2017 1 / 19 Common Intermediate Representations Three-address code

More information

COSE312: Compilers. Lecture 2 Lexical Analysis (1)

COSE312: Compilers. Lecture 2 Lexical Analysis (1) COSE312: Compilers Lecture 2 Lexical Analysis (1) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 2 March 12, 2017 1 / 15 Lexical Analysis ex) Given a C program float match0 (char *s) /* find

More information

Appendix A. Definitions for Ordered Sets. The appendices contain all the formal definitions, propositions and proofs for

Appendix A. Definitions for Ordered Sets. The appendices contain all the formal definitions, propositions and proofs for 161 Appendix A Definitions for Ordered Sets The appendices contain all the formal definitions, propositions and proofs for developing a model of the display process based on lattices. Here we list some

More information

Goal. Partially-ordered set. Game plan 2/2/2013. Solving fixpoint equations

Goal. Partially-ordered set. Game plan 2/2/2013. Solving fixpoint equations Goal Solving fixpoint equations Many problems in programming languages can be formulated as the solution of a set of mutually recursive equations: D: set, f,g:dxd D x = f(x,y) y = g(x,y) Examples Parsing:

More information

Complete Partial Orders, PCF, and Control

Complete Partial Orders, PCF, and Control Complete Partial Orders, PCF, and Control Andrew R. Plummer TIE Report Draft January 2010 Abstract We develop the theory of directed complete partial orders and complete partial orders. We review the syntax

More information

A strongly rigid binary relation

A strongly rigid binary relation A strongly rigid binary relation Anne Fearnley 8 November 1994 Abstract A binary relation ρ on a set U is strongly rigid if every universal algebra on U such that ρ is a subuniverse of its square is trivial.

More information

06 Recursive Definition and Inductive Proof

06 Recursive Definition and Inductive Proof CAS 701 Fall 2002 06 Recursive Definition and Inductive Proof Instructor: W. M. Farmer Revised: 30 November 2002 1 What is Recursion? Recursion is a method of defining a structure or operation in terms

More information

Lecture 1: Lattice(I)

Lecture 1: Lattice(I) Discrete Mathematics (II) Spring 207 Lecture : Lattice(I) Lecturer: Yi Li Lattice is a special algebra structure. It is also a part of theoretic foundation of model theory, which formalizes the semantics

More information

arxiv: v1 [cs.pl] 19 May 2016

arxiv: v1 [cs.pl] 19 May 2016 arxiv:1605.05858v1 [cs.pl] 19 May 2016 Domain Theory: An Introduction Robert Cartwright Rice University Rebecca Parsons ThoughtWorks, Inc. Moez AbdelGawad SRTA-City Hunan University This monograph is an

More information

Semantics with Applications: Model-Based Program Analysis

Semantics with Applications: Model-Based Program Analysis Semantics with Applications: Model-Based Program Analysis c Hanne Riis Nielson c Flemming Nielson Computer Science Department, Aarhus University, Denmark (October 1996) Contents 1 Introduction 1 1.1 Side-stepping

More information

Least Fixpoints Calculationally

Least Fixpoints Calculationally Least Fixpoints Calculationally Lambert Meertens Department of Algorithmics and Architecture, CWI, Amsterdam, and Department of Computing Science, Utrecht University, The Netherlands http://www.cwi.nl/cwi/people/lambert.meertens.html

More information

SEMANTICS OF PROGRAMMING LANGUAGES Course Notes MC 308

SEMANTICS OF PROGRAMMING LANGUAGES Course Notes MC 308 University of Leicester SEMANTICS OF PROGRAMMING LANGUAGES Course Notes for MC 308 Dr. R. L. Crole Department of Mathematics and Computer Science Preface These notes are to accompany the module MC 308.

More information

Logic Michælmas 2003

Logic Michælmas 2003 Logic Michælmas 2003 ii Contents 1 Introduction 1 2 Propositional logic 3 3 Syntactic implication 5 3.0.1 Two consequences of completeness.............. 7 4 Posets and Zorn s lemma 9 5 Predicate logic

More information

Functions as Relations

Functions as Relations Functions as Relations Definition Recall that if A and B are sets, then a relation from A to B is a subset of A B. A function from A to B is a relation f from A to B with the following properties (i) The

More information

Lecture Notes: Selected Topics in Discrete Structures. Ulf Nilsson

Lecture Notes: Selected Topics in Discrete Structures. Ulf Nilsson Lecture Notes: Selected Topics in Discrete Structures Ulf Nilsson Dept of Computer and Information Science Linköping University 581 83 Linköping, Sweden ulfni@ida.liu.se 2004-03-09 Contents Chapter 1.

More information

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS 1. Cardinal number of a set The cardinal number (or simply cardinal) of a set is a generalization of the concept of the number of elements

More information

CORES OF ALEXANDROFF SPACES

CORES OF ALEXANDROFF SPACES CORES OF ALEXANDROFF SPACES XI CHEN Abstract. Following Kukie la, we show how to generalize some results from May s book [4] concerning cores of finite spaces to cores of Alexandroff spaces. It turns out

More information

Exam Practice Problems

Exam Practice Problems Math 231 Exam Practice Problems WARNING: This is not a sample test. Problems on the exams may or may not be similar to these problems. These problems are just intended to focus your study of the topics.

More information

CS611 Lecture 18 Fixed Points and CPOs

CS611 Lecture 18 Fixed Points and CPOs CS611 Lecture 18 Fixed Points and CPOs 9-18-00 Scribe: Chris Hardin, Michael Clarkson Lecturer: Andrew Myers 1 Trouble with while If we try to define C [while b do c] in the obvious manner, we get C [while

More information

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2)

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2) CVO103: Programming Languages Lecture 2 Inductive Definitions (2) Hakjoo Oh 2018 Spring Hakjoo Oh CVO103 2018 Spring, Lecture 2 March 13, 2018 1 / 20 Contents More examples of inductive definitions natural

More information

Mathematical Foundations of Logic and Functional Programming

Mathematical Foundations of Logic and Functional Programming Mathematical Foundations of Logic and Functional Programming lecture notes The aim of the course is to grasp the mathematical definition of the meaning (or, as we say, the semantics) of programs in two

More information

AAA615: Formal Methods. Lecture 2 First-Order Logic

AAA615: Formal Methods. Lecture 2 First-Order Logic AAA615: Formal Methods Lecture 2 First-Order Logic Hakjoo Oh 2017 Fall Hakjoo Oh AAA615 2017 Fall, Lecture 2 September 24, 2017 1 / 29 First-Order Logic An extension of propositional logic with predicates,

More information

Well-Ordering Principle. Axiom: Every nonempty subset of Z + has a least element. That is, if S Z + and S, then S has a smallest element.

Well-Ordering Principle. Axiom: Every nonempty subset of Z + has a least element. That is, if S Z + and S, then S has a smallest element. Well-Ordering Principle Axiom: Every nonempty subset of Z + has a least element. That is, if S Z + and S, then S has a smallest element. Well-Ordering Principle Example: Use well-ordering property to prove

More information

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology MIT 6.035 Foundations of Dataflow Analysis Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Dataflow Analysis Compile-Time Reasoning About Run-Time Values of Variables

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

1.2 Posets and Zorn s Lemma

1.2 Posets and Zorn s Lemma 1.2 Posets and Zorn s Lemma A set Σ is called partially ordered or a poset with respect to a relation if (i) (reflexivity) ( σ Σ) σ σ ; (ii) (antisymmetry) ( σ,τ Σ) σ τ σ = σ = τ ; 66 (iii) (transitivity)

More information

Concrete Domains. Gilles Kahn INRIA Sophia Antipolis Gordon D. Plotkin University of Edinburgh

Concrete Domains. Gilles Kahn INRIA Sophia Antipolis Gordon D. Plotkin University of Edinburgh Concrete Domains Gilles Kahn INRIA Sophia Antipolis Gordon D. Plotkin University of Edinburgh May 21, 1993 Abstract This paper introduces the theory of a particular kind of computation domains called concrete

More information

(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition.

(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition. Math 231 Exam Practice Problem Solutions WARNING: This is not a sample test. Problems on the exams may or may not be similar to these problems. These problems are just intended to focus your study of the

More information

Logical Connectives and Quantifiers

Logical Connectives and Quantifiers Chapter 1 Logical Connectives and Quantifiers 1.1 Logical Connectives 1.2 Quantifiers 1.3 Techniques of Proof: I 1.4 Techniques of Proof: II Theorem 1. Let f be a continuous function. If 1 f(x)dx 0, then

More information

Sets and Motivation for Boolean algebra

Sets and Motivation for Boolean algebra SET THEORY Basic concepts Notations Subset Algebra of sets The power set Ordered pairs and Cartesian product Relations on sets Types of relations and their properties Relational matrix and the graph of

More information

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9 MAT 570 REAL ANALYSIS LECTURE NOTES PROFESSOR: JOHN QUIGG SEMESTER: FALL 204 Contents. Sets 2 2. Functions 5 3. Countability 7 4. Axiom of choice 8 5. Equivalence relations 9 6. Real numbers 9 7. Extended

More information

Economics 204 Fall 2011 Problem Set 2 Suggested Solutions

Economics 204 Fall 2011 Problem Set 2 Suggested Solutions Economics 24 Fall 211 Problem Set 2 Suggested Solutions 1. Determine whether the following sets are open, closed, both or neither under the topology induced by the usual metric. (Hint: think about limit

More information

Chapter-2 Relations and Functions. Miscellaneous

Chapter-2 Relations and Functions. Miscellaneous 1 Chapter-2 Relations and Functions Miscellaneous Question 1: The relation f is defined by The relation g is defined by Show that f is a function and g is not a function. The relation f is defined as It

More information

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators. CSE 311: Foundations of Computing I Autumn 014 Practice Final: Section X YY ZZ Name: UW ID: Instructions: Closed book, closed notes, no cell phones, no calculators. You have 110 minutes to complete the

More information

1. Introduction and preliminaries

1. Introduction and preliminaries Quasigroups and Related Systems 23 (2015), 283 295 The categories of actions of a dcpo-monoid on directed complete posets Mojgan Mahmoudi and Halimeh Moghbeli-Damaneh Abstract. In this paper, some categorical

More information

Sets, Models and Proofs. I. Moerdijk and J. van Oosten Department of Mathematics Utrecht University

Sets, Models and Proofs. I. Moerdijk and J. van Oosten Department of Mathematics Utrecht University Sets, Models and Proofs I. Moerdijk and J. van Oosten Department of Mathematics Utrecht University 2000; revised, 2006 Contents 1 Sets 1 1.1 Cardinal Numbers........................ 2 1.1.1 The Continuum

More information

MATH 409 Advanced Calculus I Lecture 12: Uniform continuity. Exponential functions.

MATH 409 Advanced Calculus I Lecture 12: Uniform continuity. Exponential functions. MATH 409 Advanced Calculus I Lecture 12: Uniform continuity. Exponential functions. Uniform continuity Definition. A function f : E R defined on a set E R is called uniformly continuous on E if for every

More information

Completeness of Star-Continuity

Completeness of Star-Continuity Introduction to Kleene Algebra Lecture 5 CS786 Spring 2004 February 9, 2004 Completeness of Star-Continuity We argued in the previous lecture that the equational theory of each of the following classes

More information

DEPARTMENT OF MATHEMATICS. MA1301 Discrete Mathematics

DEPARTMENT OF MATHEMATICS. MA1301 Discrete Mathematics SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2000 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI 621 105 DEPARTMENT OF MATHEMATICS MA1301 Discrete Mathematics UNIT-I PART-A 1.Give

More information

A Logician s Toolbox

A Logician s Toolbox A Logician s Toolbox 461: An Introduction to Mathematical Logic Spring 2009 We recast/introduce notions which arise everywhere in mathematics. All proofs are left as exercises. 0 Notations from set theory

More information

Closure operators on sets and algebraic lattices

Closure operators on sets and algebraic lattices Closure operators on sets and algebraic lattices Sergiu Rudeanu University of Bucharest Romania Closure operators are abundant in mathematics; here are a few examples. Given an algebraic structure, such

More information

Introduction to Kleene Algebras

Introduction to Kleene Algebras Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1 Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0)

More information

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Spring

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Spring c Dr Oksana Shatalov, Spring 2016 1 3 FUNCTIONS 3.1 Definition and Basic Properties DEFINITION 1. Let A and B be nonempty sets. A function f from A to B is a rule that assigns to each element in the set

More information

Lecture 5: Functions : Images, Compositions, Inverses

Lecture 5: Functions : Images, Compositions, Inverses Lecture 5: Functions : Images, Compositions, Inverses 1 Functions We have all seen some form of functions in high school. For example, we have seen polynomial, exponential, logarithmic, trigonometric functions

More information

Applications of Regular Algebra to Language Theory Problems. Roland Backhouse February 2001

Applications of Regular Algebra to Language Theory Problems. Roland Backhouse February 2001 1 Applications of Regular Algebra to Language Theory Problems Roland Backhouse February 2001 Introduction 2 Examples: Path-finding problems. Membership problem for context-free languages. Error repair.

More information

An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic Languages

An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic Languages Università degli Studi di Udine Dipartimento di Matematica e Informatica Dottorato di Ricerca in Informatica Ph.D. Thesis An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic

More information

Part II. Logic and Set Theory. Year

Part II. Logic and Set Theory. Year Part II Year 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2018 60 Paper 4, Section II 16G State and prove the ǫ-recursion Theorem. [You may assume the Principle of ǫ- Induction.]

More information

An Introduction to the Theory of Lattice

An Introduction to the Theory of Lattice An Introduction to the Theory of Lattice Jinfang Wang Λy Graduate School of Science and Technology, Chiba University 1-33 Yayoi-cho, Inage-ku, Chiba 263-8522, Japan May 11, 2006 Λ Fax: 81-43-290-3663.

More information

Definition: For nonempty sets X and Y, a function, f, from X to Y is a relation that associates with each element of X exactly one element of Y.

Definition: For nonempty sets X and Y, a function, f, from X to Y is a relation that associates with each element of X exactly one element of Y. Functions Definition: A relation is a correspondence between two sets. If x and y are two elements in these sets and if a relation exists between x and y, then we say that x corresponds to y or that y

More information

Walker Ray Econ 204 Problem Set 3 Suggested Solutions August 6, 2015

Walker Ray Econ 204 Problem Set 3 Suggested Solutions August 6, 2015 Problem 1. Take any mapping f from a metric space X into a metric space Y. Prove that f is continuous if and only if f(a) f(a). (Hint: use the closed set characterization of continuity). I make use of

More information

Axioms of separation

Axioms of separation Axioms of separation These notes discuss the same topic as Sections 31, 32, 33, 34, 35, and also 7, 10 of Munkres book. Some notions (hereditarily normal, perfectly normal, collectionwise normal, monotonically

More information

Dataflow Analysis. Chapter 9, Section 9.2, 9.3, 9.4

Dataflow Analysis. Chapter 9, Section 9.2, 9.3, 9.4 Dataflow Analysis Chapter 9, Section 9.2, 9.3, 9.4 2 Dataflow Analysis Dataflow analysis is a sub area of static program analysis Used in the compiler back end for optimizations of three address code and

More information

Algebras. Larry Moss Indiana University, Bloomington. TACL 13 Summer School, Vanderbilt University

Algebras. Larry Moss Indiana University, Bloomington. TACL 13 Summer School, Vanderbilt University 1/39 Algebras Larry Moss Indiana University, Bloomington TACL 13 Summer School, Vanderbilt University 2/39 Binary trees Let T be the set which starts out as,,,, 2/39 Let T be the set which starts out as,,,,

More information

«Mathematical foundations: (6) Abstraction Part II» Exact fixpoint abstraction. Property transformer abstraction

«Mathematical foundations: (6) Abstraction Part II» Exact fixpoint abstraction. Property transformer abstraction «Mathematical foundations: (6) Abstraction Part II» Patrick Cousot Jerome C. Hunsaker Visiting Professor Massachusetts Instite of Technology Department of Aeronaics and Astronaics cousot mit edu www.mit.edu/~cousot

More information

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma. D-MATH Algebra I HS18 Prof. Rahul Pandharipande Solution 1 Arithmetic, Zorn s Lemma. 1. (a) Using the Euclidean division, determine gcd(160, 399). (b) Find m 0, n 0 Z such that gcd(160, 399) = 160m 0 +

More information

Properties of the Integers

Properties of the Integers Properties of the Integers The set of all integers is the set and the subset of Z given by Z = {, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, }, N = {0, 1, 2, 3, 4, }, is the set of nonnegative integers (also called

More information

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c. Properties of the Integers The set of all integers is the set and the subset of Z given by Z = {, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, }, N = {0, 1, 2, 3, 4, }, is the set of nonnegative integers (also called

More information

Cardinality and ordinal numbers

Cardinality and ordinal numbers Cardinality and ordinal numbers The cardinality A of a finite set A is simply the number of elements in it. When it comes to infinite sets, we no longer can speak of the number of elements in such a set.

More information

1 Initial Notation and Definitions

1 Initial Notation and Definitions Theory of Computation Pete Manolios Notes on induction Jan 21, 2016 In response to a request for more information on induction, I prepared these notes. Read them if you are interested, but this is not

More information

CMSC 631 Program Analysis and Understanding. Spring Data Flow Analysis

CMSC 631 Program Analysis and Understanding. Spring Data Flow Analysis CMSC 631 Program Analysis and Understanding Spring 2013 Data Flow Analysis Data Flow Analysis A framework for proving facts about programs Reasons about lots of little facts Little or no interaction between

More information

Class Notes on Poset Theory Johan G. Belinfante Revised 1995 May 21

Class Notes on Poset Theory Johan G. Belinfante Revised 1995 May 21 Class Notes on Poset Theory Johan G Belinfante Revised 1995 May 21 Introduction These notes were originally prepared in July 1972 as a handout for a class in modern algebra taught at the Carnegie-Mellon

More information

Group. Orders. Review. Orders: example. Subgroups. Theorem: Let x be an element of G. The order of x divides the order of G

Group. Orders. Review. Orders: example. Subgroups. Theorem: Let x be an element of G. The order of x divides the order of G Victor Adamchik Danny Sleator Great Theoretical Ideas In Computer Science Algebraic Structures: Group Theory II CS 15-251 Spring 2010 Lecture 17 Mar. 17, 2010 Carnegie Mellon University Group A group G

More information

0 Sets and Induction. Sets

0 Sets and Induction. Sets 0 Sets and Induction Sets 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 A to denote that a is an element of the set

More information

Discrete Mathematics. Spring 2017

Discrete Mathematics. Spring 2017 Discrete Mathematics Spring 2017 Previous Lecture Principle of Mathematical Induction Mathematical Induction: Rule of Inference Mathematical Induction: Conjecturing and Proving Mathematical Induction:

More information

MATH 104: INTRODUCTORY ANALYSIS SPRING 2008/09 PROBLEM SET 8 SOLUTIONS

MATH 104: INTRODUCTORY ANALYSIS SPRING 2008/09 PROBLEM SET 8 SOLUTIONS MATH 04: INTRODUCTORY ANALYSIS SPRING 008/09 PROBLEM SET 8 SOLUTIONS. Let f : R R be continuous periodic with period, i.e. f(x + ) = f(x) for all x R. Prove the following: (a) f is bounded above below

More information

Denotational semantics

Denotational semantics Denotational semantics The method define syntax (syntactic domains) define semantic domains define semantic functions use compositional definitions Andrzej Tarlecki: Semantics & Verification - 63 - Syntactic

More information

2. Isometries and Rigid Motions of the Real Line

2. Isometries and Rigid Motions of the Real Line 21 2. Isometries and Rigid Motions of the Real Line Suppose two metric spaces have different names but are essentially the same geometrically. Then we need a way of relating the two spaces. Similarly,

More information

Monoids of languages, monoids of reflexive. relations and ordered monoids. Ganna Kudryavtseva. June 22, 2010

Monoids of languages, monoids of reflexive. relations and ordered monoids. Ganna Kudryavtseva. June 22, 2010 June 22, 2010 J -trivial A monoid S is called J -trivial if the Green s relation J on it is the trivial relation, that is aj b implies a = b for any a, b S, or, equivalently all J -classes of S are one-element.

More information

Conceptual Connections of Circularity and Category Theory

Conceptual Connections of Circularity and Category Theory 1/64 Conceptual Connections of Circularity and Category Theory Larry Moss Indiana University, Bloomington ESSLLI 2012, Opole 2/64 The conceptual comparison chart Filling out the details is my goal for

More information

Abstract Interpretation (Non-Standard Semantics) a.k.a. Picking The Right Abstraction

Abstract Interpretation (Non-Standard Semantics) a.k.a. Picking The Right Abstraction #1 Abstract Interpretation (NonStandard Semantics) a.k.a. Picking The Right Abstraction Reading Quiz All answers are one to three words. Write your UVA ID in big block letters. In Reflections on Trusting

More information

Semantics of Higher-Order Functional Programming

Semantics of Higher-Order Functional Programming Semantics of Higher-Order Functional Programming Petros Barbagiannis µ λ July 14, 2014 Petros Barbagiannis Semantics of Higher-Order Functional Programming July 14, 2014 1 / 18 Introduction Higher-order

More information

Structure of R. Chapter Algebraic and Order Properties of R

Structure of R. Chapter Algebraic and Order Properties of R Chapter Structure of R We will re-assemble calculus by first making assumptions about the real numbers. All subsequent results will be rigorously derived from these assumptions. Most of the assumptions

More information

ASSIGNMENT 1 SOLUTIONS

ASSIGNMENT 1 SOLUTIONS MATH 271 ASSIGNMENT 1 SOLUTIONS 1. (a) Let S be the statement For all integers n, if n is even then 3n 11 is odd. Is S true? Give a proof or counterexample. (b) Write out the contrapositive of statement

More information

Math 455 Some notes on Cardinality and Transfinite Induction

Math 455 Some notes on Cardinality and Transfinite Induction Math 455 Some notes on Cardinality and Transfinite Induction (David Ross, UH-Manoa Dept. of Mathematics) 1 Cardinality Recall the following notions: function, relation, one-to-one, onto, on-to-one correspondence,

More information

(Pre-)Algebras for Linguistics

(Pre-)Algebras for Linguistics 1. Review of Preorders Linguistics 680: Formal Foundations Autumn 2010 (Pre-)Orders and Induced Equivalence A preorder on a set A is a binary relation ( less than or equivalent to ) on A which is reflexive

More information

arxiv: v4 [math.fa] 27 Jan 2010

arxiv: v4 [math.fa] 27 Jan 2010 σ-relations, σ-functions AND σ-antifunctions. IVAN GATICA ARAUS arxiv:0907.0820v4 [math.fa] 27 Jan 2010 Abstract. In this article we develop the concepts of σ-relation and σ-function, following the same

More information

MAD 3105 PRACTICE TEST 2 SOLUTIONS

MAD 3105 PRACTICE TEST 2 SOLUTIONS MAD 3105 PRACTICE TEST 2 SOLUTIONS 1. Let R be the relation defined below. Determine which properties, reflexive, irreflexive, symmetric, antisymmetric, transitive, the relation satisfies. Prove each answer.

More information

Mathematical Background and Basic Notations

Mathematical Background and Basic Notations University of Science and Technology of China (USTC) 09/19/2011 Outline Sets 1 Sets 2 3 4 5 Outline Sets 1 Sets 2 3 4 5 Sets Basic Notations x S membership S T subset S T proper subset S fin T finite subset

More information