Cartesian closed 2-categories and rewriting

Similar documents
Modèles des langages de programmation Domaines, catégories, jeux. Programme de cette seconde séance:

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge

Complete Partial Orders, PCF, and Control

Categories, Proofs and Programs

A few bridges between operational and denotational semantics of programming languages

Lazy Strong Normalization

A fully abstract semantics for a nondeterministic functional language with monadic types

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

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

A quoi ressemblerait une géométrie du raisonnement?

Non deterministic classical logic: the λµ ++ -calculus

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

M, N ::= x λp : A.M MN (M, N) () c A. x : b p x : b

Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT

The category of open simply-typed lambda terms

Constructive approach to relevant and affine term calculi

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

University of Oxford, Michaelis November 16, Categorical Semantics and Topos Theory Homotopy type theor

Quantum groupoids and logical dualities

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.

Denoting computation

Notes on Logical Frameworks

A probabilistic lambda calculus - Some preliminary investigations

Exercise sheet n Compute the eigenvalues and the eigenvectors of the following matrices. C =

Parameterizations and Fixed-Point Operators on Control Categories

Non-Standard Multiset. Jean-Louis Giavitto IRCAM umr 9912 CNRS UPMC & INRIA projet MuSync

Five Basic Concepts of. Axiomatic Rewriting Theory

Locally cartesian closed categories

Sequent Combinators: A Hilbert System for the Lambda Calculus

About Typed Algebraic Lambda-calculi

(La méthode Event-B) Proof. Thanks to Jean-Raymond Abrial. Language of Predicates.

Probabilistic Applicative Bisimulation and Call-by-Value Lam

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Programming Languages in String Diagrams. [ one ] String Diagrams. Paul-André Melliès. Oregon Summer School in Programming Languages June 2011

Monads and Adjunctions for Global Exceptions

Extraction from classical proofs using game models

Operational semantics for disintegration

Sequents are written as A, where A; B represent formulae and ; represent multisets of formulae. Where represents the multiset A 1 ; : : : ; A n, then!

Geometry of Interaction

Lambda calculus L9 103

Subtyping and Intersection Types Revisited

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

Overview. Systematicity, connectionism vs symbolic AI, and universal properties. What is systematicity? Are connectionist AI systems systematic?

A Terminating and Confluent Linear Lambda Calculus

The algebraicity of the lambda-calculus

Adjunction Based Categorical Logic Programming

Introduction to λ-calculus

Equivalence of Algebraic λ -calculi extended abstract

Full abstraction for nominal exceptions and general references

Interpreting the Full λ-calculus in the π-calculus

Proofs in classical logic as programs: a generalization of lambda calculus. A. Salibra. Università Ca Foscari Venezia

Grammatical resources: logic, structure and control

A Taste of Categorical Logic Tutorial Notes

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ

From syntax to semantics of Dependent Type Theories - Formalized

Programming Language Concepts: Lecture 18

On the Semantics of Parsing Actions

Algebraic theories in the presence of binding operators, substitution, etc.

SHARING IN THE WEAK LAMBDA-CALCULUS REVISITED

Uniform Schemata for Proof Rules

Origin in Mathematical Logic

Normalisation by evaluation

A categorical model for a quantum circuit description language

Apprentissage automatique Méthodes à noyaux - motivation

The equivalence axiom and univalent models of type theory.

The Safe Lambda Calculus

Binding in Nominal Equational Logic

Denotational semantics of linear logic

Curry-Howard Correspondence for Classical Logic

Lambek Grammars as Combinatory Categorial Grammars

Simply Typed λ-calculus

Typed Abstract Syntax

COMP6463: λ-calculus

About categorical semantics

The lambda calculus with constructors

Towards a Flowchart Diagrammatic Language for Monad-based Semantics

Bisimulation and coinduction in higher-order languages

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ

Random variables. Florence Perronnin. Univ. Grenoble Alpes, LIG, Inria. September 28, 2018

and one into the linear calculus, yielding a semantics in L. For we use a trivial mapping into the monadic calculus and Girard's translation into the

RPO, Second-Order Contexts, and λ-calculus

Partially commutative linear logic: sequent calculus and phase semantics

Meta-reasoning in the concurrent logical framework CLF

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012

Sémantique des jeux asynchrones et réécriture 2-dimensionnelle

The Lambda Calculus is Algebraic

Topos Theory. Lectures 17-20: The interpretation of logic in categories. Olivia Caramello. Topos Theory. Olivia Caramello.

Intensionality, Extensionality, and Proof Irrelevance in Modal Type Theory

How to combine diagrammatic logics

Mechanizing Metatheory in a Logical Framework

Names and Symmetry in Computer Science

JOURNAL DE THÉORIE DES NOMBRES DE BORDEAUX

The Curry-Howard Isomorphism

Generalized Ehrhart polynomials

Mary Southern and Gopalan Nadathur. This work was funded by NSF grant CCF

The Lambda-Calculus Reduction System

A Taste of Categorical Logic Tutorial Notes

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

Which types have a unique inhabitant? Focusing on pure program equivalence

TOPOLOGIE ET GÉOMÉTRIE DIFFÉRENTIELLE CATÉGORIQUES. Sheaves and Cauchy-complete categories

Transcription:

Cartesian closed 2-categories and rewriting Aurore Alcolei A brief presentation of Tom Hirschowitz s paper, Cartesian closed 2-categories and permutation equivalence in higher-order rewriting June 7, 2014 2-CCCAT and HORS June 7, 2014 1 / 21

Context Context Construction Représentation du λ-calcul par valeur 2-CCCAT and HORS June 7, 2014 2 / 21

Context Context A lot of calculi : λ-calcul in cbv, cbn, lazy, optimal, λ-calcul with let rec / refs / call/cc, π-calcul, etc. same kind of proofs again and again a common point: the abstractions (binding) Aim: Having a framework to specify the semantic of (any) programming language with binding. providing tools to specify/automate proofs and construction for these languages 2-CCCAT and HORS June 7, 2014 3 / 21

Context Previous Works What s already there: Higher-Order Rewrite Systems (HRSs) from T.Nipkow no notion of model, does not express reduction steps (binary relation) Categorical approach using Cartesian Closed Categories (CCC) by J.Lambek no notion of reductions, model for equational theories. Ideas: Making signatures for HRSs into a category (Sig) Adding a dimension to Lambek s approach using 2-Cartesian Closed Categories. 2-CCCAT and HORS June 7, 2014 4 / 21

Context In a nutshell Programming language/rewriting systems with binding as a 2-category where objects are types morphisms (1-cells) are terms morphisms between parallel morphisms (2-cells) are reductions What would that mean? l t t t t t t t. ev β a 2-CCCAT and HORS June 7, 2014 5 / 21

Construction Context Construction Représentation du λ-calcul par valeur 2-CCCAT and HORS June 7, 2014 6 / 21

Construction An example Pure λ-calculus: grammar: M, N Λ(Γ) = x Γ λx.m MN (Γ set of variables) reduction rules: (β) (λx.m)n M[N/x] (ξ) M M λx.m λx.m (R) N N MN MN (L) M M MN M N 2-CCCAT and HORS June 7, 2014 7 / 21

Construction Signature Example: 2-signature for pure λ-calculus Σ Λ = ({t}, { l [tt ] t a [t, t] t Three sets : 1. Basic types (sorts): X 0 = {t}. 2. Operations, l and a, with their type. }, { β a l x, y x(y) } ) 3. Rules β. redex and reduction are of the same type. H Sig 2-CCCat W 2-CCCAT and HORS June 7, 2014 8 / 21

Construction Step 1: 1-Signature Types of a signature: obtained by applying (the monad) on X 0 1-signature: L 0 Sets Sets X {A, B = x X 0 A B 1 B A } sequent := element of S 0 (X ) = L 0 (X ) L 0 (X ) 1-signature := (X 0,X 1 ) with ϕ 1 X 1 S 0 (X ) c (dom(c), cod(c)) 2-CCCAT and HORS June 7, 2014 9 / 21

Construction Step 2: 2-Signature (1) Terms of a signature: generated by + simply typed λ-calculus + pairing and projections +... Γ M i i... Γ c M 1,..., M n A c X 1 (,A) modulo β η reduction ( ) Examples: λx.m = l λx. M MN = a M, N x = x ( ) to get a structure close to the CCC 2-CCCAT and HORS June 7, 2014 10 / 21

Construction Step 2: 2-Signature (2) monad L 1 Sig 1 Sig 1 such that L 1 (X ) 0 = X 0 and L 1 (X ) 1 = terms of the signature L 1 (X ) := set of pairs of terms with same type 2-signature : (X,X 2 ) where X is a 1-signature and X 2 is equipped with ϕ 2 X 2 L 1 (X ) r (a term, its reduction by r) Ex : β (a l x, y, x[y]) L 1 (Sigma) 2-CCCAT and HORS June 7, 2014 11 / 21

Construction Step 3: The adjunction A similar approach: Defining a monad L over Sig Reductions are generated by a 2λ-calculus: Context rules : Γ, x A, x x x A Γ, x A P M N B Γ (λx A.P) λx A.M λx A.N B A Γ P 1 M 1 N 1 G 1... Γ P n M n N n G n Γ c P 1,..., P n c M 1,..., M n c N 1,..., N n A (c X1(G A))... Special rule :... Γ P i M i N i G i... Γ r P 1,..., P n M[M 1,..., M n ] N[N 1,..., N n ] A (r X (G M,N A)) Modulo some equations... to get a structure close to the 2-CCC 2-CCCAT and HORS June 7, 2014 12 / 21

Construction Example of equation Equivalence rules := β and η equivalences, equivalence by permutation,... (λx.m)n Example: (λx.m )N M[x N] M [x N ] Left reduction: a l λx t.p, Q ; β λx t.m, N β λx t.p, Q β λx t.m, N ; (λx t.p)q β λx t.m, N ; P[x Q] : Right reduction. 2-CCCAT and HORS June 7, 2014 13 / 21

Construction What we get An adjunction: H Sig 2-CCCat models for Σ : morphisms H(Σ) C in 2-CCCat What does that mean? l t W t t t t t t. ev β a 2-CCCAT and HORS June 7, 2014 14 / 21

Some Details composition of maps 2-CCCAT and HORS June 7, 2014 15 / 21

Représentation du λ-calcul par valeur Context Construction Représentation du λ-calcul par valeur 2-CCCAT and HORS June 7, 2014 16 / 21

Représentation du λ-calcul par valeur 2-Signature du λ-calcul en CBV Σ Λ = ({t}, { l [tt ] t a [t, t] t Σ ΛCBV = ({t, v}, restreindre β l [t v ] v a [t, t] t r [v] t }, { β a l x, y x(y) } ), { β a r l x, r y x(y) }) valeur type v Λ(n) v Λ(n) constructeur r t v v l v v v r r ev β t t a t 2-CCCAT and HORS June 7, 2014 17 / 21

Représentation du λ-calcul par valeur Représentations équivalentes? Ce qu il fallait montrer 1. Λ CBV (n) L 1 (Σ ΛCBV ) 1 (x 1 v,..., x n v, t) et Λ v CBV (n) L 1(Σ ΛCBV ) 1 (x 1 v,..., x n v, v) 2. Commutativité avec la substitution par valeur 3. Fidélité à la réduction : bissimulation 2-CCCAT and HORS June 7, 2014 18 / 21

Sources T. Hirschowitz, Cartesian closed 2-categories and permutation equivalence in higher-order rewriting HAL : hal-00540205, version 2 (2011) R. Crole Categories for Types, Cambridge Mathematical Textbooks (1993) Chap.1-2,3-4 S. Awodey, Category Theory, Oxford Logic Guides 52 (2010) 2-CCCAT and HORS June 7, 2014 19 / 21

Idées Idée 1 Utiliser un cadre catégorique pour spécifier la sémantique des langages. Idée 2 Utiliser un λ-calcul simplement typé, paramétré, comme support de construction. D où on part : Spécification des syntaxes avec lieurs Syntaxe avec lieurs λ-calcul simplement typé paramétré par une 1-signature Catégorie Sig 1 de 1-signatures Monade L 1 sur Sig 1 : termes engendrés Ce qu on propose : Spécification des systèmes de récriture avec lieurs raffiner les 1-signatures 2-signatures Réductions 2λ-calcul simplement typé paramétré par Σ Catégories, monades, etc. 2-CCCAT and HORS June 7, 2014 20 / 21

Retour sur l exemple Plus de termes dans L 1 (Σ) que dans Λ Repose sur la correspondance: Exemples: λx.m = l λx. M Termes du λ-calcul pur avec n variables libres Termes sur Σ tels que x 1 t,..., x n t M t MN = a M, N x = x 2-CCCAT and HORS June 7, 2014 21 / 21