Programming Language Semantics Denotational Semantics Chapter 5 Part II.

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

Knaster-Tarski fixed point theorem for complete partial order **************** contents ****************  Who are Knaster-Tarski?  What is elementary.
CSCI 115 Chapter 6 Order Relations and Structures.
Formal Semantics of Programming Languages 虞慧群 Topic 6: Advanced Issues.
Formal Semantics of Programming Languages 虞慧群 Topic 5: Axiomatic Semantics.
Tutorial on Widening (and Narrowing) Hongseok Yang Seoul National University.
Foundations of Data-Flow Analysis. Basic Questions Under what circumstances is the iterative algorithm used in the data-flow analysis correct? How precise.
Programming Language Semantics Inductive Definitions Mooly SagivEran Yahav Schrirber 317Open space
Programming Language Semantics Denotational Semantics Chapter 5.
Programming Language Semantics Axiomatic Semantics Chapter 6.
Programming Language Semantics Denotational Semantics Chapter 5 Based on a lecture by Martin Abadi.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Discrete Mathematics Lecture 4 Harper Langston New York University.
1 Iterative Program Analysis Part I Mooly Sagiv Tel Aviv University Textbook: Principles of Program.
FSM Decomposition using Partitions on States 290N: The Unknown Component Problem Lecture 24.
1 Iterative Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Abstract Interpretation Part I Mooly Sagiv Textbook: Chapter 4.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Prof. Aiken CS 294 Lecture 21 Abstract Interpretation Part 2.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Lecture 4 Discrete Mathematics Harper Langston. Algorithms Algorithm is step-by-step method for performing some action Cost of statements execution –Simple.
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
Claus Brabrand, ITU, Denmark DATA-FLOW ANALYSISMar 25, 2009 Static Analysis: Data-Flow Analysis II Claus Brabrand IT University of Copenhagen (
Claus Brabrand, UFPE, Brazil Aug 09, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
1 Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Abstract Interpretation (Cousot, Cousot 1977) also known as Data-Flow Analysis.
Solving fixpoint equations
Program Analysis and Verification Noam Rinetzky Lecture 6: Abstract Interpretation 1 Slides credit: Roman Manevich, Mooly Sagiv, Eran Yahav.
Program Analysis and Verification
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Formal Semantics of Programming Languages 虞慧群 Topic 3: Principles of Induction.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 9: Abstract Interpretation I Roman Manevich Ben-Gurion University.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
Relations, Functions, and Countability
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
1 IS 2150 / TEL 2810 Introduction to Security James Joshi Associate Professor, SIS Lecture 3 September 15, 2009 Mathematical Review Security Policies.
Mathematical Preliminaries
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Problem Statement How do we represent relationship between two related elements ?
Chapter Relations and Their Properties
Sequence Control Syntax and Semantics Jian Xu March 3, 2004 CS706, CAS McMaster.
Program Analysis and Verification
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.
Formal Semantics of Programming Languages 虞慧群 Topic 2: Operational Semantics.
Data Flow Analysis II AModel Checking and Abstract Interpretation Feb. 2, 2011.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
1 Iterative Program Analysis Part II Mathematical Background Mooly Sagiv Tel Aviv University
Chaotic Iterations Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Chaotic Iterations Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Chapter 5 Relations and Operations
Fixpoints and Reachability
Discrete Mathematics Lecture 7
IS 2150 / TEL 2810 Information Security & Privacy
Program Analysis and Verification
Discrete Math & Fixed points
Discrete Math (2) Haiming Chen Associate Professor, PhD
Concurrent Models of Computation
Sungho Kang Yonsei University
IS 2150 / TEL 2810 Introduction to Security
Lecture 10: Fixed Points ad Infinitum M.C. Escher, Moebius Ants
Background material.
Spring 2016 Program Analysis and Verification Operational Semantics
IS 2150 / TEL 2810 Introduction to Security
IS 2150 / TEL 2810 Information Security & Privacy
Ø Let the universe set U={1,2,3,...,10}.
Presentation transcript:

Programming Language Semantics Denotational Semantics Chapter 5 Part II

Outline Equivalence of Semantics Complete partial orders and continuous functions

Denotational semantics A: Aexp  (  N) B: Bexp  (  T) C: Com  (    ) Defined by structural induction

Denotational semantics of Aexp A: Aexp  (  N) A  n  = {( , n) |   } A  X  = {( ,  (X)) |   } A  a 0 +a 1  = {( , n 0 +n 1 ) | ( , n 0 )  A  a 0 , ( ,n 1 )  A  a 1  } A  a 0 -a 1  = {( , n 0 -n 1 ) | ( , n 0 )  A  a 0 , ( ,n 1 )  A  a 1  } A  a 0  a 1  = {( , n 0  n 1 ) | ( , n 0 )  A  a 0 , ( ,n 1 )  A  a 1  } Lemma: A  a  is a function

Equivalence of Semantics Lemma 5.3: For all a  Aexp –A  a  ={( , n) |  n} Proof –P(a)  A  a  ={( , n) |  n} –Structural induction

Denotational semantics of Bexp B: Bexp  (  T) B  true  = {( , true) |   } B  false  = {( , false) |   } B  a 0 =a 1  = {( , true) |   & A  a 0   =A  a 1   }  {( , false) |   & A  a 0   A  a 1   } B  a 0  a 1  = {( , true) |   & A  a 0    A  a 1   }  {( , false) |   & A  a 0    A  a 1   } B  b  = {( ,  T t) |  , ( , t)  B  b  } B  b 0  b 1  = {( , t 0  T t 1 ) |  , ( , t 0 )  B  b 0 , ( , t 1 )  B  b 1  } B  b 0  b 1  = {( , t 0  T t 1 ) |  , ( , t 0 )  B  b 0 , ( , t 1 )  B  b 1  } Lemma: B  b  is a function

Equivalence of Semantics Lemma 5.4: For all b  Bexp –B  b  ={( , t) |  t} Proof –P(b)  B  b  ={( , t) |  n} –Structural induction

Denotational semantics of Com C  skip  ={( ,  )|  } C  X:=a  = {( ,  [n/X]) |   & n=A  a   } C  c 0 ;c 1  = C  c 1   C  c 0  C  if b then c 0 else c 1  = {( ,  ’) | B  b   =true & ( ,  ’)  C  c 0  }  {( ,  ’) | B  b   =false & ( ,  ’)  C  c 1  } C  while b do c  = fix(  ) where  (  ) = {( ,  ’) | B  b   =true & ( ,  ’)    C  c  }  {( ,  ) |  B  b   =false}

Operational Semantics of Commands  /   {  n}/   [n/X] {   ’’,   ’ }/   ’ {  true,   ’ }/   ’ {  false,   ’ }/   ’ {  false }/   {  true,   ’’, }/   ’

Equivalence of Semantics Lemma 5.6: For all c  Com –   ’  ( ,  ’)  C  c  Proof –P(c, ,  ’)  ( ,  ’)  C  c  –Rule induction

Equivalence of Semantics Theorem 5.7 For all c  Com –C  c  = {( ,  ’) |   ’ } Proof – ,  ’  : ( ,  ’)  C  c     ’ –Structural++ induction

Partial Orders A partial order (p.o.) is a set P with a binary relation  –reflexive  p: p  P. p  p –transitive:  p, q, r  P. p  q & q  r  p  r –antisymmetric:  p, q  P. p  q & q  p  p=q For a partial order (P,  ) and a subset X  P –p is an upper bound of X  q  X. q  p –p is a least upper bound of X (denoted by  X) if p is an upper bound of X For all upper bounds q of X: p  q d 1  d 2  … d n =  {d 1, d 2, …, d n }

Partial Orders A partial order (p.o.) is a set P with a binary relation  –reflexive  p: p  P. p  p –transitive:  p, q, r  P. p  q & q  r  p  r –antisymmetric:  p, q  P. p  q & q  p  p=q For a partial order (P,  ) and a subset X  P –p is an upper bound of X  q  X. q  p –p is a least upper bound of X (denoted by  X) if p is an upper bound of X For all upper bounds q of X: p  q –p is an lower bound of X  q  X. p  q –p is a greatest upper bound of X (denoted by  X) if p is a lower bound of X For all lower bounds q of X: q  p Examples –(Pow(X),  ) –(Pow(X),  ),

Complete Partial Orders Let (D,  ) be a partial order –An  -chain is an increasing chain d 0  d 1  …d n .. –D is a complete partial order (c.p.o) if every  -chain has a least upper bound –D is a complete partial order with  if is a c.p.o. with a minimum element  –D is a complete lattice if every subset has both greatest and lower bounds Examples –(Pow(X),  ) –([   ],  )

Monotonic and Continuous Functions A function f: D  E between cpos D and E is monotonic if –  d,d’  D.d  d’  f(d)  f(d’) A function: D  E between cpos D and E is continuous if for all chains d 0  d 1  …d n  … in D:  n  f(d n ) = f(  n  d n )

Scott’ Thesis Any computable function is continuous –preserve information order More information as input gives more information as output –preserve limits The total information obtainable as output from an infinite sequence of input elements with refinement information is the sum of total of all information obtainable from each input seperately

Fixed Points Let f: D  D be a continuous function on a cpo with  D A fixed point of f is an element d  D such that f(d) =d A pre fixed point of f is an element d  D such that f(d)  d Thm: fix(f) =  n  f n (  )

Knaster-Tarski Theorem Let f: L  L be a monotonic function on a complete lattice L The least fixed point lfp(f) exists –lfp(f) =  {x  L: f(x)  x}

Summary Denotational semantics provides a way to declare the meaning of programs in an abstract way –Can handle side-effects –Loops –Recursion –Gotos Fixed point theory provides a declarative way to specify computations –Many usages