SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
Reduction Monads
and Their Signatures
Benedikt Ahrens, André Hirschowitz, Ambroise Lafont, Marco Maggesi

POPL’20

January 24, 2020, New Orleans, USA
Overview
Abstract point-of-view on programming languages
To specify a (functional untyped) programming language we need:

‣ a syntax for programs (terms, sometimes modulo equations)

‣ a well-behaved substitution

‣ a syntax for reductions

‣ models (semantics)

Our work: a theoretical framework for specifying and reasoning about all the
above aspects of an abstract programming language.

Our paradigmatic example will be the -calculus with -reduction.λ β
Initial Semantics
Quick introduction on Initial Semantics
The essential steps are:

1. Establish a notion of signature (abstract description of a language)

2. To each signature associate a category of models

3. Prove that this category has an initial object

Then:

‣ the initial object is the language 

‣ the initial morphisms are the semantics of this language.
Toy example: language of natural numbers
• and are constructors of arities 0 and 1 (signature: (0, 1)).

• Models are diagrams in of the form .

• The diagram is the initial model.

• The initial morphism
encodes the classical recursion principle.
Z S
𝖲𝖾𝗍 ( ∙
ZX
⟶ X
SX
⟶ X)
( ∙
Z
⟶ ℕ
S
⟶ ℕ)
( ∙
Z
⟶ ℕ
S
⟶ ℕ) ⟶ (∙
ZX
⟶ X
SX
⟶ X)

ℕ ::= Z : ℕ
| S : ℕ → ℕ
Beyond the syntax of terms
• It is well-known that Initial Semantics can describe the shape of terms of a
language.

• But we need more than just terms: substitution, reduction, …

• We use Initial Semantics to do this all at once.

• In other words: generate semantic morphisms that are well-behaved with
respect to:

- substitution

- binding constructions and free/bound variables

- equations

- reductions
Monads and
Modules over monads
Example: Monad of -termsλ
Monads (and modules over a monad) occur in our context as an axiomatic
theory of substitution.

Example: Monad of (untyped) -terms modulo -conversion:

‣ 

set of -terms with free variables in 

‣ construction of variables

‣ parallel capture-avoiding
substitution

‣ properties of substitution (e.g. associativity) = monad laws
λ α
Λ(X) := { M | 𝖿𝗏(M) ⊆ X }
λ X
ηΛ : X ⟶ Λ(X)
𝖻𝗂𝗇𝖽Λ : (X → Λ(Y)) ⟶ (Λ(X) → Λ(Y))
A module over a monad is an endofunctor endowed with an action of
:

‣ 

‣ 

‣ module laws (compatibility laws with ).

NB: Every monad is trivially a module over itself.
M R
R
M : 𝖲𝖾𝗍 ⟶ 𝖲𝖾𝗍
𝗆𝖻𝗂𝗇𝖽 : (X → R(Y)) ⟶ (M(X) → M(Y))
R
R
Modules over a monad
Crucial examples of modules
Product: Pairs of terms of a monad :

‣ 

‣ 

Derived modules: Terms with bound variables ( set of cardinality )

‣ 

‣
R
R × R : X ↦ R(X) × R(X)
𝗆𝖻𝗂𝗇𝖽R×R : (X → R(Y)) ⟶ (R(X) × R(X) → R(Y) × R(Y))
n n n
R(n)
: X ↦ R(X + n)
𝗆𝖻𝗂𝗇𝖽R(n) : (X → R(Y)) ⟶ (R(X + n) → R(Y + n))
Example: -terms (again)λ
Application and abstraction are -modules morphisms (i.e., natural
transformations that are compatible with the substitution). 

• Application:





• Abstraction:



Λ
𝖺𝗉𝗉X
: Λ(X) × Λ(X) ⟶ Λ(X)
𝖺𝗉𝗉X
: (M, N) ↦ MN
𝖺𝖻𝗌X : Λ(1)
(X) ⟶ Λ(X)
𝖺𝖻𝗌X : M[ ] ↦ λx . M[x]
-reduction as a pair of module morphismsβ
Metavariables: 

Module of metavariables:
(T, U)
Λ(1)
× Λ
𝖺𝗉𝗉( 𝖺𝖻𝗌(T), U)
β
⟶ T{⋆ := U}
β-Red
Source morphism:

Λ(1)
× Λ ⟶ Λ
(T, U) ↦ 𝖺𝗉𝗉( 𝖺𝖻𝗌(T), U)
Target morphism:

Λ(1)
× Λ ⟶ Λ
(T, U) ↦ T{⋆ := U}
Our achievement
Our stack of signatures
Signatures for syntactic constructions [CSL 2018]
Reduction rules [POPL 2020]
Signatures for equations [FSCD 2019]
}
Signatures
for monads
{
Reduction
signatures
What you can find in our paper
• An initial semantic approach to abstract programming language, in particular:

‣ A notion of reduction monad (mathematical model of programming language)

‣ A general notion of reduction signature that can specify reduction monads

‣ The associated notion of category of models

‣ A theorem that ensures (under suitable hypotheses) the existence of an initial
model

• Several examples of -calculi presented with our framework, including:

‣ several kind of rules and reduction strategies ( -red, hnf, whnf, parallel- ,…)

‣ extensions of the of -calculus (fixpoint operator, explicit substitution)
λ
βη β
λ
Thanks!

Contenu connexe

Tendances

Regular expression
Regular expressionRegular expression
Regular expressionRajon
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languagesparmeet834
 
Fast evaluation of Connectionist Language Models
Fast evaluation of Connectionist Language ModelsFast evaluation of Connectionist Language Models
Fast evaluation of Connectionist Language ModelsFrancisco Zamora-Martinez
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logicDevaddd
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Animesh Chaturvedi
 
10 - Models and languages
10 - Models and languages10 - Models and languages
10 - Models and languagesTudor Girba
 
PATTY: A Taxonomy of Relational Patterns with Semantic Types
PATTY: A Taxonomy of Relational Patterns with Semantic TypesPATTY: A Taxonomy of Relational Patterns with Semantic Types
PATTY: A Taxonomy of Relational Patterns with Semantic TypesAkihiro Kameda
 
PROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologDataminingTools Inc
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prologsaru40
 
Regular language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expressionAnimesh Chaturvedi
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management SystemKevin Jadiya
 
Calculus 45S Slides March 17, 2008
Calculus 45S Slides March 17, 2008Calculus 45S Slides March 17, 2008
Calculus 45S Slides March 17, 2008Darren Kuropatwa
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimStalin Thangaraj
 

Tendances (20)

Regular expression
Regular expressionRegular expression
Regular expression
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
 
Minimizing DFA
Minimizing DFAMinimizing DFA
Minimizing DFA
 
Hak ontoforum
Hak ontoforumHak ontoforum
Hak ontoforum
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Fol
FolFol
Fol
 
First order logic
First order logicFirst order logic
First order logic
 
Theory of computation Lec1
Theory of computation Lec1Theory of computation Lec1
Theory of computation Lec1
 
Fast evaluation of Connectionist Language Models
Fast evaluation of Connectionist Language ModelsFast evaluation of Connectionist Language Models
Fast evaluation of Connectionist Language Models
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
 
10 - Models and languages
10 - Models and languages10 - Models and languages
10 - Models and languages
 
PATTY: A Taxonomy of Relational Patterns with Semantic Types
PATTY: A Taxonomy of Relational Patterns with Semantic TypesPATTY: A Taxonomy of Relational Patterns with Semantic Types
PATTY: A Taxonomy of Relational Patterns with Semantic Types
 
PROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In Prolog
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
 
Regular language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expression
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Calculus 45S Slides March 17, 2008
Calculus 45S Slides March 17, 2008Calculus 45S Slides March 17, 2008
Calculus 45S Slides March 17, 2008
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to Vim
 

Similaire à Reduction Monads and Their Signatures

[Emnlp] what is glo ve part i - towards data science
[Emnlp] what is glo ve  part i - towards data science[Emnlp] what is glo ve  part i - towards data science
[Emnlp] what is glo ve part i - towards data scienceNikhil Jaiswal
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del LinguaggioAlumni Mathematica
 
Design and analysis of Algorithms - Lecture 08 (1).ppt
Design and analysis of Algorithms - Lecture 08 (1).pptDesign and analysis of Algorithms - Lecture 08 (1).ppt
Design and analysis of Algorithms - Lecture 08 (1).pptZeenaJaba
 
Word2vec slide(lab seminar)
Word2vec slide(lab seminar)Word2vec slide(lab seminar)
Word2vec slide(lab seminar)Jinpyo Lee
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSCSSN
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)SURBHI SAROHA
 
Point-free semantics of dependent type theories
Point-free semantics of dependent type theoriesPoint-free semantics of dependent type theories
Point-free semantics of dependent type theoriesMarco Benini
 
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...L. Thorne McCarty
 
[FT-11][ltchen] A Tale of Two Monads
[FT-11][ltchen] A Tale of Two Monads[FT-11][ltchen] A Tale of Two Monads
[FT-11][ltchen] A Tale of Two MonadsFunctional Thursday
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework HelpExcel Homework Help
 
Lambda Calculus by Dustin Mulcahey
Lambda Calculus by Dustin Mulcahey Lambda Calculus by Dustin Mulcahey
Lambda Calculus by Dustin Mulcahey Hakka Labs
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture NotesFellowBuddy.com
 
S-CUBE LP: Executing the HOCL: Concept of a Chemical Interpreter
S-CUBE LP: Executing the HOCL: Concept of a Chemical InterpreterS-CUBE LP: Executing the HOCL: Concept of a Chemical Interpreter
S-CUBE LP: Executing the HOCL: Concept of a Chemical Interpretervirtual-campus
 
A Neural Probabilistic Language Model_v2
A Neural Probabilistic Language Model_v2A Neural Probabilistic Language Model_v2
A Neural Probabilistic Language Model_v2Jisoo Jang
 

Similaire à Reduction Monads and Their Signatures (20)

H-MLQ
H-MLQH-MLQ
H-MLQ
 
[Emnlp] what is glo ve part i - towards data science
[Emnlp] what is glo ve  part i - towards data science[Emnlp] what is glo ve  part i - towards data science
[Emnlp] what is glo ve part i - towards data science
 
AI-09 Logic in AI
AI-09 Logic in AIAI-09 Logic in AI
AI-09 Logic in AI
 
R meetup lm
R meetup lmR meetup lm
R meetup lm
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio
 
Lecture1.pptx
Lecture1.pptxLecture1.pptx
Lecture1.pptx
 
Design and analysis of Algorithms - Lecture 08 (1).ppt
Design and analysis of Algorithms - Lecture 08 (1).pptDesign and analysis of Algorithms - Lecture 08 (1).ppt
Design and analysis of Algorithms - Lecture 08 (1).ppt
 
Word2vec slide(lab seminar)
Word2vec slide(lab seminar)Word2vec slide(lab seminar)
Word2vec slide(lab seminar)
 
Lambda Calculus
Lambda CalculusLambda Calculus
Lambda Calculus
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision Making
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
Point-free semantics of dependent type theories
Point-free semantics of dependent type theoriesPoint-free semantics of dependent type theories
Point-free semantics of dependent type theories
 
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
 
[FT-11][ltchen] A Tale of Two Monads
[FT-11][ltchen] A Tale of Two Monads[FT-11][ltchen] A Tale of Two Monads
[FT-11][ltchen] A Tale of Two Monads
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework Help
 
Lambda Calculus by Dustin Mulcahey
Lambda Calculus by Dustin Mulcahey Lambda Calculus by Dustin Mulcahey
Lambda Calculus by Dustin Mulcahey
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Monads
MonadsMonads
Monads
 
S-CUBE LP: Executing the HOCL: Concept of a Chemical Interpreter
S-CUBE LP: Executing the HOCL: Concept of a Chemical InterpreterS-CUBE LP: Executing the HOCL: Concept of a Chemical Interpreter
S-CUBE LP: Executing the HOCL: Concept of a Chemical Interpreter
 
A Neural Probabilistic Language Model_v2
A Neural Probabilistic Language Model_v2A Neural Probabilistic Language Model_v2
A Neural Probabilistic Language Model_v2
 

Dernier

Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Cherry
 
Cyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCherry
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Cherry
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Role of AI in seed science Predictive modelling and Beyond.pptx
Role of AI in seed science  Predictive modelling and  Beyond.pptxRole of AI in seed science  Predictive modelling and  Beyond.pptx
Role of AI in seed science Predictive modelling and Beyond.pptxArvind Kumar
 
Cot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNACot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNACherry
 
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...Monika Rani
 
Site specific recombination and transposition.........pdf
Site specific recombination and transposition.........pdfSite specific recombination and transposition.........pdf
Site specific recombination and transposition.........pdfCherry
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCherry
 
GBSN - Microbiology (Unit 3)Defense Mechanism of the body
GBSN - Microbiology (Unit 3)Defense Mechanism of the body GBSN - Microbiology (Unit 3)Defense Mechanism of the body
GBSN - Microbiology (Unit 3)Defense Mechanism of the body Areesha Ahmad
 
Concept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfConcept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfCherry
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsSérgio Sacani
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Cherry
 
FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.takadzanijustinmaime
 
Genome organization in virus,bacteria and eukaryotes.pptx
Genome organization in virus,bacteria and eukaryotes.pptxGenome organization in virus,bacteria and eukaryotes.pptx
Genome organization in virus,bacteria and eukaryotes.pptxCherry
 
LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.Cherry
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusNazaninKarimi6
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxseri bangash
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learninglevieagacer
 

Dernier (20)

Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Plasmid: types, structure and functions.
Plasmid: types, structure and functions.
 
Cyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptx
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Role of AI in seed science Predictive modelling and Beyond.pptx
Role of AI in seed science  Predictive modelling and  Beyond.pptxRole of AI in seed science  Predictive modelling and  Beyond.pptx
Role of AI in seed science Predictive modelling and Beyond.pptx
 
Cot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNACot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNA
 
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
 
Site specific recombination and transposition.........pdf
Site specific recombination and transposition.........pdfSite specific recombination and transposition.........pdf
Site specific recombination and transposition.........pdf
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
 
GBSN - Microbiology (Unit 3)Defense Mechanism of the body
GBSN - Microbiology (Unit 3)Defense Mechanism of the body GBSN - Microbiology (Unit 3)Defense Mechanism of the body
GBSN - Microbiology (Unit 3)Defense Mechanism of the body
 
Concept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfConcept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdf
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.
 
FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.
 
Genome organization in virus,bacteria and eukaryotes.pptx
Genome organization in virus,bacteria and eukaryotes.pptxGenome organization in virus,bacteria and eukaryotes.pptx
Genome organization in virus,bacteria and eukaryotes.pptx
 
LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 

Reduction Monads and Their Signatures

  • 1. Reduction Monads and Their Signatures Benedikt Ahrens, André Hirschowitz, Ambroise Lafont, Marco Maggesi POPL’20 January 24, 2020, New Orleans, USA
  • 3. Abstract point-of-view on programming languages To specify a (functional untyped) programming language we need: ‣ a syntax for programs (terms, sometimes modulo equations) ‣ a well-behaved substitution ‣ a syntax for reductions ‣ models (semantics) Our work: a theoretical framework for specifying and reasoning about all the above aspects of an abstract programming language. Our paradigmatic example will be the -calculus with -reduction.λ β
  • 5. Quick introduction on Initial Semantics The essential steps are: 1. Establish a notion of signature (abstract description of a language) 2. To each signature associate a category of models 3. Prove that this category has an initial object Then: ‣ the initial object is the language ‣ the initial morphisms are the semantics of this language.
  • 6. Toy example: language of natural numbers • and are constructors of arities 0 and 1 (signature: (0, 1)). • Models are diagrams in of the form . • The diagram is the initial model. • The initial morphism encodes the classical recursion principle. Z S 𝖲𝖾𝗍 ( ∙ ZX ⟶ X SX ⟶ X) ( ∙ Z ⟶ ℕ S ⟶ ℕ) ( ∙ Z ⟶ ℕ S ⟶ ℕ) ⟶ (∙ ZX ⟶ X SX ⟶ X) 
ℕ ::= Z : ℕ | S : ℕ → ℕ
  • 7. Beyond the syntax of terms • It is well-known that Initial Semantics can describe the shape of terms of a language. • But we need more than just terms: substitution, reduction, … • We use Initial Semantics to do this all at once. • In other words: generate semantic morphisms that are well-behaved with respect to: - substitution - binding constructions and free/bound variables - equations - reductions
  • 9. Example: Monad of -termsλ Monads (and modules over a monad) occur in our context as an axiomatic theory of substitution. Example: Monad of (untyped) -terms modulo -conversion: ‣ 
 set of -terms with free variables in ‣ construction of variables ‣ parallel capture-avoiding substitution ‣ properties of substitution (e.g. associativity) = monad laws λ α Λ(X) := { M | 𝖿𝗏(M) ⊆ X } λ X ηΛ : X ⟶ Λ(X) 𝖻𝗂𝗇𝖽Λ : (X → Λ(Y)) ⟶ (Λ(X) → Λ(Y))
  • 10. A module over a monad is an endofunctor endowed with an action of : ‣ ‣ ‣ module laws (compatibility laws with ). NB: Every monad is trivially a module over itself. M R R M : 𝖲𝖾𝗍 ⟶ 𝖲𝖾𝗍 𝗆𝖻𝗂𝗇𝖽 : (X → R(Y)) ⟶ (M(X) → M(Y)) R R Modules over a monad
  • 11. Crucial examples of modules Product: Pairs of terms of a monad : ‣ ‣ Derived modules: Terms with bound variables ( set of cardinality ) ‣ ‣ R R × R : X ↦ R(X) × R(X) 𝗆𝖻𝗂𝗇𝖽R×R : (X → R(Y)) ⟶ (R(X) × R(X) → R(Y) × R(Y)) n n n R(n) : X ↦ R(X + n) 𝗆𝖻𝗂𝗇𝖽R(n) : (X → R(Y)) ⟶ (R(X + n) → R(Y + n))
  • 12. Example: -terms (again)λ Application and abstraction are -modules morphisms (i.e., natural transformations that are compatible with the substitution). • Application: • Abstraction: Λ 𝖺𝗉𝗉X : Λ(X) × Λ(X) ⟶ Λ(X) 𝖺𝗉𝗉X : (M, N) ↦ MN 𝖺𝖻𝗌X : Λ(1) (X) ⟶ Λ(X) 𝖺𝖻𝗌X : M[ ] ↦ λx . M[x]
  • 13. -reduction as a pair of module morphismsβ Metavariables: Module of metavariables: (T, U) Λ(1) × Λ 𝖺𝗉𝗉( 𝖺𝖻𝗌(T), U) β ⟶ T{⋆ := U} β-Red Source morphism: Λ(1) × Λ ⟶ Λ (T, U) ↦ 𝖺𝗉𝗉( 𝖺𝖻𝗌(T), U) Target morphism: Λ(1) × Λ ⟶ Λ (T, U) ↦ T{⋆ := U}
  • 15. Our stack of signatures Signatures for syntactic constructions [CSL 2018] Reduction rules [POPL 2020] Signatures for equations [FSCD 2019] } Signatures for monads { Reduction signatures
  • 16. What you can find in our paper • An initial semantic approach to abstract programming language, in particular: ‣ A notion of reduction monad (mathematical model of programming language) ‣ A general notion of reduction signature that can specify reduction monads ‣ The associated notion of category of models ‣ A theorem that ensures (under suitable hypotheses) the existence of an initial model • Several examples of -calculi presented with our framework, including: ‣ several kind of rules and reduction strategies ( -red, hnf, whnf, parallel- ,…) ‣ extensions of the of -calculus (fixpoint operator, explicit substitution) λ βη β λ