Denotational vs Operational Approaches COS 441 Princeton University Fall 2004.

Slides:



Advertisements
Similar presentations
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Advertisements

Substitution & Evaluation Order cos 441 David Walker.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
The lambda calculus David Walker CS 441. the lambda calculus Originally, the lambda calculus was developed as a logic by Alonzo Church in 1932 –Church.
8. Introduction to Denotational Semantics. © O. Nierstrasz PS — Denotational Semantics 8.2 Roadmap Overview:  Syntax and Semantics  Semantics of Expressions.
CSE 425: Semantic Analysis Semantic Analysis Allows rigorous specification of a program’s meaning –Lets (parts of) programming languages be proven correct.
ISBN Chapter 3 Describing Syntax and Semantics.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
CS 355 – Programming Languages
VeriML: Revisiting the Foundations of Proof Assistants Zhong Shao Yale University MacQueen Fest May 13, 2012 (Joint work with Antonis Stampoulis)
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
Foundations of Programming Languages: Introduction to Lambda Calculus
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
8. Introduction to Denotational Semantics. © O. Nierstrasz PS — Denotational Semantics 8.2 Roadmap  Syntax and Semantics  Semantics of Expressions 
Semantics For Pictures COS 441 Princeton University Fall 2004.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
The lambda calculus David Walker CS 441. the lambda calculus Originally, the lambda calculus was developed as a logic by Alonzo Church in 1932 –Church.
Syntax With Binders COS 441 Princeton University Fall 2004.
PSUCS322 HM 1 Languages and Compiler Design II Formal Semantics Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU Spring.
Comp 205: Comparative Programming Languages Semantics of Functional Languages Term- and Graph-Rewriting The λ-calculus Lecture notes, exercises, etc.,
Dynamic Semantics COS 441 Princeton University Fall 2004.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Denotational Semantics ICS.
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
Chapter 8 Relational Calculus. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.8-2 Topics in this Chapter Tuple Calculus Calculus vs. Algebra.
CS 331, Principles of Programming Languages Chapter 2.
Verification and Validation in the Context of Domain-Specific Modelling Janne Merilinna.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
CSE 230 The -Calculus. Background Developed in 1930’s by Alonzo Church Studied in logic and computer science Test bed for procedural and functional PLs.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
English Language Arts Strategies/Overview. Big Picture Questions Reading Section Rules: 1. Look for the main idea! This is a simple and effective way.
Dr. Muhammed Al-MulhemICS (Denotational Semantics)
CS 331, Principles of Programming Languages Chapter 2.
Top-down Parsing Recursive Descent & LL(1) Comp 412 Copyright 2010, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled in Comp 412.
Programming Language Descriptions. What drives PL Development? Computers are “in charge” of extremely important issues Execute a program literally. Exercise.
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
Types and Programming Languages
Classical Control in Quantum Programs Dominique Unruh IAKS, Universität Karlsruhe Founded by the European Project ProSecCo IST
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Denotational Semantics.
What is the Meaning of These Constant Interruptions? Graham Hutton and Joel Wright University of Nottingham.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Business Calculus Derivative Definition. 1.4 The Derivative The mathematical name of the formula is the derivative of f with respect to x. This is the.
6/21/20161 Programming Languages and Compilers (CS 421) Reza Zamani Based in part on slides by Mattox Beckman,
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
Lecture 9: Query Complexity Tuesday, January 30, 2001.
Calculus 12 Continuity. The mathematical definition of continuity is similar to the everyday use of the word –uninterrupted connection or union –the property.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Chapter 8 Relational Calculus.
Propositional Logic (a.k.a. Sentential Logic)
Propositional Calculus: Boolean Functions and Expressions
إستراتيجيات ونماذج التقويم
Automata and Formal Languages (CS 350/550)
Programming Languages and Compilers (CS 421)
Semantics In Text: Chapter 3.
Theory of Computability
OBJ first-order functional language based on equational logic
Theory of Computability
Presentation transcript:

Denotational vs Operational Approaches COS 441 Princeton University Fall 2004

Operational Semantics It is the purpose of these notes to develop a simple and direct method for specifying the semantics of programming languages. Very little is required in the way of mathematical background all that will be involved is “symbol-pushing” of one kind or another … A Structural Approach to Operational Semantics - Gordon Ploktin

Limitations of Op. Sem. What does it mean for two functions to be “equal”? Same syntax? Always reduce to the same value given same inputs? One-to-one relationship between their reductions?

Strengths of DS Every functions has a precise meaning two functions are equal if they are semantically equal Completely hides details of how the functions compute values Treats all non-terminating functions as equivalents

What’s Hard About DS DS deals simply with non-looping functions When we introduce non-terminating functions naïve interpretation of functions as sets is no longer valid Must introduce new theory of domains to account for technicalities

Contextual Equivalence Op. Sem. has one natural equivalence on functions that gets at the essences of the natural equivalences Contexts for -calculus e ::= x | x.e | (e 1 e 2 ) v ::= x.e C ::= [] | (C e) | (v C)

Contexts and Stacks Contexts are just a reformulation of the control stack (v ([] e)) is ( ¤ e) B (v ¤ ) B ² We say e 1 and e 2 are contextually equivalent (e 1  ctxt e 2 ) when 8 k. (k,e 1 )  C * ( ¢,v) iff (k,e 2 )  C * ( ¢,v) Intuitively swapping one expression for the other doesn’t change the result of any possible evaluation under any context

Op Sem vs DS Op has simple mathematical foundations –Requires sophisticated statements to get at program equality –With enough cleverness DS theorems can be restated in terms of Op Sem definitions DS has simple notions of program equivalence –Requires requires sophisticated mathematical foundations

When to use DS For languages that do not admit non- terminating computations DS approach is simple to use Consider our DS for pictures –Elementary ideas with simple notion of equality What would a Op Sem. for pictures look like?

When to use Op Sem When dealing with non-terminating computations and don’t care so much about a rich theory of equalities –e.g. type safety When you care about how the computation takes place –Sketching out details of implementation for things like exceptions and the like