Subtyping. Preciseness of Subtyping on Intersection and Union Types. Subtyping. Silvia Ghilezan. Joint work with Mariangiola Dezani-Ciancaglini

Size: px
Start display at page:

Download "Subtyping. Preciseness of Subtyping on Intersection and Union Types. Subtyping. Silvia Ghilezan. Joint work with Mariangiola Dezani-Ciancaglini"

Transcription

1 Subtyping Preciseness of Subtyping on Intersection and Union Types Silvia Ghilezan University of Novi Sad Serbia Université Paris Diderot, 21 April 2016 Joint work with Mariangiola Dezani-Ciancaglini M. Dezani-Ciancaglini and SG. Preciseness of subtyping on intersection and union types. In RTA-TLCA 2014, volume 8560 of LNCS, pages (2014). 1/27 2/27 Subtyping Subtyping is a binary relation apple (preorder) on the set of Types apple Subsumption rule in the type inference system M : apple M : -calculi, concurrent calculi programming languages 3/27 4/27

2 Preciseness of subtyping Preciseness Soundness Completeness Two aspects: Denotational preciseness Operational preciseness 5/27 6/27 Denotational Preciseness of Subtyping [[ ]] is a set interpreting type denotational soundness: apple implies [[ ]] [[ ]] denotational completeness: [[ ]] [[ ]] implies denotational preciseness: apple iff [[ ]] [[ ]] apple H. Barendregt, M. Coppo, and M. Dezani-Ciancaglini. A Filter Lambda Model and the Completeness of Type Assignment. Journal of Symbolic Logic, 48(4): , J. Vouillon. Subtyping Union Types. In CSL, volume 3210 of LNCS, pages , Operational Soundness of Subtyping If apple, then each context that is safe when filled with a term of type is also safe when filled with a term of type 8C[ ](8M : C[M] 6! error =) 8N : C[N] 6! error) Example. nat apple int C[ Subsumption rule in the type system 5] converges, then C[2] converges M : M : apple Operational soundness of subtyping follows from subject reduction of the type system 7/27 8/27

3 Operational Completeness of Subtyping Converse: If each context that is safe when filled with a term of type is also safe when filled with a term of type, then apple Instead: If 6apple, then there is a context that is safe when filled with an arbitrary term of type, and gives an error when filled with a suitable term of type 9C 0 [](8M :. C 0 [M] 6! error V 9N 0 :.C 0 [N 0 ]! error) Operational Preciseness of Subtyping apple iff for each context soundness and completeness that is safe when filled with a term of type is also safe when filled with a term of type 8C[ ](8M :. C[M] 6! error =) 8N :. C[N] 6! error) apple iff there is no context that is safe when filled with an arbitrary term of type and gives an error when filled with a suitable term of type 9C 0 [](8M :. C 0 [M] 6! error V 9N 0 : C 0 [M 0 ]! error ) J. Blackburn, I. Hernandez, J. Ligatti, and M. Nachtigal. Completely subtyping iso-recursive types. Technical Report, University of South Florida, /27 10/27 Concurrent -calculus - Syntax M. Dezani-Ciancaglini, U. de Liguoro, and A. Piperno. A Filter Model for Concurrent Lambda-Calculus. SIAM Journal on Computing 27(5): , M ::= x v ( x.m) ( v.m) (MM) (M + M) (MkM) 1 call-by-name and call-by-value variables 2 internal choice 3 parallel operator W ::= v x.m v.m W kw TVal total values: V ::= W V km MkV Val values 11/27 12/27

4 w ' y ' Reduction rules (+ L ) M + N! M (+ R ) M + N! N (k app )(MkN)L! MLkNL (k s ) M! M0 N! N 0 MkN! M 0 kn 0 (k a ) M! M 0 W 2TVal MkW! M 0 kw, W km! W km 0 ( )( x.m)n! M[N/x] ( v ) W 2 TVal ( v.m)w! M[W /v] V! V 0 V 2 Val ( v k) ( v.m)v! M[V /v]k( v.m)v 0 N! N 0 N 62 Val (µ v ) ( v.m)n! ( v.m)n 0 ( ) M! S M0 M 62 Val Par MN! M 0 N TVal total values: W ::= v x.m v.m W kw Val values V ::= W V km MkV Par = {MkN} 13/27 Types and Subtyping Convergence reduction tree P = x.(x + I) Q =( x.p(xx))( x.p(xx)) Bar is a subset of nodes of the reduction tree such that each maximal path intersects the bar at exactly one node a term converges if there is a bar of values in its reduction tree IIk Ik... Typing Rules IIk + Kk Kk Kk... YP Q PQ Q + I y " Q I PQ Q + I YP 14/27 Type: ::=!! ^ _ apple is the smallest pre-order on types such that A basis maps 1 call-by-name variables to types (! by default) and 2 call-by-value variables to coprime types (!!! by default) 1 htype, applei is a distributive lattice, in which ^ is the meet, _ is the join and! is the top; 2 the arrow satisfies 1!! apple!!!; 2 (! ) ^ (! ) apple! ^ ; 3 0, apple 0 )! apple 0! 0. (! I v ) (Ax) ` : ( ) (!)! (! I n ), x : ` x.m :!, v : i = W i2i i i 2 CType i 2 I ` v.m :! CType: a type is coprime if apple _ implies apple or apple (! E)! ` N : ` MN : Each type is equal to an union of coprime types. (^ I) ^ (apple) apple 15/27 (+ I) ` M + N : ` N : _ (k I) ` MkN : ` N : ^ 16/27

5 Characterisation of Convergence Each type is either a subtype of!!! or it is equivalent to!. Theorem (Type preservation) The type system enjoys subject reduction. Theorem A closed term is convergent iff it has type!!!. Corollary A closed term is divergent iff it has only types equivalent to!. Unsoundness of (! ) ^ (! ) apple _! =!!! =!!! =!!! ` x.xi k x.x I :(! )! (! ) and ` K + O : _ ` ( x.xi k x.x I)(K + O) : (=!!!) ( x.xi k x. I)(K + O)! (K + O)I k(k + O) I)! OI kk I! k k diverges 6` k :!!! subject reduction fails! 17/27 18/27 Preciseness for the Concurrent -calculus The subtyping apple is denotationally precise when apple if and only if [[ ]] [[ ]] The subtyping apple is operationally precise when apple if and only if there is no closed terms M 0 such that M 0 P converges for all closed terms P : and for some N 0 : the term M 0 N 0 diverges 9M 0 [](8P :. M 0 P conveges ^ 9N 0 :. M 0 N 0 diverges ) 19/27 20/27

6 Operational preciseness for the Concurrent key terms -calculus Theorem The subtyping apple is denotationally precise for the concurrent -calculus. R! = ; T! = xy.y; R! = x.(t x) R ; T! = v.t (v R ); R ^ = R k R ; T ^ = x.(t x + T x); R _ = R + R. T _ = v.(t v k T v) where _ 6=!. [[ ]] = {M } Theorem The subtyping apple is operationally precise for the concurrent -calculus. R characteristic term is the worst (with respect to convergence) term of type R has type iff apple test term T M (M closed) converges (to I) iff M has type T has type!! iff apple 21/27 22/27 Preciseness for Pure -Calculus Operational completeness requires that all empty (i.e. not inhabited) types are less than all inhabited types Inhabitation is undecidable for polymorphic types and for intersection types A complete subtyping on polymorphic types or on intersection types for the pure -calculus must be undecidable This makes unfeasible an operationally complete subtyping for the pure -calculus, both in case of polymorphic types and intersection and union types The terms of the concurrent -calculus inhabit all types Open problem: to study the extensions of -calculus enjoying operational preciseness for the decidable subtyping between polymorphic types 23/27 24/27

7 Related work J. Blackburn, I. Hernandez, J. Ligatti, and M. Nachtigal. Completely subtyping iso-recursive types. Technical Report, University of South Florida, T. Chen, M. Dezani-Ciancaglini, and N. Yoshida. On the Preciseness of Subtyping in Session Types. In PPDP 2014, , M. Dezani-Ciancaglini, SG, S. Jaksic, J. Pantovic and N. Yoshida. Precise subtyping for synchronous multiparty sessions. In PLACES 2015, EPTCS 203:29 43, TYPES 2016, May 23-27, 2016, Novi Sad TYPES nd International Conference on Types for Proofs and Programs Affiliated events: CLA 2016, EUTYPES 2016 Novi Sad, Serbia May 23-27, M. Dezani-Ciancaglini, SG, S. Jaksic, J. Pantovic and N. Yoshida. Denotational and Operational Preciseness of Subtyping: A Roadmap. In Theory and Practice of Formal Methods 2016, LNCS 9660: , /27 26/27 Thanks 27/27

Type systems. Types in access control and privacy. Outline. 1. Dynamic Web Data. p-calculus Dp XDp

Type systems. Types in access control and privacy. Outline. 1. Dynamic Web Data. p-calculus Dp XDp Type systems Types in access control and privacy Silvia Ghilezan University of Novi Sad NII Shonan Meeting 069 LOGIC AND VERIFICATION METHODS IN SECURITY AND PRIVACY October 26-29, 2015 Types have gained

More information

Reducibility method: an overview

Reducibility method: an overview Reducibility method: an overview Silvia Ghilezan University of Novi Sad, Serbia LAP 2013, Dubrovnik, September 16-21, 2013 S. Ghilezan Reducibility method LAP 2013 1 / 35 In collaboration with (alphabetic

More information

Recursive Types and Subtyping

Recursive Types and Subtyping Recursive Types and Subtyping #1 One-Slide Summary Recursive types (e.g., list) make the typed lambda calculus as powerful as the untyped lambda calculus. If is a subtype of then any expression of type

More information

Symmetry in Type Theory

Symmetry in Type Theory Google May 29th, 2012 What is Symmetry? Definition Symmetry: Two or more things that initially look distinct, may actually be instances of a more general underlying principle. Why do we care? Simplicity.

More information

Intersections and Unions of Session Types

Intersections and Unions of Session Types Intersections and Unions of Session Types Coşku Acay Frank Pfenning Carnegie Mellon University School of Computer Science ITRS 2016 C. Acay & F. Pfenning (CMU) Intersections and Unions of Session Types

More information

Denotational Semantics. Domain Theory

Denotational Semantics. Domain Theory Denotational Semantics and Domain Theory 1 / 51 Outline Denotational Semantics Basic Domain Theory Introduction and history Primitive and lifted domains Sum and product domains Function domains Meaning

More information

Part III. Chapter 15: Subtyping

Part III. Chapter 15: Subtyping Part III Chapter 15: Subtyping Subsumption Subtype relation Properties of subtyping and typing Subtyping and other features Intersection and union types Subtyping Motivation With the usual typing rule

More information

Part III Chapter 15: Subtyping

Part III Chapter 15: Subtyping Part III Chapter 15: Subtyping Subsumption Subtype relation Properties of subtyping and typing Subtyping and other features Intersection and union types Subtyping Motivation With the usual typing rule

More information

Subsumption. Principle of safe substitution

Subsumption. Principle of safe substitution Recap on Subtyping Subsumption Some types are better than others, in the sense that a value of one can always safely be used where a value of the other is expected. Which can be formalized as by introducing:

More information

Semantic Subtyping. Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud)

Semantic Subtyping.  Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) Semantic Subtyping Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) http://www.cduce.org/ Semantic Subtyping - Groupe de travail BD LRI p.1/28 CDuce A functional

More information

Definability and full abstraction in lambda-calculi

Definability and full abstraction in lambda-calculi Definability and full abstraction in lambda-calculi Antonio Bucciarelli Laboratoire Preuves, Programmes et Systèmes Université Paris Diderot Outline 1 Introduction 2 The full abstraction problem for PCF

More information

Dependent Object Types - A foundation for Scala s type system

Dependent Object Types - A foundation for Scala s type system Dependent Object Types - A foundation for Scala s type system Draft of September 9, 2012 Do Not Distrubute Martin Odersky, Geoffrey Alan Washburn EPFL Abstract. 1 Introduction This paper presents a proposal

More information

Lecture slides & distribution files:

Lecture slides & distribution files: Type Theory Lecture slides & distribution files: http://www.cs.rhul.ac.uk/home/zhaohui/ttlectures.html Zhaohui Luo Department of Computer Science Royal Holloway, University of London April 2011 2 Type

More information

Official Survey. Cunning Plan: Focus On Objects. The Need for a Calculus. Object Calculi Summary. Why Not Use λ-calculus for OO?

Official Survey. Cunning Plan: Focus On Objects. The Need for a Calculus. Object Calculi Summary. Why Not Use λ-calculus for OO? Modeling and Understanding Object-Oriented Oriented Programming Official Survey Please fill out the Toolkit course survey 40142 CS 655-1 Apr-21-2006 Midnight May-04-2006 9am Why not do it this evening?

More information

Power Set of a set and Relations

Power Set of a set and Relations Power Set of a set and Relations 1 Power Set (1) Definition: The power set of a set S, denoted P(S), is the set of all subsets of S. Examples Let A={a,b,c}, P(A)={,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}

More information

Programming Language Concepts: Lecture 19

Programming Language Concepts: Lecture 19 Programming Language Concepts: Lecture 19 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 19, 01 April 2009 Adding types

More information

Lambda Calculi With Polymorphism

Lambda Calculi With Polymorphism Resources: The slides of this lecture were derived from [Järvi], with permission of the original author, by copy & x = 1 let x = 1 in... paste or by selection, annotation, or rewording. [Järvi] is in turn

More information

Recursive Types and Subtyping

Recursive Types and Subtyping Recursive Types and Subtyping #1 One-Slide Summary Recall: Recursive types (e.g., τ list) make the typed lambda calculus as powerful as the untyped lambda calculus. If τ is a subtype of σ then any expression

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Ocaml/HW #3 Q-A Session Push deadline = Mar 10 Session Mon 3pm? Lecture 15: Type Systems Ranjit Jhala UC San Diego Why Typed Languages? Development

More information

Generalised recursion and type inference for intersection types p.1

Generalised recursion and type inference for intersection types p.1 Generalised recursion and type inference for intersection types Seminar for Comete May 4th, 2004 Pascal Zimmer INRIA Sophia Antipolis Generalised recursion and type inference for intersection types p.1

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

Constrained Types and their Expressiveness

Constrained Types and their Expressiveness Constrained Types and their Expressiveness JENS PALSBERG Massachusetts Institute of Technology and SCOTT SMITH Johns Hopkins University A constrained type consists of both a standard type and a constraint

More information

Types for References, Exceptions and Continuations. Review of Subtyping. Γ e:τ τ <:σ Γ e:σ. Annoucements. How s the midterm going?

Types for References, Exceptions and Continuations. Review of Subtyping. Γ e:τ τ <:σ Γ e:σ. Annoucements. How s the midterm going? Types for References, Exceptions and Continuations Annoucements How s the midterm going? Meeting 21, CSCI 5535, Spring 2009 2 One-Slide Summary Review of Subtyping If τ is a subtype of σ then any expression

More information

Subtyping. Lecture 13 CS 565 3/27/06

Subtyping. Lecture 13 CS 565 3/27/06 Subtyping Lecture 13 CS 565 3/27/06 Polymorphism Different varieties of polymorphism: Parametric (ML) type variables are abstract, and used to encode the fact that the same term can be used in many different

More information

Subject Reduction vs Intersection / Union Types in λµ µ

Subject Reduction vs Intersection / Union Types in λµ µ Subject Reduction vs Intersection / Union Types in λµ µ Extended abstract Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK, svb@doc.ic.ac.uk Abstract.

More information

Less naive type theory

Less naive type theory Institute of Informatics Warsaw University 26 May 2007 Plan 1 Syntax of lambda calculus Why typed lambda calculi? 2 3 Syntax of lambda calculus Why typed lambda calculi? origins in 1930s (Church, Curry)

More information

Intersection and Union Types in the

Intersection and Union Types in the Electronic Notes in Theoretical Computer Science 136 (2005) 153 172 www.elsevier.com/locate/entcs Intersection and Union Types in the λµ µ-calculus Daniel J. Dougherty 1 Worcester Polytechnic Institute

More information

Lambda Calculi With Polymorphism

Lambda Calculi With Polymorphism Resources: The slides of this lecture were derived from [Järvi], with permission of the original author, by copy & x = 1 let x = 1 in... paste or by selection, annotation, or rewording. [Järvi] is in turn

More information

Sound and Complete Typing for λµ

Sound and Complete Typing for λµ Sound and Complete Typing for Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK s.vanbakel@imperial.ac.uk In this paper we define intersection and

More information

A Typed Lambda Calculus for Input Sanitation

A Typed Lambda Calculus for Input Sanitation A Typed Lambda Calculus for Input Sanitation Nathan Fulton Carthage College nfulton@carthage.edu April 11, 2013 Abstract Programmers often wish to validate or sanitize user input. One common approach to

More information

Subject Reduction vs Intersection / Union Types in λµ µ

Subject Reduction vs Intersection / Union Types in λµ µ Subject Reduction vs Intersection / Union Types in λµ µ INTRODUCTION Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK svb@docicacuk The role of Classical

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 12/02/2013 OCaml 1 Acknowledgement The material on these slides is based on notes provided by Dexter Kozen. 2 About OCaml A functional programming language All computation

More information

Proofs-Programs correspondance and Security

Proofs-Programs correspondance and Security Proofs-Programs correspondance and Security Jean-Baptiste Joinet Université de Lyon & Centre Cavaillès, École Normale Supérieure, Paris Third Cybersecurity Japanese-French meeting Formal methods session

More information

Chapter 21: Metatheory of Recursive Types. Induction and Coinduction Finite and Infinite Types/Subtyping Membership Checking

Chapter 21: Metatheory of Recursive Types. Induction and Coinduction Finite and Infinite Types/Subtyping Membership Checking Chapter 21: Metatheory of Recursive Types Induction and Coinduction Finite and Infinite Types/Subtyping Membership Checking Review of Chapter 20 Recursive Types Lists NatList =

More information

Runtime Behavior of Conversion Interpretation of Subtyping

Runtime Behavior of Conversion Interpretation of Subtyping Runtime Behavior of Conversion Interpretation of Subtyping Yasuhiko Minamide Institute of Information Sciences and Electronics University of Tsukuba and PRESTO, JST minamide@is.tsukuba.ac.jp Abstract.

More information

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning Refinement Types as Proof Irrelevance William Lovas with Frank Pfenning Overview Refinement types sharpen existing type systems without complicating their metatheory Subset interpretation soundly and completely

More information

Type checking in the presence of meta-variables

Type checking in the presence of meta-variables Type checking in the presence of meta-variables Ulf Norell and Catarina Coquand Department of Computer Science and Engineering Chalmers University of Technology {ulfn,catarina}@cs.chalmers.se Abstract.

More information

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the The Semi-Full Closure of Pure Type Systems? Gilles Barthe Institutionen for Datavetenskap, Chalmers Tekniska Hogskola, Goteborg, Sweden Departamento de Informatica, Universidade do Minho, Braga, Portugal

More information

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. BCTCS, 2 5 April Oxford University Computing Laboratory

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. BCTCS, 2 5 April Oxford University Computing Laboratory The Safe λ-calculus William Blum Joint work with C.-H. Luke Ong Oxford University Computing Laboratory BCTCS, 2 5 April 2007 Overview Safety: a restriction for higher-order grammars. Transposed to the

More information

Static Contract Checking for Haskell

Static Contract Checking for Haskell Static Contract Checking for Haskell Dana N. Xu INRIA France Work done at University of Cambridge Simon Peyton Jones Microsoft Research Cambridge Joint work with Koen Claessen Chalmers University of Technology

More information

Session Types for Object-Oriented Languages

Session Types for Object-Oriented Languages Introduction Basics Conditional SoS Meth Operational Semantics Connect Operational Semantics Interactions Typing Properties Future Work p. 1/1 Session Types for Object-Oriented Languages Dimitris Mostrous

More information

Lambda Calculus. Type Systems, Lectures 3. Jevgeni Kabanov Tartu,

Lambda Calculus. Type Systems, Lectures 3. Jevgeni Kabanov Tartu, Lambda Calculus Type Systems, Lectures 3 Jevgeni Kabanov Tartu, 13.02.2006 PREVIOUSLY ON TYPE SYSTEMS Arithmetical expressions and Booleans Evaluation semantics Normal forms & Values Getting stuck Safety

More information

Theories of Information Hiding in Lambda-Calculus

Theories of Information Hiding in Lambda-Calculus Theories of Information Hiding in Lambda-Calculus Logical Relations and Bisimulations for Encryption and Type Abstraction Eijiro Sumii University of Pennsylvania Main Results Proof methods for two forms

More information

Second-Order Type Systems

Second-Order Type Systems #1 Second-Order Type Systems Homework 5 Summary Student : 37.9704 Student : 44.4466 ORIGINAL : 50.2442 Student : 50.8275 Student : 50.8633 Student : 50.9181 Student : 52.1347 Student : 52.1633 Student

More information

Uncurrying for Termination

Uncurrying for Termination Uncurrying for Termination Nao Hirokawa and Aart Middeldorp Institute of Computer Science University of Innsbruck 6020 Innsbruck, Austria {nao.hirokawa,aart.middeldorp}@uibk.ac.at Abstract. In this note

More information

Type Inference with Inequalities

Type Inference with Inequalities Type Inference with Inequalities Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department Aarhus University Ny Munkegade DK-8000 Århus C, Denmark Abstract Type inference can be phrased as constraint-solving

More information

TRELLYS and Beyond: Type Systems for Advanced Functional Programming

TRELLYS and Beyond: Type Systems for Advanced Functional Programming TRELLYS and Beyond: Type Systems for Advanced Functional Programming Aaron Stump Computer Science The University of Iowa Joint work with Tim Sheard, Vilhelm Sjöberg, and Stephanie Weirich. Supported by

More information

9.5 Equivalence Relations

9.5 Equivalence Relations 9.5 Equivalence Relations You know from your early study of fractions that each fraction has many equivalent forms. For example, 2, 2 4, 3 6, 2, 3 6, 5 30,... are all different ways to represent the same

More information

Verifying Program Invariants with Refinement Types

Verifying Program Invariants with Refinement Types Verifying Program Invariants with Refinement Types Rowan Davies and Frank Pfenning Carnegie Mellon University Princeton and Yale Colloquium Talks February, 2001 Acknowledgments: Robert Harper 1 Overview

More information

Typed Lambda Calculus. Chapter 9 Benjamin Pierce Types and Programming Languages

Typed Lambda Calculus. Chapter 9 Benjamin Pierce Types and Programming Languages Typed Lambda Calculus Chapter 9 Benjamin Pierce Types and Programming Languages t ::= x x. t t t Call-by-value small step perational Semantics terms variable v ::= values abstraction x. t abstraction values

More information

Functional Logic Programming: From Theory to Curry

Functional Logic Programming: From Theory to Curry Functional Logic Programming: From Theory to Curry Michael Hanus Institut für Informatik, CAU Kiel, D-24098 Kiel, Germany. mh@informatik.uni-kiel.de Abstract. Functional logic programming languages combine

More information

Type Systems COMP 311 Rice University Houston, Texas

Type Systems COMP 311 Rice University Houston, Texas Rice University Houston, Texas 1 Type Systems for Programming Language were invented by mathematicians before electronic computers were invented. What is a type? A meaningful subset of the set of the domain

More information

Mathematics for Computer Scientists 2 (G52MC2)

Mathematics for Computer Scientists 2 (G52MC2) Mathematics for Computer Scientists 2 (G52MC2) L07 : Operations on sets School of Computer Science University of Nottingham October 29, 2009 Enumerations We construct finite sets by enumerating a list

More information

COMP80 Lambda Calculus Programming Languages Slides Courtesy of Prof. Sam Guyer Tufts University Computer Science History Big ideas Examples:

COMP80 Lambda Calculus Programming Languages Slides Courtesy of Prof. Sam Guyer Tufts University Computer Science History Big ideas Examples: COMP80 Programming Languages Slides Courtesy of Prof. Sam Guyer Lambda Calculus Formal system with three parts Notation for functions Proof system for equations Calculation rules called reduction Idea:

More information

Lecture 13: Subtyping

Lecture 13: Subtyping Lecture 13: Subtyping Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Programming Languages Pratikakis (CSD) Subtyping CS546, 2018-2019 1 / 15 Subtyping Usually found

More information

CSE 505, Fall 2008, Final Examination 11 December Please do not turn the page until everyone is ready.

CSE 505, Fall 2008, Final Examination 11 December Please do not turn the page until everyone is ready. CSE 505, Fall 2008, Final Examination 11 December 2008 Please do not turn the page until everyone is ready. Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.

More information

Goal. CS152: Programming Languages. Lecture 15 Parametric Polymorphism. What the Library Likes. What The Client Likes. Start simpler.

Goal. CS152: Programming Languages. Lecture 15 Parametric Polymorphism. What the Library Likes. What The Client Likes. Start simpler. Goal Understand what this interface means and why it matters: CS152: Programming Languages Lecture 15 Parametric Polymorphism Dan Grossman Spring 2011 type a mylist; val mt_list : a mylist val cons : a

More information

Programming Languages Lecture 15: Recursive Types & Subtyping

Programming Languages Lecture 15: Recursive Types & Subtyping CSE 230: Winter 2008 Principles of Programming Languages Lecture 15: Recursive Types & Subtyping Ranjit Jhala UC San Diego News? Formalize first-order type systems Simple types (integers and booleans)

More information

Programming Languages Fall 2014

Programming Languages Fall 2014 Programming Languages Fall 2014 Lecture 7: Simple Types and Simply-Typed Lambda Calculus Prof. Liang Huang huang@qc.cs.cuny.edu 1 Types stuck terms? how to fix it? 2 Plan First I For today, we ll go back

More information

Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes

Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes Processes as Types: A Generic Framework of Behavioral Type Systems for Concurrent Processes Atsushi Igarashi (Kyoto Univ.) based on joint work [POPL2001, TCS2003] with Naoki Kobayashi (Tohoku Univ.) Programming

More information

Conservative Concurrency in Haskell

Conservative Concurrency in Haskell Conservative Concurrency in Haskell David Sabel and Manfred Schmidt-Schauß Goethe-University, Frankfurt am Main, Germany LICS 12, Dubrovnik, Croatia Motivation a View on Haskell Purely functional core

More information

Featherweight Java (FJ)

Featherweight Java (FJ) x = 1 let x = 1 in... x(1).!x(1) x.set(1) Programming Language Theory Featherweight Java (FJ) Ralf Lämmel This lecture is based on David Walker s lecture: Computer Science 441, Programming Languages, Princeton

More information

Software System Design and Implementation

Software System Design and Implementation Software System Design and Implementation Motivation & Introduction Gabriele Keller (Manuel M. T. Chakravarty) The University of New South Wales School of Computer Science and Engineering Sydney, Australia

More information

The Untyped Lambda Calculus

The Untyped Lambda Calculus Resources: The slides of this lecture were derived from x = 1 [Järvi], with permission of the original author, by copy & let x = 1 in... paste or by selection, annotation, or rewording. [Järvi] is in turn

More information

Type Systems. Today. 1. Organizational Matters. 1. Organizational Matters. Lecture 1 Oct. 20th, 2004 Sebastian Maneth. 1. Organizational Matters

Type Systems. Today. 1. Organizational Matters. 1. Organizational Matters. Lecture 1 Oct. 20th, 2004 Sebastian Maneth. 1. Organizational Matters Today Type Systems 1. Organizational Matters 2. What is this course about? 3. Where do types come from? 4. Def. of the small language Expr. Its syntax and semantics. Lecture 1 Oct. 20th, 2004 Sebastian

More information

Type Systems. Parametric Polymorphism. 1. Recall Let-Polymorphism. 1. Recall Let-Polymorphism. Lecture 9 Dec. 15th, 2004 Sebastian Maneth

Type Systems. Parametric Polymorphism. 1. Recall Let-Polymorphism. 1. Recall Let-Polymorphism. Lecture 9 Dec. 15th, 2004 Sebastian Maneth Today Parametric Polymorphism Type Systems Lecture 9 Dec. 15th, 2004 Sebastian Maneth 1. Recall Let-Polymorphism 4. System F-sub 5. Properties of F-sub http://lampwww.epfl.ch/teaching/typesystems/2004

More information

Type Inference with Recursive Type Equations

Type Inference with Recursive Type Equations Type Inference with Recursive Type Equations Mario Coppo Dipartimento di Informatica, Università di Torino, Corso Svizzera 185, 10149 Torino, Italy coppo@di.unito.it http://www.di.unito.it/ coppo Abstract.

More information

Resources: The slides of this lecture were derived from [Järvi], with permission of the original author, by copy & x = 1 let x = 1 in...

Resources: The slides of this lecture were derived from [Järvi], with permission of the original author, by copy & x = 1 let x = 1 in... Resources: The slides of this lecture were derived from [Järvi], with permission of the original author, by copy & x = 1 let x = 1 in... paste or by selection, annotation, or rewording. [Järvi] is in turn

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science D3. GOTO-Computability Malte Helmert University of Basel April 25, 2016 Overview: Computability Theory Computability Theory imperative models of computation: D1. Turing-Computability

More information

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 9 Simply Typed Lambda Calculus Dan Grossman 2012 Types Major new topic worthy of several lectures: Type systems Continue to use (CBV) Lambda Caluclus as our

More information

Operationally Sound Update

Operationally Sound Update Outline Operationally Sound Update Luca Cardelli Digital Equipment Corporation Systems Research Center The type rules necessary for Òsufficiently polymorphicó update operations on records and objects are

More information

The Typed λ Calculus and Type Inferencing in ML

The Typed λ Calculus and Type Inferencing in ML Notes on Types S. Arun-Kumar Department of Computer Science and Engineering Indian Institute of Technology New Delhi, 110016 email: sak@cse.iitd.ernet.in April 14, 2002 2 Chapter 1 The Typed λ Calculus

More information

Section 17. Closed Sets and Limit Points

Section 17. Closed Sets and Limit Points 17. Closed Sets and Limit Points 1 Section 17. Closed Sets and Limit Points Note. In this section, we finally define a closed set. We also introduce several traditional topological concepts, such as limit

More information

Type Checking and Inference Are Equivalent in Lambda Calculi with Existential Types

Type Checking and Inference Are Equivalent in Lambda Calculi with Existential Types Type Checking and Inference Are Equivalent in Lambda Calculi with Existential Types Yuki Kato and Koji Nakazawa Graduate School of Informatics, Kyoto University, Kyoto 606-8501, Japan Abstract. This paper

More information

Types and Programming Languages. Lecture 8. Recursive type

Types and Programming Languages. Lecture 8. Recursive type Types and Programming Languages Lecture 8. Recursive type Xiaojuan Cai cxj@sjtu.edu.cn BASICS Lab, Shanghai Jiao Tong University Fall, 2016 List[T] List[T] is a type constructor whose elements are lists

More information

Advanced Programming Methods. Introduction in program analysis

Advanced Programming Methods. Introduction in program analysis Advanced Programming Methods Introduction in program analysis What is Program Analysis? Very broad topic, but generally speaking, automated analysis of program behavior Program analysis is about developing

More information

Dependent Object Types - A foundation for Scala's type system

Dependent Object Types - A foundation for Scala's type system Dependent Object Types - A foundation for Scala's type system Draft of January 14, 2010 Do Not Distrubute Martin Odersky, Georey Alan Washburn EPFL Abstract. 1 Introduction This paper presents a proposal

More information

Algorithms for the Construction of Digital Convex Fuzzy Hulls

Algorithms for the Construction of Digital Convex Fuzzy Hulls lgorithms for the Construction of Digital Convex Fuzzy Hulls Nebojša M. Ralević Faculty of Engineering, University of Novi Sad Trg Dositeja Obradovića 6, 000 Novi Sad, Serbia nralevic@uns.ns.ac.yu Lidija

More information

ROUGH MEMBERSHIP FUNCTIONS: A TOOL FOR REASONING WITH UNCERTAINTY

ROUGH MEMBERSHIP FUNCTIONS: A TOOL FOR REASONING WITH UNCERTAINTY ALGEBRAIC METHODS IN LOGIC AND IN COMPUTER SCIENCE BANACH CENTER PUBLICATIONS, VOLUME 28 INSTITUTE OF MATHEMATICS POLISH ACADEMY OF SCIENCES WARSZAWA 1993 ROUGH MEMBERSHIP FUNCTIONS: A TOOL FOR REASONING

More information

Sequence Types for the π-calculus

Sequence Types for the π-calculus ITRS 2004 Preliminary Version Sequence Types for the π-calculus Sergio Maffeis 1 Department of Computing, Imperial College London, London SW7 2AZ, United Kingdom. Abstract We introduce channel sequence

More information

Greedy Algorithms. Algorithms

Greedy Algorithms. Algorithms Greedy Algorithms Algorithms Greedy Algorithms Many algorithms run from stage to stage At each stage, they make a decision based on the information available A Greedy algorithm makes decisions At each

More information

Formal Systems and their Applications

Formal Systems and their Applications Formal Systems and their Applications Dave Clarke (Dave.Clarke@cs.kuleuven.be) Acknowledgment: these slides are based in part on slides from Benjamin Pierce and Frank Piessens 1 Course Overview Introduction

More information

Basic Foundations of Isabelle/HOL

Basic Foundations of Isabelle/HOL Basic Foundations of Isabelle/HOL Peter Wullinger May 16th 2007 1 / 29 1 Introduction into Isabelle s HOL Why Type Theory Basic Type Syntax 2 More HOL Typed λ Calculus HOL Rules 3 Example proof 2 / 29

More information

Johns Hopkins Math Tournament Proof Round: Point Set Topology

Johns Hopkins Math Tournament Proof Round: Point Set Topology Johns Hopkins Math Tournament 2019 Proof Round: Point Set Topology February 9, 2019 Problem Points Score 1 3 2 6 3 6 4 6 5 10 6 6 7 8 8 6 9 8 10 8 11 9 12 10 13 14 Total 100 Instructions The exam is worth

More information

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018 Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters Corky Cartwright January 26, 2018 Denotational Semantics The primary alternative to syntactic semantics is denotational semantics.

More information

Syntactic Type Soundness for HM

Syntactic Type Soundness for HM Syntactic Type Soundness for HM Christian Skalka The Johns Hopkins University François Pottier INRIA Rocquencourt The system HM The system HM is a constraint based type framework: Sulzmann, PhD thesis

More information

1 Elementary number theory

1 Elementary number theory Math 215 - Introduction to Advanced Mathematics Spring 2019 1 Elementary number theory We assume the existence of the natural numbers and the integers N = {1, 2, 3,...} Z = {..., 3, 2, 1, 0, 1, 2, 3,...},

More information

Design Principles of Programming Languages. Recursive Types. Zhenjiang Hu, Haiyan Zhao, Yingfei Xiong Peking University, Spring Term, 2014

Design Principles of Programming Languages. Recursive Types. Zhenjiang Hu, Haiyan Zhao, Yingfei Xiong Peking University, Spring Term, 2014 Design Principles of Programming Languages Recursive Types Zhenjiang Hu, Haiyan Zhao, Yingfei Xiong Peking University, Spring Term, 2014 Review: Why learn type theories? Art vs. Knowledge Art cannot be

More information

On Fuzzy Topological Spaces Involving Boolean Algebraic Structures

On Fuzzy Topological Spaces Involving Boolean Algebraic Structures Journal of mathematics and computer Science 15 (2015) 252-260 On Fuzzy Topological Spaces Involving Boolean Algebraic Structures P.K. Sharma Post Graduate Department of Mathematics, D.A.V. College, Jalandhar

More information

Meeting13:Denotations

Meeting13:Denotations Meeting13:Denotations Announcements Homework 3 due next week Friday at 6:00pm Homework2Comments Time: 29.2 hours avg Difficulty: 5.4 avg Issues Length? (Part 2 out Wed instead of Mon) Misunderstanding

More information

1 Elementary number theory

1 Elementary number theory 1 Elementary number theory We assume the existence of the natural numbers and the integers N = {1, 2, 3,...} Z = {..., 3, 2, 1, 0, 1, 2, 3,...}, along with their most basic arithmetical and ordering properties.

More information

A Gentle Introduction to Program Analysis

A Gentle Introduction to Program Analysis A Gentle Introduction to Program Analysis Işıl Dillig University of Texas, Austin January 21, 2014 Programming Languages Mentoring Workshop 1 / 24 What is Program Analysis? Very broad topic, but generally

More information

Typed Lambda Calculus

Typed Lambda Calculus Department of Linguistics Ohio State University Sept. 8, 2016 The Two Sides of A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a system of notation for functions

More information

Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp (doi: / _5)

Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp (doi: / _5) Gay, S. J. (2016) Subtyping supports safe session substitution. Lecture Notes in Computer Science, 9600, pp. 95-108. (doi:10.1007/978-3-319-30936-1_5) This is the author s final accepted version. There

More information

Digital convex fuzzy hull

Digital convex fuzzy hull Digital convex fuzzy hull Slobodan Dražić, Svetlana Jakšić, Ljubo Nedović, Nebojša M. Ralević Faculty of Engineering, University of Novi Sad Trg Dositeja Obradovića 6, 21000 Novi Sad, Serbia and Montenegro

More information

2.8. Connectedness A topological space X is said to be disconnected if X is the disjoint union of two non-empty open subsets. The space X is said to

2.8. Connectedness A topological space X is said to be disconnected if X is the disjoint union of two non-empty open subsets. The space X is said to 2.8. Connectedness A topological space X is said to be disconnected if X is the disjoint union of two non-empty open subsets. The space X is said to be connected if it is not disconnected. A subset of

More information

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory Logic as a framework for NL semantics Semantic Theory Type Theory Manfred Pinkal Stefan Thater Summer 2007 Approximate NL meaning as truth conditions. Logic supports precise, consistent and controlled

More information

CS 671, Automated Reasoning

CS 671, Automated Reasoning CS 671, Automated Reasoning Lesson 20: Type Constructs based on Intersection (II): dependent records, abstract data types, basic algebra April 3, 2001 Last time we discussed record types and their representation

More information

On Generalization of Fuzzy Concept Lattices Based on Change of Underlying Fuzzy Order

On Generalization of Fuzzy Concept Lattices Based on Change of Underlying Fuzzy Order On Generalization of Fuzzy Concept Lattices Based on Change of Underlying Fuzzy Order Pavel Martinek Department of Computer Science, Palacky University, Olomouc Tomkova 40, CZ-779 00 Olomouc, Czech Republic

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information