Bisimulation and coinduction in higher-order languages

Size: px
Start display at page:

Download "Bisimulation and coinduction in higher-order languages"

Transcription

1 Bisimulation and coinduction in higher-order languages Davide Sangiorgi Focus Team, University of Bologna/INRIA ICE, Florence, June 2013

2 Bisimulation Behavioural equality One of the most important contributions of Concurrency Theory to CS (and beyond) [Milner, Park, 1980] Bisimulation: a relation R on states of an LTS s.t. whenever M R N: 1. P a P implies Q a Q and P R Q 2. the converse. Bisimilarity ( ): the union of all bisimulations [in the remainder: converse clauses omitted] page 1

3 Important 1. The definition gives us a powerful proof method: P R Q R is a bisimulation P Q 2. Coinduction and induction Bisimulation: a coinductive notion Congruence: the inductive dual of bisimulation (equivalence) [compatibility with the constructs of the language] In a language: we need them both inductive syntax coinductive semantics page 2

4 Higher-order languages Functions and/or processes move and/or used as data Example of higher-order feature: P(x) where x can be a program Functional languages, mobile code What is bisimulation? Compatibility can be hard page 3

5 The λ-calculus and contextual equivalence page 4

6 The λ-calculus The paradigmatical higher-order language M,N ::= x λx.m MN Values = the terms of the form λx.m Λ = the closed terms Reduction (call-by-name) M M (λx.m)n M{ N /x} MN M N = = the reflexive and transitive closure of. M = M terminates page 5

7 Behavioural equality in sequential languages for all context C, and for all values V, C[ P ] = V iff C[ Q ] = V Too strong in higher-order languages: I = λx.x λx.(ii) because I = I and λx.(ii) = λx.(ii) The observables should be as weak as possible page 6

8 Contextual equivalence [Morris, 68] M C N contextually equivalent if, for any context C such that C[ M ] and C[ N ] are closed, C[M] iff C[N] No need to check the identity of first-order values returned Example: if C[ P ] = 5 and C[ Q ] = 7, wrap C into if C = 5then trueelse <diverge> Problem : definition very hard to use (utterly useless in higher-order languages) page 7

9 Proof techniques for contextual equivalence in higher-order languages Till the 1990s: denotational techniques hard mathematics full abstraction scalability in non-purely functional extensions (eg, state; worst: concurrency) After the 1990s: coinduction (bisimulation) [Abramsky] A major factor in the movement towards operationally-based techniques in PL semantics after the 1990s Still a hot research topic page 8

10 Applicative bisimulation page 9

11 Bisimulation in the λ-calculus [Abramsky, 1990] Applicative bisimulation: a relation R Λ Λ s.t. whenever M R N: 1. M = λx.m implies N = λx.n and M { L /x} R N { L /x} for all L; Applicative bisimilarity ( A ) : the union of all bisimulations Questions: 1. A vs C? (contextual equivalence) 2. does the definition scale to extensions of the λ-calculus? page 10

12 Bisimilarity vs contextual equivalences A C easy? (cf: bisimilarity implies may testing) surprise: what is easy is the converse C A (λx.m)n C M{ N /x} ( ) M C N and M = λx.m imply N = λx.n We need: M { L /x} C N { L /x}, for all L M { L /x} C ( ) ML C (substitutivity) NL C ( ) N { L /x} Conclude from transitivity of C page 11

13 Congruence? A C would follow from the compatibility of A : for all M,N, and context C, if M A N then C[ M ] A C[ N ] A proof attempt : R = {(C[ M ],C[ Ñ ]) : M A Ñ} Induction on the structure of C. Main problematic case: C = C1C2 page 12

14 The two congruence problems Suppose (λx. M1)M2 R N1N2 with { λx.m1 R N1 M2 R N2 From the inductive assumption: (λx.m1)m2 M1{ M 2/x} R N1N2 = (λx.n 1 )N 2 N 1 {N 2/x} (... only if M2 = N2!) But we need more: (1) if M1{ M 2/x} = λx.m then N1{ L /x} = λx.n and for all L... (2) M2 R N2 page 13

15 Techniques for congruence Abramsky: via denotational semantics Howe s technique: define a relation that is, by definition, a congruence, and then prove that it is the same as A. Difficult to apply Limitations in extensions of the λ-calculus (concurrency) page 14

16 Bisimulation in the λ-calculus [Abramsky, 1990] Applicative bisimulation: a relation R Λ Λ s.t. whenever M R N: 1. M = λx.m implies N = λx.n and M { L /x} R N { L /x} for all L; Applicative bisimilarity ( A ) : the union of all bisimulations Questions: 1. A vs C? (contextual equivalence) 2. does the definition scale to extensions of the λ-calculus? page 15

17 Unsoundness of applicative bisimilarity under language extensions [example: call-by-value with generation of names] M = νnreturn λf.fn N = return λf.νn fn M A N (the argument supplied for f does not know n) M C N, as C[ M ] true but C[ N ] false for C = let [ ] = g in g(λn.g(λm.m = n)) [Koutavas, Levy, Sumii, 2011] page 16

18 Logical bisimulation, revisited page 17

19 simple congruence proof separate enhancements of the bisimulation Basis: logical bisimulation cf: logical relations [Kobayashi, Sangiorgi, Sumii, 2008 and 2010] page 18

20 First congruence problem From the inductive assumption: (λx.m1)m2 M1{ M 2/x} R N1N2 = (λx.n 1 )N 2 N 1 {N 2/x} (if M2 = N2!) But we need more: (1) if M1{ M 2/x} = λx.m then N1{ L /x} = λx.n and for all L... introduce a clause for internal moves (cf: concurrency) page 19

21 First change... whenever M R N: 1. M M implies N = N and M R N ; 2. M = λx.m implies N = λx.n and M { L /x} R N { L /x} for all L Problem: the new definition heavier to use in proofs page 20

22 The second congruence problem From the inductive assumption: (λx.m1)m2 M1{ M 2/x} R N1N2 = (λx.n 1 )N 2 N 1 {N 2/x} (if M2 = N2!) But we need more: (2) M2 R N2 first-order substitutivity: Q. P(x) P (x) implies P(Q) P (Q) higher-order substitutivity: Q,Q. P(x) P (x) and Q Q imply P(Q) P (Q ) page 21

23 Second change... whenever M R N : M = λx.m implies N = λx.n and M { P /x} R N { Q /x} for all P R Q Now: problematic case ok Problem: definition unsound λx.x = I A K = λx.i, for R = {(I,I),(I,K)} R and the identity relation are bisimulations, but not their union a non-monotone functional page 22

24 Second change... whenever M R N : M = λx.m implies N = λx.n and M { P /x} R N { Q /x} for all P R Q Problem: definition unsound W sound if R is a congruence (or substitutive) directly from the definition: A C page 23

25 Third change A congruence (or substitutive) R s.t. whenever M R N: 1. M M implies N = N and M R N ; 2. M = λx.m implies N = λx.n and M { P /x} R N { Q /x} for all P R Q Logical bisimilarity: L Theorem L = C Problem: not a good proof technique from the definition No need to kill two birds with one stone! Enhancements of the proof method, separately cf: up-to techniques [cf: Pous/Bonchi talk] bisimilarity results using relations smaller a bisimulation page 24

26 Example enhancement: up-to context [ R = the context closure of R ] A relation R is a bisimulation up-to contexts if whenever M R N 1. M M implies N = N and M R N ; 2. M = λx.m implies N = λx.n and M { P /x} R N { Q /x} for all P R Q Theorem If R is a bisimulation up-to contexts then R is a bisimulation. Proof: essentially the earlier proof of congruence page 25

27 Big-step up-to contexts and reductions A relation R is a big-step bisimulation up-to contexts and reductions if whenever M R N 1. M = λx.m implies N = λx.n and M { P /x} = R = N { Q /x} for all P R Q Theorem If R is a big-step bisimulation up-to contexts and reductions then = R = is a bisimulation. page 26

28 An example proof with enhancements I1 C I2 for I1 I2 = λx.x = λx.(λy. y)x A plain bisimulation R: a congruence closed under the rules I1 R I2 M R N M R (λy.y)n S = {(I1,I2)} is a big-step bisimulation up-to contexts and reductions, as for M S N: λx.x M M S λx.(λy.y)x N (λy.y)n = N page 27

29 Fixed-points The functional of the final definition non-monotone (even on congruence relations) but it has a greatest fixed point ( C ) non cocontinuous, but it has the stratification approximation A theory of coinduction for non-monotone functionals? Another possibility: environmental bisimulations monotone functional, robust more complex definition [Kobayashi, Sangiorgi, Sumii, 2010] page 28

30 Extensions and variations page 29

31 The example with language extension [call-by-value with generation of names] M = νnreturn V for V = λf.fn N = return W for W = λf.νn fn Distinguished in C = let [ ] = g in g(λn.g(λm.m = n)) Now, also M L N : M = V λn.v (λm.m=n ) = true N = W λn.w(λm.m=n )= false page 30

32 Evaluation contexts Sometimes useful to separate evaluation contexts [example: call-by-value λ-calculus with references] M = if!l = 0then l := 1else Ω N = l := 1 EC = contextual equivalence, under only evaluation contexts [l = 0]; M EC [l = 0]; N [l = 0]; M C [l = 0]; N for C = [ ];[ ] page 31

33 Coupled logical bisimulation (E, G) with E closed under contexts, and E G, G closed under evaluation contexts [call-by-value λ-calculus]... whenever M G N 1. M M implies N = N and M G N 2. M = λx.m implies N = λx.n with λx.m E λx.n, M{ P /x} G N{ Q /x} for all P E Q M E N implies M C N, and M G N implies M EC N page 32

34 Non-determinism and probabilities page 33

35 Non-determinism M,N ::=... M N Now the easy proof C A/L breaks (as C ) Convergence: may, must Variants of C : may, must, may & must Bisimulation: different from any of them λx.i λx.ω = λx.(i Ω) cf: the CCS-like law µ.p µ.q = µ.(p Q) page 34

36 To regain coincidence, two possibilities : 1. stengthen C 2. weaken A/L (1) is easy: replace contextual equivalence with barbed congruence (congruence induced by barbed bisimulation) Barbed bisimulation whenever M R N 1. M M implies N = N and M R N 2. M iff N (2) is be more delicate (cf: proof of C A/L ; first congruence problem) A case study: the probabilistic λ-calculus page 35

37 The probabilistic λ-calculus [Alberti, Dal Lago, Sangiorgi, on-going work] M N abbreviates for M 1/2 N M1 M2 1/2 M1 M1 M2 1/2 M2 Example: ((I Ω)I) Ω (I Ω)I 1 I Ω 1/2 1/2 Ω 1/2 1/2 I Ω which shows ((I Ω)I) Ω 1/4 page 36

38 Distributions Y = fix point operator N = λf.(i f) Y N 1 I Y N 1/2 1/2 I Y N For all n, Y N = 1/2 n I hence Y N 1 (ie, Y N 0) Using (partial) distributions: Y N Σn I,1/2 n page 37

39 Probabilistic contextual equivalence, C P M C N if, C[M] p iff C[N] p, for all contexts C. No issues of may and must convergence Probabilistic applicative bisimulation, A P, following Larsen-Skou An equivalence s.t. M R N implies, for all equivalence classes E of R and for all inputs L: prob(m = L E) = prob(n = L E) Theorem A P is a congruence [Howe s technique] A P = C P? And how discriminating? page 38

40 The effect of probabilities on pure λ-terms =LL = Lévy Longo Tree equality The finest equivalence for pure λ-term, under call-by-name [Dezani,Giovannetti tutorial, 2001] Theorem In Λ Λ: =LL = A P = C P Higher-order and probability: maximal discriminating power (on pure λ-terms) [cf: work in concurrency: eg Deng, Hennessy 2010] page 39

41 Quite different from (non-probabilistic) non-determinism : λx. xx and λx. x(λy. xy) contextually equivalent (both may and must) [under may (similarly for must): if L may then λz.lz = L; otherwise LÑ = Ω] Different in C P : (λx.xx)(i Ω) 1/4 I (λx.x(λy.xy))(i Ω) 1/2 λy.(i Ω)y Similarly, different under bisimulation, and different LL trees Outside pure λ-terms, usual counterexample: λx.i λx.ω vs λx.(i Ω) Coinductive characterisation of C P? page 40

42 Lévy Longo Trees The Lévy Longo Tree of M Λ is the labeled tree, LT(M), defined coinductively as follows: 1. λx if M = λx.n LT(N) 2. x if M = xm1...mn LT(M1)... LT(Mn) 3. LT(M) = otherwise (ie, M ) page 41

43 Probabilistic coupled logical bisimulation A partial distribution : Σi Mi,pi A distribution value : λx.σi Mi,pi = Σi λx.mi,pi Allow distributions in redex position Extended λ-terms (ΛD): E,F ::= EM Σi Mi,pi M1 M2 λx.m (M Λ) page 42

44 A bisimulation: (E, G) with E Λ Λ, G Λ D Λ D, E G. (E,G) is a bisimulation if for each E G F we have: 1. if E E then F = F and E G F ; 2. if E = λx.e then F = λx.f with prob(e ) = prob(f ), and E { M /x} G W{ N /x} for all M E N Write M CL P N if M E N for some bisimulation (E,G). Theorem CL P = C P page 43

45 Probabilistic λ-calculus: big-step operational semantics, call-by-name [Dal Lago, Zorzi, 2012] LAM λx.m λx.m,1 EMP M M λx.σ i Mi,pi Mi{ N /x} Σj Ni,j,qj APP MN Σi,j Ni,j,pi qj PLUS M E M F M N E 1/2 + F 1/2 Inductively: M = E if E = sup{f : M F} Coinductively, without EMP: M = E if E = inf{f : M F} page 44

Probabilistic Applicative Bisimulation and Call-by-Value Lam

Probabilistic Applicative Bisimulation and Call-by-Value Lam Probabilistic Applicative and Call-by-Value Lambda Calculi Joint work with Ugo Dal Lago ENS Lyon February 9, 2014 Probabilistic Applicative and Call-by-Value Lam Introduction Fundamental question: when

More information

On Böhm Trees and Lévy-Longo Trees in π-calculus

On Böhm Trees and Lévy-Longo Trees in π-calculus On Böhm Trees and Lévy-Longo Trees in π-calculus Xian Xu East China University of Science and Technology (from ongoing work with Davide Sangiorgi) April, 1 Subject Encodings from to λ-calculus (sequential

More information

On Coinductive Equivalences for Higher-Order Probabilistic Functional Programs

On Coinductive Equivalences for Higher-Order Probabilistic Functional Programs On Coinductive Equivalences for Higher-Order Probabilistic Functional Programs Ugo Dal Lago, Davide Sangiorgi, Michele Alberti To cite this version: Ugo Dal Lago, Davide Sangiorgi, Michele Alberti. On

More information

arxiv: v1 [cs.lo] 16 Apr 2018

arxiv: v1 [cs.lo] 16 Apr 2018 TREES FROM FUNCTIONS AS PROCESSES arxiv:1804.05797v1 [cs.lo] 16 Apr 2018 DAVIDE SANGIORGI AND XIAN XU Università di Bologna (Italy) and INRIA (France) East China University of Science and Technology (China)

More information

A probabilistic lambda calculus - Some preliminary investigations

A probabilistic lambda calculus - Some preliminary investigations A probabilistic lambda calculus - Some preliminary investigations Ugo Dal Lago, Margherita Zorzi Università di Bologna, Università di Verona June, 9-11, 2010, Torino Introduction: Λ P We present some results

More information

Environmental Bisimulations for Probabilistic Higher-Order Languages

Environmental Bisimulations for Probabilistic Higher-Order Languages Environmental Bisimulations for Probabilistic Higher-Order Languages Davide Sangiorgi, Valeria Vignudelli To cite this version: Davide Sangiorgi, Valeria Vignudelli. Environmental Bisimulations for Probabilistic

More information

Contextual equivalence

Contextual equivalence Techniques 16/22 ACS L16, lecture 2 4/10 Contextual equivalence Two phrases of a programming language are ( Morris style ) contextually equivalent ( = ctx ) if occurrences of the first phrase in any program

More information

Techniques. Contextual equivalence

Techniques. Contextual equivalence Techniques 16/22 Contextual equivalence Two phrases of a programming language are ( Morris style ) contextually equivalent ( = ctx )if occurrences of the first phrase in any program can be replaced by

More information

3.2 Equivalence, Evaluation and Reduction Strategies

3.2 Equivalence, Evaluation and Reduction Strategies 3.2 Equivalence, Evaluation and Reduction Strategies The λ-calculus can be seen as an equational theory. More precisely, we have rules i.e., α and reductions, for proving that two terms are intensionally

More information

Interpreting the Full λ-calculus in the π-calculus

Interpreting the Full λ-calculus in the π-calculus Interpreting the Full λ-calculus in the π-calculus Xiaojuan Cai Joint work with Yuxi Fu BASICS Lab October 12, 2009 Motivation The λ-calculus: sequential model; The π-calculus: concurrent model A deep

More information

Equations, contractions, and unique solutions

Equations, contractions, and unique solutions Equations, contractions, and unique solutions Davide Sangiorgi To cite this version: Davide Sangiorgi. Equations, contractions, and unique solutions. POPL 2015 - Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT

More information

The Lambda-Calculus Reduction System

The Lambda-Calculus Reduction System 2 The Lambda-Calculus Reduction System 2.1 Reduction Systems In this section we present basic notions on reduction systems. For a more detailed study see [Klop, 1992, Dershowitz and Jouannaud, 1990]. Definition

More information

Communication Errors in the π-calculus are Undecidable

Communication Errors in the π-calculus are Undecidable Communication Errors in the π-calculus are Undecidable Vasco T. Vasconcelos Department of Informatics Faculty of Sciences, University of Lisbon António Ravara Department of Mathematics Lisbon Institute

More information

Concurrency theory. proof-techniques for syncronous and asynchronous pi-calculus. Francesco Zappa Nardelli. INRIA Rocquencourt, MOSCOVA research team

Concurrency theory. proof-techniques for syncronous and asynchronous pi-calculus. Francesco Zappa Nardelli. INRIA Rocquencourt, MOSCOVA research team Concurrency theory proof-techniques for syncronous and asynchronous pi-calculus Francesco Zappa Nardelli INRIA Rocquencourt, MOSCOVA research team francesco.zappa nardelli@inria.fr together with Frank

More information

A note on coinduction and weak bisimilarity for while programs

A note on coinduction and weak bisimilarity for while programs Centrum voor Wiskunde en Informatica A note on coinduction and weak bisimilarity for while programs J.J.M.M. Rutten Software Engineering (SEN) SEN-R9826 October 31, 1998 Report SEN-R9826 ISSN 1386-369X

More information

Programming Language Concepts: Lecture 18

Programming Language Concepts: Lecture 18 Programming Language Concepts: Lecture 18 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 18, 30 March 2009 One step reduction

More information

Applicative May- and Should-Simulation in the Call-by-Value Lambda Calculus with AMB

Applicative May- and Should-Simulation in the Call-by-Value Lambda Calculus with AMB Applicative May- and Should-Simulation in the Call-by-Value Lambda Calculus with AMB Manfred Schmidt-Schauß and David Sabel Goethe University, Frankfurt, Germany {schauss,sabel}@ki.informatik.uni-frankfurt.de

More information

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF Origin

More information

Domain theory and denotational semantics of functional programming

Domain theory and denotational semantics of functional programming Domain theory and denotational semantics of functional programming Martín Escardó School of Computer Science, Birmingham University MGS 2007, Nottingham, version of April 20, 2007 17:26 What is denotational

More information

Dipartimento di Informatica Università degli Studi di Verona

Dipartimento di Informatica Università degli Studi di Verona Dipartimento di Informatica Università degli Studi di Verona Rapporto di ricerca Research report 40/2006 On the observational theory of the CPS-calculus Massimo Merro Corrado Biasi Dipartimento di Informatica

More information

TRINITY COLLEGE DUBLIN. First-Order Reasoning for Higher-Order Concurrency

TRINITY COLLEGE DUBLIN. First-Order Reasoning for Higher-Order Concurrency TRINITY COLLEGE DUBLIN COLÁISTE NA TRÍONÓIDE, BAILE ÁTHA CLIATH First-Order Reasoning for Higher-Order Concurrency Vasileios Koutavas Matthew Hennessy Computer Science Department Technical Report TCS-CS-YYYY-NN

More information

Advanced Lambda Calculus. Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands

Advanced Lambda Calculus. Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands Advanced Lambda Calculus Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands Form of the course Ordinary lecture Seminar form Exam: working out an exercise

More information

An introduction to process calculi: Calculus of Communicating Systems (CCS)

An introduction to process calculi: Calculus of Communicating Systems (CCS) An introduction to process calculi: Calculus of Communicating Systems (CCS) Lecture 2 of Modelli Matematici dei Processi Concorrenti Paweł Sobociński University of Southampton, UK Intro to process calculi:

More information

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF The Combinatory

More information

Categories, Proofs and Programs

Categories, Proofs and Programs Categories, Proofs and Programs Samson Abramsky and Nikos Tzevelekos Lecture 4: Curry-Howard Correspondence and Cartesian Closed Categories In A Nutshell Logic Computation 555555555555555555 5 Categories

More information

On Coinduction and Quantum Lambda Calculi

On Coinduction and Quantum Lambda Calculi On Coinduction and Quantum Lambda Calculi Yuxin Deng East China Normal University (Joint work with Yuan Feng and Ugo Dal Lago) To appear at CONCUR 15 1 Outline Motivation A quantum λ-calculus Coinductive

More information

Skew and ω-skew Confluence and Infinite Normal Forms

Skew and ω-skew Confluence and Infinite Normal Forms Skew and ω-skew Confluence and Infinite Normal Forms Zena M. riola and Stefan Blom University of Oregon University of Innsbruck bstract. The notion of skew confluence was introduced to characterize non-confluent

More information

Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010

Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010 Lambda-Calculus (I) jean-jacques.levy@inria.fr 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010 Plan computation models lambda-notation bound variables conversion

More information

Syntax and Semantics of Propositional Linear Temporal Logic

Syntax and Semantics of Propositional Linear Temporal Logic Syntax and Semantics of Propositional Linear Temporal Logic 1 Defining Logics L, M, = L - the language of the logic M - a class of models = - satisfaction relation M M, ϕ L: M = ϕ is read as M satisfies

More information

Relating Reasoning Methodologies in Linear Logic and Process Algebra

Relating Reasoning Methodologies in Linear Logic and Process Algebra Relating Reasoning Methodologies in Linear Logic and Process Algebra Yuxin Deng Robert J. Simmons Iliano Cervesato December 2011 CMU-CS-11-145 CMU-CS-QTR-111 School of Computer Science Carnegie Mellon

More information

A Behavioural Model for Klop s Calculus

A Behavioural Model for Klop s Calculus Replace this file with prentcsmacro.sty for your meeting, or with entcsmacro.sty for your meeting. Both can be found at the ENTCS Macro Home Page. A Behavioural Model for Klop s Calculus Mariangiola Dezani-Ciancaglini

More information

Call-by-value non-determinism in a linear logic type discipline

Call-by-value non-determinism in a linear logic type discipline Call-by-value non-determinism in a linear logic type discipline Alejandro Díaz-Caro? Giulio Manzonetto Université Paris-Ouest & INRIA LIPN, Université Paris 13 Michele Pagani LIPN, Université Paris 13

More information

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007 CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation

More information

A Behavioral Congruence for Concurrent Constraint Programming with Nondeterministic Choice

A Behavioral Congruence for Concurrent Constraint Programming with Nondeterministic Choice A Behavioral Congruence for Concurrent Constraint Programming with Nondeterministic Choice Luis Pino*, Filippo Bonchi** and Frank Valencia* (Presented by: Jorge A. Pe rez) *E quipe Come te, LIX, Laboratoire

More information

Simulation in the Call-by-Need Lambda-Calculus with Letrec, Case, Constructors, and Seq

Simulation in the Call-by-Need Lambda-Calculus with Letrec, Case, Constructors, and Seq Simulation in the Call-by-Need Lambda-Calculus with Letrec, Case, Constructors, and Seq Manfred Schmidt-Schauss 1 and David Sabel 1 and Elena Machkasova 2 1 Dept. Informatik und Mathematik, Inst. Informatik,

More information

Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus

Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus Matthias Mann Johann Wolfgang Goethe-Universität, Frankfurt, Germany Congruence of Bisimulation p. 1/21 Lambda Calculi and

More information

Subtyping and Intersection Types Revisited

Subtyping and Intersection Types Revisited Subtyping and Intersection Types Revisited Frank Pfenning Carnegie Mellon University International Conference on Functional Programming (ICFP 07) Freiburg, Germany, October 1-3, 2007 Joint work with Rowan

More information

Strong bisimilarity can be opened

Strong bisimilarity can be opened Strong bisimilarity can be opened Henning E. Andersen Hans Hüttel Karina N. Jensen June 7, 2002 Abstract We present an extension of the semantics of the π-calculus without match where strong bisimilarity

More information

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms Alonzo Church (1903-1995) Lambda Calculus 2 λ-calculus : syntax Grammar for terms : t, u ::= x (variable) t u (application) λx.t (abstraction) Notation : Application is left-associative so that t 1 t 2...

More information

λ-terms, M Some random examples of λ-terms: L9 105

λ-terms, M Some random examples of λ-terms: L9 105 λ-terms, M are built up from a given, countable collection of variables x, y, z,... by two operations for forming λ-terms: λ-abstraction: (λx.m) (where x is a variable and M is a λ-term) application: (M

More information

On the Origins of Bisimulation and Coinduction

On the Origins of Bisimulation and Coinduction On the Origins of Bisimulation and Coinduction DAVIDE SANGIORGI University of Bologna, Italy The origins of bisimulation and bisimilarity are examined, in the three fields where they have been independently

More information

Normal Form Simulation for McCarthy s Amb

Normal Form Simulation for McCarthy s Amb Electronic Notes in Theoretical Computer Science 155 (2006) 445 465 www.elsevier.com/locate/entcs Normal Form Simulation for McCarthy s Amb Soren B. Lassen 1 Google, Inc. Mountain View, CA Abstract This

More information

Making the unobservable, unobservable

Making the unobservable, unobservable ICE 2008 Making the unobservable, unobservable Julian Rathke ecs, University of Southampton awe l Sobociński 1 ecs, University of Southampton Abstract Behavioural equivalences of various calculi for modelling

More information

Graph lambda theories

Graph lambda theories Under consideration for publication in Math. Struct. in Comp. Science Graph lambda theories A N T O N I O B U C C I A R E L L I 1 and A N T O N I N O S A L I B R A 2 1 Equipe PPS (case 7014), Université

More information

Strong Normalization for Guarded Types

Strong Normalization for Guarded Types Strong Normalization for Guarded Types Andreas Abel Andrea Vezzosi Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden PLS Seminar ITU, Copenhagen, Denmark 20 August

More information

Probabilistic Bisimilarity as Testing Equivalence

Probabilistic Bisimilarity as Testing Equivalence Probabilistic Bisimilarity as Testing Equivalence Yuxin Deng a,, Yuan Feng b a Shanghai Key Laboratory of Trustworthy Computing, MOE International Joint Lab of Trustworthy Software, and International Research

More information

Communicating and Mobile Systems

Communicating and Mobile Systems Communicating and Mobile Systems Overview:! Programming Model! Interactive Behavior! Labeled Transition System! Bisimulation! The π-calculus! Data Structures and λ-calculus encoding in the π-calculus References:!

More information

Decidable Subsets of CCS

Decidable Subsets of CCS Decidable Subsets of CCS based on the paper with the same title by Christensen, Hirshfeld and Moller from 1994 Sven Dziadek Abstract Process algebra is a very interesting framework for describing and analyzing

More information

Programming Languages

Programming Languages CSE 230: Winter 2010 Principles of Programming Languages Lecture 10: Programming in λ-calculusc l l Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2

More information

λ-terms, M Some random examples of λ-terms: L9 105

λ-terms, M Some random examples of λ-terms: L9 105 λ-terms, M L9 105 are built up from a given, countable collection of variables x, y, z,... by two operations for forming λ-terms: λ-abstraction: (λx.m) (where x is a variable and M is a λ-term) application:

More information

Model Theory of Modal Logic Lecture 5. Valentin Goranko Technical University of Denmark

Model Theory of Modal Logic Lecture 5. Valentin Goranko Technical University of Denmark Model Theory of Modal Logic Lecture 5 Valentin Goranko Technical University of Denmark Third Indian School on Logic and its Applications Hyderabad, January 29, 2010 Model Theory of Modal Logic Lecture

More information

Denotational semantics

Denotational semantics Denotational semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 4 4 March 2016 Course 4 Denotational semantics Antoine Miné p.

More information

arxiv: v1 [cs.lo] 22 Jun 2015

arxiv: v1 [cs.lo] 22 Jun 2015 pplicative Bisimulation and Quantum λ-calculi (Long Version) Ugo Dal Lago lessandro Rioli arxiv:1506.06661v1 [cs.lo] 22 Jun 2015 February 24, 2018 bstract pplicative bisimulation is a coinductive technique

More information

CBV and CBN. Eduardo Bonelli. TP para LP 2012C1 1/55

CBV and CBN. Eduardo Bonelli. TP para LP 2012C1 1/55 CBV and CBN Eduardo Bonelli TP para LP 2012C1 1/55 Reduction Strategies Call-By-Value Call-by-Name Relating CBN and CBV λ-calculus Continuation Passing Style Bibliography 2/55 Reduction Strategies Reduction

More information

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either Introduction to Temporal Logic The purpose of temporal logics is to specify properties of dynamic systems. These can be either Desired properites. Often liveness properties like In every infinite run action

More information

Introduction to λ-calculus

Introduction to λ-calculus p.1/65 Introduction to λ-calculus Ken-etsu FUJITA fujita@cs.gunma-u.ac.jp http://www.comp.cs.gunma-u.ac.jp/ fujita/ Department of Computer Science Gunma University :Church 32, 36, 40; Curry 34 1. Universal

More information

Tutorial on Semantics Part I

Tutorial on Semantics Part I Tutorial on Semantics Part I Basic Concepts Prakash Panangaden 1 1 School of Computer Science McGill University on sabbatical leave at Department of Computer Science Oxford University Fields Institute,

More information

Call-by-Value Non-determinism in a Linear Logic Type Discipline

Call-by-Value Non-determinism in a Linear Logic Type Discipline Call-by-Value Non-determinism in a Linear Logic Type Discipline Alejandro Díaz-Caro 1,, Giulio Manzonetto 1,2, and Michele Pagani 1,2 1 Université Paris 13, Sorbonne Paris Cité, LIPN, F-93430, Villetaneuse,

More information

Mobile Processes in Bigraphs. Ole Høgh Jensen. October 2006

Mobile Processes in Bigraphs. Ole Høgh Jensen. October 2006 Mobile Processes in Bigraphs Ole Høgh Jensen October 2006 Abstract Bigraphical reactive systems (BRSs) are a formalism for modelling mobile computation. A bigraph consists of two combined mathematical

More information

ESE601: Hybrid Systems. Introduction to verification

ESE601: Hybrid Systems. Introduction to verification ESE601: Hybrid Systems Introduction to verification Spring 2006 Suggested reading material Papers (R14) - (R16) on the website. The book Model checking by Clarke, Grumberg and Peled. What is verification?

More information

Bisimulation for conditional modalities

Bisimulation for conditional modalities Bisimulation for conditional modalities Alexandru Baltag and Giovanni Ciná Institute for Logic, Language and Computation, University of Amsterdam March 21, 2016 Abstract We give a general definition of

More information

Proving Soundness of Extensional Normal-Form Bisimilarities

Proving Soundness of Extensional Normal-Form Bisimilarities Proving Soundness of Extensional Normal-Form Bisimilarities Dariusz Biernacki, Sergueï Lenglet, Piotr Polesiuk To cite this version: Dariusz Biernacki, Sergueï Lenglet, Piotr Polesiuk. Proving Soundness

More information

Operational Semantics Using the Partiality Monad

Operational Semantics Using the Partiality Monad page.1 Operational Semantics Using the Partiality Monad Nils Anders Danielsson (Göteborg) Shonan Meeting 026: Coinduction for computation structures and programming languages The research leading to these

More information

A Tableau Calculus for Minimal Modal Model Generation

A Tableau Calculus for Minimal Modal Model Generation M4M 2011 A Tableau Calculus for Minimal Modal Model Generation Fabio Papacchini 1 and Renate A. Schmidt 2 School of Computer Science, University of Manchester Abstract Model generation and minimal model

More information

Review of The π-calculus: A Theory of Mobile Processes

Review of The π-calculus: A Theory of Mobile Processes Review of The π-calculus: A Theory of Mobile Processes Riccardo Pucella Department of Computer Science Cornell University July 8, 2001 Introduction With the rise of computer networks in the past decades,

More information

Lecture 2: Self-interpretation in the Lambda-calculus

Lecture 2: Self-interpretation in the Lambda-calculus Lecture 2: Self-interpretation in the Lambda-calculus H. Geuvers Nijmegen, NL 21st Estonian Winter School in Computer Science Winter 2016 H. Geuvers - Radboud Univ. EWSCS 2016 Self-interpretation in λ-calculus

More information

Step-Indexed Biorthogonality: a Tutorial Example

Step-Indexed Biorthogonality: a Tutorial Example Step-Indexed Biorthogonality: a Tutorial Example Andrew Pitts University of Cambridge Computer Laboratory 1 Introduction The purpose of this note is to illustrate the use of step-indexing [2] combined

More information

Coinductive big-step semantics and Hoare logics for nontermination

Coinductive big-step semantics and Hoare logics for nontermination Coinductive big-step semantics and Hoare logics for nontermination Tarmo Uustalu, Inst of Cybernetics, Tallinn joint work with Keiko Nakata COST Rich Models Toolkit meeting, Madrid, 17 18 October 2013

More information

Models of Concurrency

Models of Concurrency Models of Concurrency GERARDO SCHNEIDER UPPSALA UNIVERSITY DEPARTMENT OF INFORMATION TECHNOLOGY UPPSALA, SWEDEN Thanks to Frank Valencia Models of Concurrency p.1/57 Concurrency is Everywhere Concurrent

More information

RPO, Second-Order Contexts, and λ-calculus

RPO, Second-Order Contexts, and λ-calculus RPO, Second-Order Contexts, and λ-calculus Pietro Di Gianantonio, Furio Honsell, and Marina Lenisa Dipartimento di Matematica e Informatica, Università di Udine via delle Scienze 206, 33100 Udine, Italy

More information

Call-by-Value Non-determinism in a Linear Logic Type Discipline

Call-by-Value Non-determinism in a Linear Logic Type Discipline Call-by-Value Non-determinism in a Linear Logic Type Discipline Alejandro Díaz-Caro 1,, Giulio Manzonetto 1,2, and Michele Pagani 1,2 1 Université Paris 13, Sorbonne Paris Cité, LIPN, F-93430, Villetaneuse,

More information

Combinators & Lambda Calculus

Combinators & Lambda Calculus Combinators & Lambda Calculus Abstracting 1/16 three apples plus two pears = five fruits concrete 3+2 = 5 abstract objects a+b = b+a a (b c) = (a b) c abstract quantities abstract operations a, b[r(a,

More information

A Propositional Dynamic Logic for Instantial Neighborhood Semantics

A Propositional Dynamic Logic for Instantial Neighborhood Semantics A Propositional Dynamic Logic for Instantial Neighborhood Semantics Johan van Benthem, Nick Bezhanishvili, Sebastian Enqvist Abstract We propose a new perspective on logics of computation by combining

More information

A Bisimulation-Like Proof Method for Contextual Properties in Untyped λ-calculus with References and Deallocation

A Bisimulation-Like Proof Method for Contextual Properties in Untyped λ-calculus with References and Deallocation A Bisimulation-Like Proof Method for Contextual Properties in Untyped λ-calculus with References and Deallocation Eijiro Sumii Graduate School of Information Sciences, Tohoku University, Aoba-ku Aramki

More information

Towards Correctness of Program Transformations Through Unification and Critical Pair Computation

Towards Correctness of Program Transformations Through Unification and Critical Pair Computation Towards Correctness of Program Transformations Through Unification and Critical Pair Computation Conrad Rau and Manfred Schmidt-Schauß Institut für Informatik Johann Wolfgang Goethe-Universität Postfach

More information

MAKING THE UNOBSERVABLE, UNOBSERVABLE.

MAKING THE UNOBSERVABLE, UNOBSERVABLE. MAKING THE UNOBSERVABLE, UNOBSERVABLE. 3 PAPERS FROM THE LAST 365 DAYS AVAILABLE TO READ NOW ON YOUR COMPUTER PAWEL SOBOCINSKI AND JULIAN RATHKE GO TO www.ecs.soton.ac.uk/~ps/publications.php Plan of the

More information

CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016

CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016 CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016 1 Equirecursive Equality In the equirecursive view of recursive types, types are regular labeled trees, possibly infinite. However, we

More information

Distributed Processes and Location Failures (Extended Abstract)

Distributed Processes and Location Failures (Extended Abstract) Distributed Processes and Location Failures (Extended Abstract) James Riely and Matthew Hennessy Abstract Site failure is an essential aspect of distributed systems; nonetheless its effect on programming

More information

On the method of typical bounded differences. Lutz Warnke. Georgia Tech

On the method of typical bounded differences. Lutz Warnke. Georgia Tech On the method of typical bounded differences Lutz Warnke Georgia Tech What is this talk about? Motivation Behaviour of a function of independent random variables ξ 1,..., ξ n : X = F (ξ 1,..., ξ n ) the

More information

Relational Graph Models, Taylor Expansion and Extensionality

Relational Graph Models, Taylor Expansion and Extensionality Relational Graph Models, Taylor Expansion and Extensionality Domenico Ruoppolo Giulio Manzonetto Laboratoire d Informatique de Paris Nord Université Paris-Nord Paris 13 (France) MFPS XXX Ithaca, New York

More information

INFORMATIQUE THÉORIQUE ET APPLICATIONS

INFORMATIQUE THÉORIQUE ET APPLICATIONS INFORMATIQUE THÉORIQUE ET APPLICATIONS J. J. M. M. RUTTEN A note on coinduction and weak bisimilarity for while programs Informatique théorique et applications, tome 33, n o 4-5 (1999), p. 393-400

More information

Principles of Program Analysis: Control Flow Analysis

Principles of Program Analysis: Control Flow Analysis Principles of Program Analysis: Control Flow Analysis Transparencies based on Chapter 3 of the book: Flemming Nielson, Hanne Riis Nielson and Chris Hankin: Principles of Program Analysis. Springer Verlag

More information

Operationally-Based Theories of Program Equivalence

Operationally-Based Theories of Program Equivalence Operationally-Based Theories of Program Equivalence Andrew Pitts Contents 1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : 241 2 Contextual Equivalence : : : : : : : : : : : : : :

More information

Computational Soundness of a Call by Name Calculus of Recursively-scoped Records. UMM Working Papers Series, Volume 2, Num. 3.

Computational Soundness of a Call by Name Calculus of Recursively-scoped Records. UMM Working Papers Series, Volume 2, Num. 3. Computational Soundness of a Call by Name Calculus of Recursively-scoped Records. UMM Working Papers Series, Volume 2, Num. 3. Elena Machkasova Contents 1 Introduction and Related Work 1 1.1 Introduction..............................

More information

Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus

Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus SOS 2004 Preliminary Version Congruence of Bisimulation in a Non-Deterministic Call-By-Need Lambda Calculus Matthias Institut für Informatik Johann Wolfgang Goethe-Universität Postfach 11 19 32 D-60054

More information

Variations on a theme: call-by-value and factorization

Variations on a theme: call-by-value and factorization Variations on a theme: call-by-value and factorization Beniamino Accattoli INRIA & LIX, Ecole Polytechnique Accattoli (INRIA Parsifal) Variations on a theme: call-by-value and factorization 1 / 31 Outline

More information

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg Type Inference For the Simply-Typed Lambda Calculus Albert-Ludwigs-Universität Freiburg Peter Thiemann, Manuel Geffken University of Freiburg 24. Januar 2013 Outline 1 Introduction 2 Applied Lambda Calculus

More information

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures CS 6110 S18 Lecture 21 Products, Sums, and Other Datatypes 1 Introduction In this lecture, we add constructs to the typed λ-calculus that allow working with more complicated data structures, such as pairs,

More information

Using models to model-check recursive schemes

Using models to model-check recursive schemes Using models to model-check recursive schemes S Salvati and I Walukiewicz Université de Bordeaux, INRIA, CNRS, LaBRI UMR5800 Abstract We propose a model-based approach to the model checking problem for

More information

Extending Abramsky s Lazy Lambda Calculus: (Non)-Conservativity of Embeddings

Extending Abramsky s Lazy Lambda Calculus: (Non)-Conservativity of Embeddings Extending Abramsky s Lazy Lambda Calculus: (Non)-Conservativity of Embeddings Manfred Schmidt-Schauß 1, Elena Machkasova 2, and David Sabel 1 1 Goethe-Universität, Frankfurt, Germany schauss,sabel@ki.informatik.uni-frankfurt.de

More information

Simply Typed λ-calculus

Simply Typed λ-calculus Simply Typed λ-calculus Lecture 2 Jeremy Dawson The Australian National University Semester 2, 2017 Jeremy Dawson (ANU) COMP4630,Lecture 2 Semester 2, 2017 1 / 19 Outline Properties of Curry type system:

More information

Simulations and Bisimulations for Coalgebraic Modal Logics

Simulations and Bisimulations for Coalgebraic Modal Logics Simulations and Bisimulations for Coalgebraic Modal Logics Daniel Gorín and Lutz Schröder Department of Computer Science, Universität Erlangen-Nürnberg Abstract. Simulations serve as a proof tool to compare

More information

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus CS 4110 Programming Languages & Logics Lecture 16 Programming in the λ-calculus 30 September 2016 Review: Church Booleans 2 We can encode TRUE, FALSE, and IF, as: TRUE λx. λy. x FALSE λx. λy. y IF λb.

More information

Lazy Strong Normalization

Lazy Strong Normalization Lazy Strong Normalization Luca Paolini 1,2 Dipartimento di Informatica Università di Torino (ITALIA) Elaine Pimentel 1,2 Departamento de Matemática Universidade Federal de Minas Gerais (BRASIL) Dipartimento

More information

Logic and Probability Lecture 3: Beyond Boolean Logic

Logic and Probability Lecture 3: Beyond Boolean Logic Logic and Probability Lecture 3: Beyond Boolean Logic Wesley Holliday & Thomas Icard UC Berkeley & Stanford August 13, 2014 ESSLLI, Tübingen Wesley Holliday & Thomas Icard: Logic and Probability, Lecture

More information

arxiv: v1 [cs.lo] 29 May 2014

arxiv: v1 [cs.lo] 29 May 2014 An Introduction to the Clocked Lambda Calculus Jörg Endrullis, Dimitri Hendriks, Jan Willem Klop, and Andrew Polonsky VU University Amsterdam, The Netherlands Abstract We give a brief introduction to the

More information

Typed Arithmetic Expressions

Typed Arithmetic Expressions Typed Arithmetic Expressions CS 550 Programming Languages Jeremy Johnson TAPL Chapters 3 and 5 1 Types and Safety Evaluation rules provide operational semantics for programming languages. The rules provide

More information

Communication Problems in the 7r-Calculus. M. R. F. Benevides* F. Prottit

Communication Problems in the 7r-Calculus. M. R. F. Benevides* F. Prottit Communication Problems in the 7r-Calculus M. R. F. Benevides* F. Prottit Abstract In this paper we deal with the notions of deadlock, starvation, and communication errors in the asynchronous polyadic 7f-calculus.

More information

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. Lunch-time meeting, 14 May Oxford University Computing Laboratory

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. Lunch-time meeting, 14 May Oxford University Computing Laboratory The Safe λ-calculus William Blum Joint work with C.-H. Luke Ong Oxford University Computing Laboratory Lunch-time meeting, 14 May 2007 Overview Safety is originally a syntactic restriction for higher-order

More information

Coinductive big-step operational semantics

Coinductive big-step operational semantics Coinductive big-step operational semantics Xavier Leroy a, Hervé Grall b a INRIA Paris-Rocquencourt Domaine de Voluceau, B.P. 105, 78153 Le Chesnay, France b École des Mines de Nantes La Chantrerie, 4,

More information