Type Soundness for Path Polymorphism
|
|
- Maximilian Robinson
- 5 years ago
- Views:
Transcription
1 Type Soundness for Path Polymorphism Andrés Ezequiel Viso 1,2 joint work with Eduardo Bonelli 1,3 and Mauricio Ayala-Rincón 4 1 CONICET, Argentina 2 Departamento de Computación, FCEyN, UBA, Argentina 3 Departamento de Ciencia y Tecnología, UNQ, Argentina 4 Departamentos de Matemática e Ciência da Computação, UnB, Brasil Logic and Foundations of Programming Languages Day UBA, Buenos Aires, Argentina May 21, 2018 Andrés E. Viso Type Soundness for Path Polymorphism 1 / 17
2 Index 1 Motivations PPC Typing Error 2 Type System Compatibility Safety 3 Conclusions 4 Future Work Andrés E. Viso Type Soundness for Path Polymorphism 2 / 17
3 Pure Pattern Calculus Every data structure is either an atom or a compound built by application [Jay09] Devise a type system for PPC [JK09] Pattern Matching Example (Pattern Matching) map {map} f {f } ( nil {} nil cons (vl x) xs {x,xs} cons (vl (f x)) (map f xs) ) Andrés E. Viso Type Soundness for Path Polymorphism 3 / 17
4 Pure Pattern Calculus Every data structure is either an atom or a compound built by application [Jay09] Devise a type system for PPC [JK09] Pattern Matching Path Polymorphism Example (Generic update query) upd {upd} f {f } ( vl y {y} vl (f y) x y {x,y} (upd f x) (upd f y) w {w} w ) Andrés E. Viso Type Soundness for Path Polymorphism 3 / 17
5 Pure Pattern Calculus Every data structure is either an atom or a compound built by application [Jay09] Devise a type system for PPC [JK09] Pattern Matching Path Polymorphism Pattern Polymorphism Example (Generic update query) upd {upd} z {z} f {f } ( z y {y} z (f y) x y {x,y} (upd z f x) (upd z f y) w {w} w ) Andrés E. Viso Type Soundness for Path Polymorphism 3 / 17
6 Pure Pattern Calculus Every data structure is either an atom or a compound built by application [Jay09] Devise a type system for PPC [JK09] Pattern Matching Path Polymorphism Pattern Polymorphism Matching failure is handled explicitly Example (Generic update query) upd {upd} z {z} f {f } ( z y {y} z (f y) x y {x,y} (upd z f x) (upd z f y) w {w} w ) Andrés E. Viso Type Soundness for Path Polymorphism 3 / 17
7 Calculus of Applicative Patterns We focus on a static restriction of PPC we call CAP Static Patterns Built-in case constructor (handles matching failure) Path Polymorphism Example (Generic update query) upd {upd} f {f } ( vl y {y} vl (f y) x y {x,y} (upd f x) (upd f y) w {w} w ) Evaluation from left to right {u/p i } = fail for all i < j {u/p j } = σ j j 1..n (β) (p i θi s i ) i 1..n u σ j s j Andrés E. Viso Type Soundness for Path Polymorphism 4 / 17
8 Typing Error Patterns are partial descriptions of data structures [Jay09] Matching failure Typing error (nil {} true) (cons x nil) Not all applications (p θ s) u make sense p u c d c d t c q θ t p u p 1 p 2 d p 1 p 2 d t p 1 p 2 q θ t Andrés E. Viso Type Soundness for Path Polymorphism 5 / 17
9 Type System The type of the compound does not determine the type of the components [Jay09] Example t = c x {x:bool} if x then 1 else 0 c y {y:nat} y + 1 Singleton types (c) Type application (@) [Pet11] Union types ( ) Recursive types (µ) Bool true false Nat µx.zero X t : Bool Nat) Nat Andrés E. Viso Type Soundness for Path Polymorphism 6 / 17
10 Compatibility We take advantage of the evaluation order... Given (p θ s q θ t) If p q 1 then q θ t is a dead branch 1 p q iff σ.σp = q Andrés E. Viso Type Soundness for Path Polymorphism 7 / 17
11 Compatibility We take advantage of the evaluation order... Given (p θ s q θ t) If p q 1 then q θ t is a dead branch If not p π q π a. y restriction required b. c d no overlapping (q p) c. q 1 q 2 no overlapping d. y restriction required p 1 p e. 2 d no overlapping 1 p q iff σ.σp = q Andrés E. Viso Type Soundness for Path Polymorphism 7 / 17
12 Compatibility We take advantage of the evaluation order... Given (p θ s q θ t) If p q 1 then q θ t is a dead branch If not p π q π a. y restriction required b. c d no overlapping (q p) c. q 1 q 2 no overlapping d. y restriction required p 1 p e. 2 d no overlapping...and state this in the compatibility predicate, ovl(p : A, q : B). 1 p q iff σ.σp = q Andrés E. Viso Type Soundness for Path Polymorphism 7 / 17
13 Compatibility Example (Case a.) f {f :Bool A} ( vl z {z:bool} vl (f z) x y {x:vl,y:nat} x y ) p π q π a. y restriction required b. c d no overlapping (q p) c. q 1 q 2 no overlapping d. y restriction required p 1 p e. 2 d no overlapping Andrés E. Viso Type Soundness for Path Polymorphism 8 / 17
14 Compatibility Example (Case d.) f {f :vl Bool A} g {g:vl@nat A} ( x y {x:vl,y:bool} f x y z {z:vl@nat} g z ) p π q π a. y restriction required b. c d no overlapping (q p) c. q 1 q 2 no overlapping d. y restriction required p 1 p e. 2 d no overlapping Andrés E. Viso Type Soundness for Path Polymorphism 8 / 17
15 Compatibility Definition (Compatibility) p : A and q : B are compatible iff ovl(p : A, q : B) = B µ A Typing scheme (θ i p p i : A i ) i 1..n [p i : A i ] i 1..n compatible (Γ, θ i s i : B) i 1..n Γ (p i θi s i ) i 1..n : i 1..n A i B Andrés E. Viso Type Soundness for Path Polymorphism 9 / 17
16 Compatibility Lemma (Compatibility Lemma) Suppose Γ u : B, θ p p : A, θ p q : B and {u/p } is successful. Then, ovl(p : A, q : B) holds. Given a well-typed application (p θ s q θ t) u the lemma states that a branch should be more general than those to its left, or a dead branch otherwise (B µ A by compatibility). Andrés E. Viso Type Soundness for Path Polymorphism 10 / 17
17 Safety Reduction preserves typing Proposition (Subject Reduction) If Γ s : A and s s, then Γ s : A. And it does not get stuck Proposition (Progress) If s : A and s is not a value, then s s.t. s s. Andrés E. Viso Type Soundness for Path Polymorphism 11 / 17
18 Conclusions We proposed a type system for a calculus that supports path polymorphism The two fundamental properties were proved to hold: subject reduction and progress We developed a notion of pattern compatibility that turns out to be crucial for the achieved results Invertibility of subtyping of recursive types in the presence of associative, commutative and idempotent unions was addressed too Andrés E. Viso Type Soundness for Path Polymorphism 12 / 17
19 Other work Type-checking 2 Syntax-directed formalization of the type system Implementation of type-checking algorithms Disambiguation of typing rules Equivalence and subtype checking Compatibility check Efficiency of typing Checking equivalence and subtyping modulo ACI operators [JPZ02][DPR05] 2 Juan Edi s MSc Thesis at UBA Andrés E. Viso Type Soundness for Path Polymorphism 13 / 17
20 Work in progress Strong Normalization Recursive types are not SN Y C : (A A) A All known restrictions work with weak equivalence Our invertibility result holds for strong equivalence SN with strong equivalence has been an open problem for over 15 years [Cop98] Options Analyze SN with strong equivalence for recursive types in a simplified framework Revisit our results considering weak type equivalence Andrés E. Viso Type Soundness for Path Polymorphism 14 / 17
21 Future Work Polymorphic type extensions Intersection types Parametric polymorphism à la System F <: Curry Howard correspondence for the proposed system Comparison with Dagand s work in Ornaments Comparison with Datatype-Generic Programming based on Category Theory Extend this analysis to the dynamic patterns case Andrés E. Viso Type Soundness for Path Polymorphism 15 / 17
22 References I Mario Coppo. Recursive types: the syntactic and semantic approaches. In Theories of Types and Proofs, pages Kyoto University, Roberto Di Cosmo, François Pottier, and Didier Rémy. Subtyping recursive types modulo associative commutative products. In Seventh International Conference on Typed Lambda Calculi and Applications (TLCA 05), Nara, Japan, April C. Barry Jay. Pattern Calculus: Computing with Functions and Structures. Springer, C. Barry Jay and Delia Kesner. First-class patterns. J. Funct. Program., 19(2): , Andrés E. Viso Type Soundness for Path Polymorphism 16 / 17
23 References II Somesh Jha, Jens Palsberg, and Tian Zhao. Efficient type matching. In Mogens Nielsen and Uffe Engberg, editors, Foundations of Software Science and Computation Structures, 5th International Conference, FOSSACS 2002 (ETAPS 2002) Grenoble, France, April 8-12, 2002, Proceedings, volume 2303 of LNCS, pages Springer, Barbara Petit. Semantics of typed lambda-calculus with constructors. Logical Methods in Computer Science, 7(1), Andrés E. Viso Type Soundness for Path Polymorphism 17 / 17
24 CAP Patterns, terms, data structures and matchable forms p ::= x (matchable) c (constant) p p (compound) d ::= c (constant) d t (compound) t ::= x (variable) c (constant) t t (application) p θ t... p θ t (abstraction) m ::= d (data struct) p θ t... p θ t (abstraction) Andrés E. Viso Type Soundness for Path Polymorphism 18 / 17
25 CAP Matching operation {u/x } {u/x} {c/c } {} {u v/p q } {u/p } {v/q } if u v is a matchable form {u/p } fail if u is a matchable form {u/p } wait Reduction rule {u/p i } = fail for all i < j {u/p j } = σ j j 1..n (β) (p i θi s i ) i 1..n u σ j s j Andrés E. Viso Type Soundness for Path Polymorphism 19 / 17
26 Types Datatypes and types syntax D ::= α (datatype variable) c (atom) A (compound) D D (union) µα.d (recursion) A ::= X (type variable) D (datatype) A A (type abstraction) A A (union) µx.a (recursion) Andrés E. Viso Type Soundness for Path Polymorphism 20 / 17
27 Type equivalence 3 (e-idem) A A µ A (e-comm) A B µ B A A (B C) µ (A B) C (e-assoc) (e-fold) µv.a µ {µv.a/v } A A µ {A/V } B µv.b contractive (e-contr) A µ µv.b 3 Reflexivity, transitivity, symmetry and congruence rules omitted. Andrés E. Viso Type Soundness for Path Polymorphism 21 / 17
28 Subtyping rules 4 A subtyping context consists of assumptions of the form X Y Σ, V µ W V µ W (s-hyp) A µ B (s-eq) Σ A µ B Σ A µ C Σ A B µ C Σ B µ C (s-union-l) Σ A µ B Σ A µ B C (s-union-r1) Σ A µ C Σ A µ B C (s-union-r2) Σ, V µ W A µ B W / fv(a) V / fv(b) (s-rec) Σ µv.a µ µw.b 4 Reflexivity, transitivity and congruence rules omitted. Andrés E. Viso Type Soundness for Path Polymorphism 22 / 17
29 Compatibility a ɛ {a} (A 1 A 2 ) ɛ { }, (A 1 A 2 ) iπ A i π, i {1, 2} (A 1 A 2 ) π A 1 π A 2 π (µv.a ) π ({µv.a /V } A ) π Maximal positions maxpos(p) { π P π P.π = ππ π ɛ } Mismatching positions mmpos(p, q) {π π maxpos(pos(p) pos(q)) p π q π } Andrés E. Viso Type Soundness for Path Polymorphism 23 / 17
30 Compatibility p : A is compatible with q : B (p : A q : B) iff: p q = B µ A p q = ( π mmpos(p, q).a π B π ) = B A. Alternately, let ovl(p : A, q : B) p q ( π mmpos(p, q).a π B π ) Then, p i : A i p j : A j iff ovl(p : A, q : B) = B µ A A list of patterns [p i : A i ] i 1..n is compatible if i, j 1..n.i < j = p i : A i p j : A j Andrés E. Viso Type Soundness for Path Polymorphism 24 / 17
31 Typing schemes Patterns are typed separately with special judgment p θ(x) = A (p-match) θ p x : A (p-const) θ p c : c θ p p : D θ p q : A (p-comp) θ p p q : A Andrés E. Viso Type Soundness for Path Polymorphism 25 / 17
32 Typing schemes Rules for variables, data structures and subtyping Γ(x) = A (t-var) Γ x : A (t-const) Γ c : c Γ r : D Γ u : A (t-comp) Γ r u : A Γ s : A Γ s : A A µ A (t-subs) The subtyping relation handles union and recursive types Andrés E. Viso Type Soundness for Path Polymorphism 26 / 17
33 Typing schemes Special rules for abstraction and application (θ i p p i : A i ) i 1..n [p i : A i ] i 1..n compatible (Γ, θ i s i : B) i 1..n (t-abs) Γ (p i θi s i ) i 1..n : i 1..n A i B Γ r : i 1..n A i B Γ u : A k k 1..n (t-app) Γ r u : B Andrés E. Viso Type Soundness for Path Polymorphism 27 / 17
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 informationProgramming Languages and Types
Programming Languages and Types Klaus Ostermann based on slides by Benjamin C. Pierce Subtyping Motivation With our usual typing rule for applications the term is not well typed. ` t 1 : T 11!T 12 ` t
More informationSubtyping 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 informationBeyond First-Order Logic
Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL
More informationSimply Typed Lambda Calculus
Simply Typed Lambda Calculus Language (ver1) Lambda calculus with boolean values t ::= x variable x : T.t abstraction tt application true false boolean values if ttt conditional expression Values v ::=
More informationDependent types. Paul Stansifer. March 16, 2012
Dependent types Paul Stansifer March 16, 2012 1 You ve seen this before I hope you like abstraction, because we re about to use it a lot. Here s the simply-typed lambda calculus with built-in list operations
More informationIntersection Type System with de Bruijn Indices
Intersection Type System with de Bruijn Indices Daniel Lima Ventura 1 and Mauricio Ayala-Rincón 1 and Fairouz Kamareddine 2 1 Grupo de Teoria da Computação, Dep. de Matemática Universidade de Brasília,
More informationThe Curry-Howard Isomorphism
The Curry-Howard Isomorphism Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) The Curry-Howard Isomorphism MFES 2008/09
More informationApplied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw
Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018
More informationAbout categorical semantics
About categorical semantics Dominique Duval LJK, University of Grenoble October 15., 2010 Capp Café, LIG, University of Grenoble Outline Introduction Logics Effects Conclusion The issue Semantics of programming
More informationDepending on equations
Depending on equations A proof-relevant framework for unification in dependent type theory Jesper Cockx DistriNet KU Leuven 3 September 2017 Unification for dependent types Unification is used for many
More informationTyping λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus
Course 2D1453, 200607 Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Some material from B. Pierce: TAPL + some from G. Klein, NICTA Typing λterms The uptyped λcalculus
More informationLazy 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 informationNotes from Yesterday s Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons.
CIS 500 Software Foundations Fall 2006 Notes from Yesterday s Email Discussion November 1 Some lessons This is generally a crunch-time in the semester Slow down a little and give people a chance to catch
More informationLogic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae
Logic and Discrete Mathematics Section 3.5 Propositional logical equivalence Negation of propositional formulae Slides version: January 2015 Logical equivalence of propositional formulae Propositional
More informationA 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 informationComplete Partial Orders, PCF, and Control
Complete Partial Orders, PCF, and Control Andrew R. Plummer TIE Report Draft January 2010 Abstract We develop the theory of directed complete partial orders and complete partial orders. We review the syntax
More informationOrder Sorted Algebra. Japan Advanced Institute of Science and Technology. March 8, 2008
Order Sorted Algebra Daniel Găină Japan Advanced Institute of Science and Technology March 8, 2008 Introduction There are many examples where all items of one sort are necessarily also items of some other
More informationProgramming Languages Fall 2013
Programming Languages Fall 2013 Lecture 11: Subtyping Prof Liang Huang huang@qccscunyedu Big Picture Part I: Fundamentals Functional Programming and Basic Haskell Proof by Induction and Structural Induction
More informationParameterizations and Fixed-Point Operators on Control Categories
Parameterizations and Fixed-Point Operators on Control Categories oshihiko Kakutani 1 and Masahito Hasegawa 12 1 Research Institute for Mathematical Sciences, Kyoto University {kakutani,hassei}@kurims.kyoto-u.ac.jp
More informationThe Locally Nameless Representation
Noname manuscript No. (will be inserted by the editor) The Locally Nameless Representation Arthur Charguéraud Received: date / Accepted: date Abstract This paper provides an introduction to the locally
More informationNormalization by Evaluation
Normalization by Evaluation Andreas Abel Department of Computer Science and Engineering Chalmers and Gothenburg University PhD Seminar in Mathematical Engineering EAFIT University, Medellin, Colombia 9
More informationSelf-Adaptation and Information Flow in Multiparty Communications
Self-Adaptation and Information Flow in Multiparty Communications Joint work with Ilaria Castellani (INRIA, FR) Jorge A. Pérez (University of Groningen, NL) ABCD meeting London, 20th April, 2015 1 / 36
More informationCompleteness and Partial Soundness Results for Intersection & Union Typing for λµ µ
Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK Abstract This
More informationExtended Abstract: Reconsidering Intuitionistic Duality
Extended Abstract: Reconsidering Intuitionistic Duality Aaron Stump, Harley Eades III, Ryan McCleeary Computer Science The University of Iowa 1 Introduction This paper proposes a new syntax and proof system
More informationRank-2 intersection for recursive definitions
Fundamenta Informaticae XXI (2001) 1001 1044 1001 IOS Press Rank-2 intersection for recursive definitions Ferruccio Damiani Dipartimento di Informatica Università di Torino Corso Svizzera 185, I-10149
More informationIntroduction to lambda calculus Part 6
Introduction to lambda calculus Part 6 Antti-Juhani Kaijanaho 2017-02-16 1 Untyped lambda calculus 2 Typed lambda calculi 2.1 Dynamically typed lambda calculus with integers 2.2 A model of Lisp 2.3 Simply
More informationA General Technique for Analyzing Termination in Symmetric Proof Calculi
A General Technique for Analyzing Termination in Symmetric Proof Calculi Daniel J. Dougherty 1, Silvia Ghilezan 2 and Pierre Lescanne 3 1 Worcester Polytechnic Institute, USA, dd@cs.wpi.edu 2 Faculty of
More informationLinearity and Passivity
Linearity and Passivity David A. 1 School of Computing University of Tasmania GPO Box 252-100 Hobart 7001 Australia Abstract A simple symmetric logic is proposed which captures both the notions of Linearity
More informationFunctional Object Calculus
Notations a, b Ter terms d D, e E iterators over some finite sets f, g, h F field names i, j, k N indices (usually i < j < k) l Loc locations m, m d, m e M method names u, v, w Val values x, y, z Var variables
More informationSyntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.
First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable
More informationCMSC 631 Program Analysis and Understanding Fall Type Systems
Program Analysis and Understanding Fall 2017 Type Systems Type Systems A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according
More informationCombined Satisfiability Modulo Parametric Theories
Intel 07 p.1/39 Combined Satisfiability Modulo Parametric Theories Sava Krstić*, Amit Goel*, Jim Grundy*, and Cesare Tinelli** *Strategic CAD Labs, Intel **The University of Iowa Intel 07 p.2/39 This Talk
More informationMathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge
Mathematical Synthesis of Equational Deduction Systems Marcelo Fiore Computer Laboratory University of Cambridge TLCA 2009 3.VII.2009 Context concrete theories meta-theories Context concrete theories meta-theories
More informationLecture Notes on Combinatory Modal Logic
Lecture Notes on Combinatory Modal Logic 15-816: Modal Logic Frank Pfenning Lecture 9 February 16, 2010 1 Introduction The connection between proofs and program so far has been through a proof term assignment
More informationMinimal logic for computable functionals
Minimal logic for computable functionals Helmut Schwichtenberg Mathematisches Institut der Universität München Contents 1. Partial continuous functionals 2. Total and structure-total functionals 3. Terms;
More informationA linear account of session types in the pi calculus
A linear account of session types in the pi calculus Marco Giunti 1 and Vasco T. Vasconcelos 2 1 Iuav University, Venice 2 LaSIGE, Faculty of Sciences, University of Lisbon Abstract. We present a reconstruction
More informationA Typed Interrupt Calculus
A Typed Interrupt Calculus Jens Palsberg Di Ma Department of Computer Science Purdue University, W. Lafayette, IN 47907 {palsberg,madi@cs.purdue.edu Abstract. Most real-time systems require responsive
More informationA categorical model for a quantum circuit description language
A categorical model for a quantum circuit description language Francisco Rios (joint work with Peter Selinger) Department of Mathematics and Statistics Dalhousie University CT July 16th 22th, 2017 What
More informationIntersection Types and Lambda Theories
Intersection Types and Lambda Theories M.Dezani-Ciancaglini S.Lusin Abstract We illustrate the use of intersection types as a semantic tool for showing properties of the lattice of λ-theories. Relying
More informationA Terminating and Confluent Linear Lambda Calculus
A Terminating and Confluent Linear Lambda Calculus Yo Ohta and Masahito Hasegawa Research Institute for Mathematical Sciences, Kyoto University Kyoto 606-8502, Japan Abstract. We present a rewriting system
More informationNICTA Advanced Course. Theorem Proving Principles, Techniques, Applications
NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural
More information3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.
32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,
More informationTypes and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions)
Types and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions) Contact: 15-814 Course Staff Due Tuesday, October 16, 2018, 10:30am This assignment is due by 10:30am
More informationA 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 informationLogic for Computational Effects: work in progress
1 Logic for Computational Effects: work in progress Gordon Plotkin and John Power School of Informatics University of Edinburgh King s Buildings Mayfield Road Edinburgh EH9 3JZ Scotland gdp@inf.ed.ac.uk,
More informationFunctional Database Query Languages as. Typed Lambda Calculi of Fixed Order. Gerd G. Hillebrand and Paris C. Kanellakis
Functional Database Query Languages as Typed Lambda Calculi of Fixed Order Gerd G. Hillebrand and Paris C. Kanellakis Department of Computer Science Brown University Providence, Rhode Island 02912 CS-94-26
More informationSimply Typed Lambda Calculus
Simply Typed Lambda Calculus Mathias Vorreiter Pedersen November 13, 2015 1 Recalling the untyped lambda calculus 1.1 Syntax t ::= x λ x. t t t 1.2 Evaluation x x t t λx.t λx.t t 1 t 1 t 2 t 2 t 1 t 2
More informationKleene realizability and negative translations
Q E I U G I C Kleene realizability and negative translations Alexandre Miquel O P. D E. L Ō A U D E L A R April 21th, IMERL Plan 1 Kleene realizability 2 Gödel-Gentzen negative translation 3 Lafont-Reus-Streicher
More informationCommutative Locative Quantifiers for Multiplicative Linear Logic
Commutative Locative Quantifiers for Multiplicative Linear Logic Stefano Guerrini 1 and Patrizia Marzuoli 2 1 Dipartimento di Informatica Università degli Studi Roma La Sapienza Via Salaria, 113 00198
More informationThe faithfulness of atomic polymorphism
F Ferreira G Ferreira The faithfulness of atomic polymorphism Abstract It is known that the full intuitionistic propositional calculus can be embedded into the atomic polymorphic system F at, a calculus
More informationPropositional Logic Language
Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite
More informationInteroperation for Lazy and Eager Evaluation
Interoperation for Lazy and Eager Evaluation 1 Matthews & Findler New method of interoperation Type safety, observational equivalence & transparency Eager evaluation strategies Lazy vs. eager 2 Lambda
More informationJustifying Algorithms for βη-conversion
Justifying Algorithms for βη-conversion Healfdene Goguen AT&T Labs, 180 Park Ave., Florham Park NJ 07932 USA hhg@att.com. Abstract. Deciding the typing judgement of type theories with dependent types such
More informationIntroduction to type theory and homotopy theory
Introduction to type theory and homotopy theory Michael Shulman January 24, 2012 1 / 47 Homotopy theory Homotopy type theory types have a homotopy theory Intensional type theory New perspectives on extensional
More information1 / A bird s-eye view of type theory. 2 A bird s-eye view of homotopy theory. 3 Path spaces and identity types. 4 Homotopy type theory
Introduction to type theory and homotopy theory Michael Shulman January 24, 2012 Homotopy theory Homotopy type theory types have a homotopy theory New perspectives on extensional vs. intensional Intensional
More informationAn Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California. 2. Background: Semirings and Kleene algebras
An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California 1. Residuated Lattices with iteration 2. Background: Semirings and Kleene algebras 3. A Gentzen system
More informationSafety Analysis versus Type Inference
Information and Computation, 118(1):128 141, 1995. Safety Analysis versus Type Inference Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus
More informationRelational Interfaces and Refinement Calculus for Compositional System Reasoning
Relational Interfaces and Refinement Calculus for Compositional System Reasoning Viorel Preoteasa Joint work with Stavros Tripakis and Iulia Dragomir 1 Overview Motivation General refinement Relational
More informationCMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008
CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008 Contents 1 Polymorphism 1 2 Polymorphic λ-calculus: Syntax 1 3 Static Semantics 2 4 Dynamic Semantics
More informationThe lambda calculus with constructors
The lambda calculus with constructors Categorical semantic and Continuations Barbara Petit Focus - Univ. Bologna CaCos 2012 Barbara Petit (Focus - Univ. Bologna) The lambda calculus with constructors 1
More informationType Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg
Type Theory and Constructive Mathematics Type Theory and Constructive Mathematics Thierry Coquand University of Gothenburg Content An introduction to Voevodsky s Univalent Foundations of Mathematics The
More informationMonadic Refinements for Relational Cost Analysis (Appendix)
Monadic Refinements for Relational Cost Analysis (Appendix) Ivan Radiček Gilles Barthe Marco Gaboardi Deepak Garg Florian Zuleger Structure of the Appendix In the appendix we give material that was omitted
More informationType Systems. Lecture 9: Classical Logic. Neel Krishnaswami University of Cambridge
Type Systems Lecture 9: Classical Logic Neel Krishnaswami University of Cambridge Where We Are We have seen the Curry Howard correspondence: Intuitionistic propositional logic Simply-typed lambda calculus
More informationIntersection Types for
Intersection Types for -Trees Steffen van Bakel Franco Barbanera Mariangiola Dezani-Ciancaglini Fer-Jan de Vries Department of Computing, Imperial College, 180 Queen s Gate, London SW7 2BZ, UK E-mail:
More informationGrammatical resources: logic, structure and control
Grammatical resources: logic, structure and control Michael Moortgat & Dick Oehrle 1 Grammatical composition.................................. 5 1.1 Grammar logic: the vocabulary.......................
More informationHORSes: format, termination and confluence
HORSes: format, termination and confluence Jean-Pierre Jouannaud INRIA-LIAMA and singhua Software Chair Joint on-going work with Jianqi Li School of Software, singhua University Project CoqLF NList Cross-discipline
More informationHigher Order Containers
Higher Order Containers Thorsten Altenkirch 1, Paul Levy 2, and Sam Staton 3 1 University of Nottingham 2 University of Birmingham 3 University of Cambridge Abstract. Containers are a semantic way to talk
More informationType Systems Winter Semester 2006
Type Systems Winter Semester 2006 Week 7 November 29 November 29, 2006 - version 1.0 Plan PREVIOUSLY: 1. type safety as progress and preservation 2. typed arithmetic expressions 3. simply typed lambda
More informationThe syntactic guard condition of Coq
The syntactic guard condition of Coq Bruno Barras February 2, 2010 Overview 1 Theory Basic criterion Extensions 2 Algorithm Efficiency 3 Discussion 4 Attic A short history of the syntactic guard criterion
More informationThird-Order Matching via Explicit Substitutions
Third-Order Matching via Explicit Substitutions Flávio L. C. de Moura 1 and Mauricio Ayala-Rincón 1 and Fairouz Kamareddine 2 1 Departamento de Matemática, Universidade de Brasília, Brasília D.F., Brasil.
More informationNon-Idempotent Typing Operators, beyond the λ-calculus
Non-Idempotent Typing Operators, beyond the λ-calculus Soutenance de thèse Pierre VIAL IRIF (Univ. Paris Diderot and CNRS) December 7, 2017 Non-idempotent typing operators P. Vial 0 1 /46 Certification
More informationarxiv: v3 [cs.pl] 15 May 2011
A Step-indexed Semantic Model of Types for the Call-by-Name Lambda Calculus arxiv:1105.1985v3 [cs.pl] 15 May 2011 Abstract Step-indexed semantic models of types were proposed as an alternative to purely
More information1 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 informationInduction on Failing Derivations
Induction on Failing Derivations Technical Report PL-Sep13 September 2013, with addenda from Spring 2016 ay Ligatti Department of Computer Science and Engineering University of South Florida Abstract A
More informationHomotopy Type Theory
Homotopy Type Theory Jeremy Avigad Department of Philosophy and Department of Mathematical Sciences Carnegie Mellon University February 2016 Homotopy Type Theory HoTT relies on a novel homotopy-theoretic
More informationOn the Complexity of the Reflected Logic of Proofs
On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,
More informationReasoning with Higher-Order Abstract Syntax and Contexts: A Comparison
1 Reasoning with Higher-Order Abstract Syntax and Contexts: A Comparison Amy Felty University of Ottawa July 13, 2010 Joint work with Brigitte Pientka, McGill University 2 Comparing Systems We focus on
More informationCS522 - Programming Language Semantics
1 CS522 - Programming Language Semantics Simply Typed Lambda Calculus Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 We now discuss a non-trivial extension of
More informationLogical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14
0/0/4 Knowledge based agents Logical Agents Agents need to be able to: Store information about their environment Update and reason about that information Russell and Norvig, chapter 7 Knowledge based agents
More informationEvery formula evaluates to either \true" or \false." To say that the value of (x = y) is true is to say that the value of the term x is the same as th
A Quick and Dirty Sketch of a Toy Logic J Strother Moore January 9, 2001 Abstract For the purposes of this paper, a \logic" consists of a syntax, a set of axioms and some rules of inference. We dene a
More informationChurch and Curry: Combining Intrinsic and Extrinsic Typing
Church and Curry: Combining Intrinsic and Extrinsic Typing Frank Pfenning Dedicated to Peter Andrews on the occasion of his retirement Department of Computer Science Carnegie Mellon University April 5,
More informationConsistency of a Programming Logic for a Version of PCF Using Domain Theory
Consistency of a Programming Logic for a Version of PCF Using Domain Theory Andrés Sicard-Ramírez EAFIT University Logic and Computation Seminar EAFIT University 5 April, 3 May 2013 A Core Functional Programming
More informationSafety Analysis versus Type Inference for Partial Types
Safety Analysis versus Type Inference for Partial Types Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus University Ny Munkegade, DK-8000
More informationOptimal Representations of Polymorphic Types with Subtyping (Extended Abstract)
Optimal Representations of Polymorphic Types with Subtyping (Extended Abstract) Alexander Aiken 1 and Edward L. Wimmers 2 and Jens Palsberg 3 1 EECS Department, University of California at Berkeley, Berkeley,
More informationDeciding Validity in a Spatial Logic for Trees
Under consideration for publication in J. Functional Programming 1 Deciding Validity in a Spatial Logic for Trees Cristiano Calcagno Imperial College London Luca Cardelli, Andrew D. Gordon Microsoft Research
More informationAn Introduction to Logical Relations Proving Program Properties Using Logical Relations
An Introduction to Logical Relations Proving Program Properties Using Logical Relations Lau Skorstengaard lask@cs.au.dk July 27, 2018 Contents 1 Introduction 2 1.1 Simply Typed Lambda Calculus....................
More informationApplied Logic for Computer Scientists. Answers to Some Exercises
Applied Logic for Computer Scientists Computational Deduction and Formal Proofs Springer, 2017 doi: http://link.springer.com/book/10.1007%2f978-3-319-51653-0 Answers to Some Exercises Mauricio Ayala-Rincón
More informationFormalization of Rewriting in PVS
Formalization of Rewriting in PVS Mauricio Ayala-Rincón Grupo de Teoria da Computação, Universidade de Brasília (UnB) Brasília D.F., Brazil Research funded by Brazilian Research Agencies: CNPq, CAPES and
More informationStructuring the verification of heap-manipulating programs
Structuring the verification of heap-manipulating programs Aleksandar Nanevski (IMDEA Madrid) Viktor Vafeiadis (MSR / Univ. of Cambridge) Josh Berdine (MSR Cambridge) Hoare/Separation Logic Hoare logic
More informationGerwin Klein, June Andronick, Ramana Kumar S2/2016
COMP4161: Advanced Topics in Software Verification {} Gerwin Klein, June Andronick, Ramana Kumar S2/2016 data61.csiro.au Content Intro & motivation, getting started [1] Foundations & Principles Lambda
More informationA Note on Scope and Infinite Behaviour in CCS-like Calculi p.1/32
A Note on Scope and Infinite Behaviour in CCS-like Calculi GERARDO SCHNEIDER UPPSALA UNIVERSITY DEPARTMENT OF INFORMATION TECHNOLOGY UPPSALA, SWEDEN Joint work with Pablo Giambiagi and Frank Valencia A
More informationNatural deduction for propositional logic via truth tables
Natural deduction for propositional logic via truth tables Herman Geuvers Nijmegen, NL (Joint work with Tonny Hurkens) Bengt Nordström honorary workshop Marstrand, Sweden April 2016 H. Geuvers - April
More informationOn Modal Logics of Partial Recursive Functions
arxiv:cs/0407031v1 [cs.lo] 12 Jul 2004 On Modal Logics of Partial Recursive Functions Pavel Naumov Computer Science Pennsylvania State University Middletown, PA 17057 naumov@psu.edu June 14, 2018 Abstract
More informationEDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach
EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types
More informationTHE UNIVERSITY OF CALGARY FACULTY OF SCIENCE FINAL EXAMINATION COMPUTER SCIENCE 521
P. 1 of 7 THE UNIVERSITY OF CALGARY FACULTY OF SCIENCE FINAL EXAMINATION COMPUTER SCIENCE 521 December, 2016 Time: 2 hrs. Instructions The exam contains questions totaling 100 points. Answer all questions.
More informationDenoting computation
A jog from Scott Domains to Hypercoherence Spaces 13/12/2006 Outline Motivation 1 Motivation 2 What Does Denotational Semantic Mean? Trivial examples Basic things to know 3 Scott domains di-domains 4 Event
More informationPartial model checking via abstract interpretation
Partial model checking via abstract interpretation N. De Francesco, G. Lettieri, L. Martini, G. Vaglini Università di Pisa, Dipartimento di Ingegneria dell Informazione, sez. Informatica, Via Diotisalvi
More informationAdding recursion to Dpi
Adding recursion to Dpi Samuel Hym and Matthew Hennessy Abstract. Dpi is a distributed version of the pi-calculus, in which processes are explicitly located, and a migration construct may be used for moving
More informationConsequence Relations and Natural Deduction
Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations
More information