SlideShare a Scribd company logo
1 of 38
Download to read offline
Pure Type Systems:
Dependents When You Need Them
Cody Roux
Draper Laboratories
February 17, 2015
Cody Roux (Draper Labs) PTSes February 17, 2015 1 / 38
Introduction
This talk is not about Haskell!
Cody Roux (Draper Labs) PTSes February 17, 2015 2 / 38
Introduction
Or is it?
Wait, which Haskell?
good ol’ Haskell 98
-XTypeFamilies
-XExistentialQuantification
-XRank2Types
-XRankNTypes
-XDataKinds
-XPolyKinds
-XGADTs
-XConstraintKinds
-XImpredicativeTypes
etc.
Cody Roux (Draper Labs) PTSes February 17, 2015 3 / 38
Introduction
This talk is about abstraction!
We want to understand -XFooBar in a unified framework
Cody Roux (Draper Labs) PTSes February 17, 2015 4 / 38
Abstraction
The simplest form of abstraction
We have an expression 2 + 2
We can abstract it as x + x where x = 2
Have we gained anything?
Cody Roux (Draper Labs) PTSes February 17, 2015 5 / 38
Abstraction
We can form the λ-abstraction
λx. x + x
This is already a very powerful idea!
Cody Roux (Draper Labs) PTSes February 17, 2015 6 / 38
STLC
The Simply Typed λ-Calculus
Some base types A, B, C, ...
Higher-order functions λx.λf .f x : A → (A → B) → B
A small miracle: every function is terminating.
Cody Roux (Draper Labs) PTSes February 17, 2015 7 / 38
Polymorphism
We want to have polymorphic functions
(λx.x) 3 → 3
(λx.x) true → true
How do we add this feature?
Cody Roux (Draper Labs) PTSes February 17, 2015 8 / 38
Polymorphic formulas
There are 2 possible answers!
First
Add type-level variables, X, Y , Z, ...
Add polymorphic quantification
∀X.X → X
Cody Roux (Draper Labs) PTSes February 17, 2015 9 / 38
Polymorphic formulas
What does ∀X.T quantify over?
1 Only the simple types
2 Any type from the extended language
These lead to dramatically different systems!
In the first case, the extension is conservative (no “new” functions)
In the second case, it is not (system F)
Cody Roux (Draper Labs) PTSes February 17, 2015 10 / 38
Dependent types
We can add term-level information to types:
[1, 2, 3] : ListN
[1, 2, 3] : VecN 3
We can add quantification as well:
reverse : ∀n, VecN n → VecN n
When is this kind of dependency conservative?
Cody Roux (Draper Labs) PTSes February 17, 2015 11 / 38
Pure Type Systems
Pure type systems:
are a generic framework for logics/programming lang.
only allow universal quantification/dependent function space
Cody Roux (Draper Labs) PTSes February 17, 2015 12 / 38
Pure Type Systems
Pure type systems are:
1 Expressive: ∃ a PTS that can express set theory
2 Well studied: invented in the 80s (Barendregt) and studied ever since!
3 Flexible: found at the core of several functional languages, including
Haskell, Agda, Coq.
4 Can be complex! There are several longstanding open questions
including
1 Typed Conversion ⇔ Untyped Conversion
2 Weak Normalization ⇔ Strong Normalization
Cody Roux (Draper Labs) PTSes February 17, 2015 13 / 38
Pure Type Systems
Can we answer our questions using PTS?
Cody Roux (Draper Labs) PTSes February 17, 2015 14 / 38
Pure Type Systems
A Pure Type System is defined as
1 A set of Sorts S
2 A set of Axioms A ⊆ S × S
3 A set of Rules R ⊆ S × S × S
That’s it!
Cody Roux (Draper Labs) PTSes February 17, 2015 15 / 38
Pure Type Systems
Informally
Elements ∗, , ι, ... ∈ S represent a category of objects.
For example
∗ may represent the category of propositions
may represent the category of types
ι may represent the category of natural numbers
Cody Roux (Draper Labs) PTSes February 17, 2015 16 / 38
Pure Type Systems
(s1, s2) ∈ A informally means:
s1 is a member of the category s2
Cody Roux (Draper Labs) PTSes February 17, 2015 17 / 38
Pure Type Systems
(s1, s2, s3) ∈ R informally means:
Quantifying over an element of s2 parametrized over an element of s1
gives a result in s3
if A : s1 and B(x) : s2 when x : A
then ∀x : A.B(x) : s3
We will write Πx : A.B instead of ∀x : A.B(x) (tradition)
Cody Roux (Draper Labs) PTSes February 17, 2015 18 / 38
Pure Type Systems
Given a PTS P we have the following type system:
Type/Sort formation
Γ ⊢axiom (s1, s2) ∈ A
Γ ⊢ s1 : s2
Γ ⊢ A : s1 Γ, x : A ⊢ B : s2
prod (s1, s2, s3) ∈ R
Γ ⊢ Πx : A.B : s3
Cody Roux (Draper Labs) PTSes February 17, 2015 19 / 38
Pure Type Systems
Term formation
Γ ⊢ A : svar s ∈ S
Γ, x : A ⊢ x : A
Γ, x : A ⊢ t : B Γ ⊢ Πx : A.B : s
abs s ∈ S
Γ ⊢ λx : A.t : Πx : A.B
Γ ⊢ t : Πx : A.B Γ ⊢ u : Aapp
Γ ⊢ t u : B[x → u]
Cody Roux (Draper Labs) PTSes February 17, 2015 20 / 38
Pure Type Systems
Conversion
Γ ⊢ t : A Γ ⊢ A′ : sconv A ≃β A′
, s ∈ S
Γ ⊢ t : A′
Where ≃β is β-equality
(λx : A.t)u ≃β t[x → u]
We omit the boring rules...
Cody Roux (Draper Labs) PTSes February 17, 2015 21 / 38
Pure Type Systems
The rest of this talk
Understanding this definition!
Cody Roux (Draper Labs) PTSes February 17, 2015 22 / 38
Simply Typed Lambda Calculus
We can model the STLC using
S = {∗, }
A = {(∗, )}
R = {(∗, ∗, ∗)}
We have e.g.
A : ∗ ⊢ λx : A.x : A → A
taking A → A = Πx : A. A
Cody Roux (Draper Labs) PTSes February 17, 2015 23 / 38
The λ-cube
Some more examples, contained in a family called the λ-cube:
The sorts are ∗,
∗ :
The rules are (k1, k2, k2) with ki = ∗ or
Each dimension of the cube highlights a different feature
Cody Roux (Draper Labs) PTSes February 17, 2015 24 / 38
The λ-cube
STLC
F
λΠ
λ2
λω
Fω
λΠω
CC
Cody Roux (Draper Labs) PTSes February 17, 2015 25 / 38
λ-cube
STLC = (∗, ∗)
F = (∗, ∗) ( , ∗)
λω = (∗, ∗) ( , )
λΠ = (∗, ∗) (∗, )
λ2 = (∗, ∗) (∗, ) ( , ∗)
Fω = (∗, ∗) ( , ∗) ( , )
λΠω = (∗, ∗) (∗, ) ( , )
CC = (∗, ∗) (∗, ) ( , ∗) ( , )
STLC
F
λΠ
λ2
λω
Fω
λΠω
CC
Cody Roux (Draper Labs) PTSes February 17, 2015 26 / 38
λ-cube features
Calculus Rule Feature Example
STLC (∗, ∗) Ordinary (higher-order) functions id : N → N
F ( , ∗) Impredicative polymorphism id : ∀X.X → X
λω ( , ) Type constructors rev : List A → List A
λΠ (∗, ) Dependent Types head : VecN (n + 1) → N
Cody Roux (Draper Labs) PTSes February 17, 2015 27 / 38
Example
Let’s work out an example in CC:
Induction on lists
∀A P l, P (nil A) → (∀a r, P r → P (cons A y r)) → P l
Π(A: ∗)(P : List A → ∗)(l : List A). P (nil A) → Π(a : A)(r : List A). P r → P (cons A y r) → P l
X → Y still means Π : A. B
Whiteboard time!
Cody Roux (Draper Labs) PTSes February 17, 2015 28 / 38
Example
No whiteboard?
List : ∗ → ∗
nil : ΠA : ∗. List A
cons : ΠA : ∗. A → List A → List A
Cody Roux (Draper Labs) PTSes February 17, 2015 29 / 38
Example
⊢ ∗ :
A: ∗ ⊢ List A : ∗ . . . ⊢ ∗ :
A: ∗ ⊢ List A → ∗ :
. . . ⊢ P (nil A) : ∗
...
. . . ⊢ . . . : ∗
...
A: ∗ ⊢ Π(P : List A → ∗)(l : List A) . . . : ∗
⊢ Π(A: ∗)(P : List A → ∗)(l : List A). P (nil A) → Π(a : A)(r : List A). P r → P (cons A y r) → P l : ∗
Cody Roux (Draper Labs) PTSes February 17, 2015 30 / 38
Other Calculi
Here are a few other examples:
Name Sorts Axioms Rules
STLC(1 base type) ι, ∗ (ι, ∗) (∗, ∗, ∗)
STLC ∗, (∗, ) (∗, ∗, ∗)
∗ : ∗ ∗ (∗, ∗) (∗, ∗, ∗)
System F ∗, (∗, ) (∗, ∗, ∗), ( , ∗, ∗)
CC ∗, (∗, ) (∗, ∗, ∗), ( , ∗, ∗),
(∗, , ), ( , , )
U−
∗, , △ (∗, ), (∗, ∗, ∗), ( , ∗, ∗),
( , △) ( , , ), (△, , )
CCω
∗, i , (∗, i ), (∗, ∗, ∗), ( i , ∗, ∗),
(core of Coq) i ∈ N ( i , j ), i < j ( i , j , k), k ≥ max(i, j)
Cody Roux (Draper Labs) PTSes February 17, 2015 31 / 38
Normalization
A PTS is normalizing ⇔ Γ ⊢ t : T ⇒ t has a β-normal form.
Normalization is a central property:
1 It ensures decidability of type-checking
2 It implies consistency of the system as a logic
Cody Roux (Draper Labs) PTSes February 17, 2015 32 / 38
Normalization
Normalization is hard to predict:
Name Axioms Rules Norm.
STLC(1 base type) (ι, ∗) (∗, ∗, ∗) Yes
STLC (∗, ) (∗, ∗, ∗) Yes
∗ : ∗ (∗, ∗) (∗, ∗, ∗) No
System F (∗, ) (∗, ∗, ∗), ( , ∗, ∗) Yes
CC (∗, ) (∗, ∗, ∗), ( , ∗, ∗), Yes
(∗, , ), ( , , )
U−
(∗, ), (∗, ∗, ∗), ( , ∗, ∗), No
( , △) ( , , ), (△, , )
CCω
(∗, i ), (∗, ∗, ∗), ( i , ∗, ∗), Yes
(core of Coq) ( i , j ), i < j ( i , j , k), k ≥ max(i, j)
Cody Roux (Draper Labs) PTSes February 17, 2015 33 / 38
Other Features
PTSes can capture things like predicative polymorphism:
Only instantiate ∀s with monomorphic types
∀X.X → X → N → N yes
∀X.X → X → (∀Y .Y → Y ) → (∀Y .Y → Y ) no
Sorts: ∗, ˆ∗,
Axioms: ∗ : , ˆ∗ :
Rules: STLC + {( , ∗, ˆ∗), ( , ˆ∗, ˆ∗)}
Cody Roux (Draper Labs) PTSes February 17, 2015 34 / 38
Other Features
We can seperate type-level data and program-level data
Sorts: ∗t, ∗p, t, p
Axioms: ∗t : t, ∗p : p
Rules:
{(∗t, ∗t, ∗t ), (∗p, ∗p, ∗p), (∗t, p, p)}
Nt lives in ∗t, Np lives in ∗p
Similar to GADTs!
Cody Roux (Draper Labs) PTSes February 17, 2015 35 / 38
More about U−
Remember U−
:
R = {(∗, ∗, ∗), ( , ∗, ∗), ( , , ), (△, , )}
This corresponds to Kind Polymorphism!
But...
It is inconsistent!
U−
⊢ t : ∀X. X
This is (maybe) bad news for constraint kinds!
Cody Roux (Draper Labs) PTSes February 17, 2015 36 / 38
Conclusion
Pure Type Systems are functional languages with simple syntax
They can explain many aspects of the Haskell Type System.
Pure Type Systems give fine grained ways of extending the typing
rules.
The meta-theory can be studied in a single generic framework.
There are still hard theory questions about PTS.
Cody Roux (Draper Labs) PTSes February 17, 2015 37 / 38
The End
Cody Roux (Draper Labs) PTSes February 17, 2015 38 / 38

More Related Content

What's hot

技術勉強会(楕円曲線暗号)資料
技術勉強会(楕円曲線暗号)資料技術勉強会(楕円曲線暗号)資料
技術勉強会(楕円曲線暗号)資料Tetsuyuki Oishi
 
数学つまみぐい入門編
数学つまみぐい入門編数学つまみぐい入門編
数学つまみぐい入門編Akira Yamaguchi
 
圏論とHaskellは仲良し
圏論とHaskellは仲良し圏論とHaskellは仲良し
圏論とHaskellは仲良しohmori
 
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデルDeep Learning JP
 
指数時間アルゴリズム入門
指数時間アルゴリズム入門指数時間アルゴリズム入門
指数時間アルゴリズム入門Yoichi Iwata
 
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜Ryoma Sin'ya
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門Kimikazu Kato
 
LLMとプランニングの世界
LLMとプランニングの世界LLMとプランニングの世界
LLMとプランニングの世界Carnot Inc.
 
競技プログラミングにおけるコードの書き方とその利便性
競技プログラミングにおけるコードの書き方とその利便性競技プログラミングにおけるコードの書き方とその利便性
競技プログラミングにおけるコードの書き方とその利便性Hibiki Yamashiro
 
自作ペアリング/BLS署名ライブラリの紹介
自作ペアリング/BLS署名ライブラリの紹介自作ペアリング/BLS署名ライブラリの紹介
自作ペアリング/BLS署名ライブラリの紹介MITSUNARI Shigeo
 
Intoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryIntoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryJack Fox
 
ウェーブレット木の世界
ウェーブレット木の世界ウェーブレット木の世界
ウェーブレット木の世界Preferred Networks
 
一階述語論理のメモ
一階述語論理のメモ一階述語論理のメモ
一階述語論理のメモKeisuke OTAKI
 
圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナド圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナドYoshihiro Mizoguchi
 
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...Yuya Masumura
 
[DL輪読会]Deep Learning 第12章 アプリケーション
[DL輪読会]Deep Learning 第12章 アプリケーション[DL輪読会]Deep Learning 第12章 アプリケーション
[DL輪読会]Deep Learning 第12章 アプリケーションDeep Learning JP
 

What's hot (20)

技術勉強会(楕円曲線暗号)資料
技術勉強会(楕円曲線暗号)資料技術勉強会(楕円曲線暗号)資料
技術勉強会(楕円曲線暗号)資料
 
数学つまみぐい入門編
数学つまみぐい入門編数学つまみぐい入門編
数学つまみぐい入門編
 
圏とHaskellの型
圏とHaskellの型圏とHaskellの型
圏とHaskellの型
 
圏論とHaskellは仲良し
圏論とHaskellは仲良し圏論とHaskellは仲良し
圏論とHaskellは仲良し
 
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル
[DL輪読会]Deep Learning 第16章 深層学習のための構造化確率モデル
 
指数時間アルゴリズム入門
指数時間アルゴリズム入門指数時間アルゴリズム入門
指数時間アルゴリズム入門
 
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門
 
LLMとプランニングの世界
LLMとプランニングの世界LLMとプランニングの世界
LLMとプランニングの世界
 
楕円曲線と暗号
楕円曲線と暗号楕円曲線と暗号
楕円曲線と暗号
 
ACPC 2018 Day3 G: 回文部分列 (Palindromic Subsequences)
ACPC 2018 Day3 G: 回文部分列 (Palindromic Subsequences)ACPC 2018 Day3 G: 回文部分列 (Palindromic Subsequences)
ACPC 2018 Day3 G: 回文部分列 (Palindromic Subsequences)
 
π計算
π計算π計算
π計算
 
競技プログラミングにおけるコードの書き方とその利便性
競技プログラミングにおけるコードの書き方とその利便性競技プログラミングにおけるコードの書き方とその利便性
競技プログラミングにおけるコードの書き方とその利便性
 
自作ペアリング/BLS署名ライブラリの紹介
自作ペアリング/BLS署名ライブラリの紹介自作ペアリング/BLS署名ライブラリの紹介
自作ペアリング/BLS署名ライブラリの紹介
 
Intoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryIntoduction to Homotopy Type Therory
Intoduction to Homotopy Type Therory
 
ウェーブレット木の世界
ウェーブレット木の世界ウェーブレット木の世界
ウェーブレット木の世界
 
一階述語論理のメモ
一階述語論理のメモ一階述語論理のメモ
一階述語論理のメモ
 
圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナド圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナド
 
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
 
[DL輪読会]Deep Learning 第12章 アプリケーション
[DL輪読会]Deep Learning 第12章 アプリケーション[DL輪読会]Deep Learning 第12章 アプリケーション
[DL輪読会]Deep Learning 第12章 アプリケーション
 

Similar to Cody Roux - Pure Type Systems - Boston Haskell Meetup

Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues listsJames Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
StacksqueueslistsFraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsYoung Alista
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingR Islam
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoJoel Falcou
 
Using R in remote computer clusters
Using R in remote computer clustersUsing R in remote computer clusters
Using R in remote computer clustersBurak Himmetoglu
 
Introduction to FDA and linear models
 Introduction to FDA and linear models Introduction to FDA and linear models
Introduction to FDA and linear modelstuxette
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Languagevsssuresh
 
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix KliuchnikovParsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix KliuchnikovVasil Remeniuk
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrisonComputer Science Club
 
Calculating Projections via Type Checking
Calculating Projections via Type CheckingCalculating Projections via Type Checking
Calculating Projections via Type CheckingDaisuke BEKKI
 

Similar to Cody Roux - Pure Type Systems - Boston Haskell Meetup (20)

Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
 
Big o
Big oBig o
Big o
 
Randomization
RandomizationRandomization
Randomization
 
5 csp
5 csp5 csp
5 csp
 
AlgorithmAnalysis2.ppt
AlgorithmAnalysis2.pptAlgorithmAnalysis2.ppt
AlgorithmAnalysis2.ppt
 
Presentation1
Presentation1Presentation1
Presentation1
 
Using R in remote computer clusters
Using R in remote computer clustersUsing R in remote computer clusters
Using R in remote computer clusters
 
Introduction to FDA and linear models
 Introduction to FDA and linear models Introduction to FDA and linear models
Introduction to FDA and linear models
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix KliuchnikovParsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Calculating Projections via Type Checking
Calculating Projections via Type CheckingCalculating Projections via Type Checking
Calculating Projections via Type Checking
 

Recently uploaded

Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxFurkanTasci3
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Spark3's new memory model/management
Spark3's new memory model/managementSpark3's new memory model/management
Spark3's new memory model/managementakshesh doshi
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 

Recently uploaded (20)

Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Spark3's new memory model/management
Spark3's new memory model/managementSpark3's new memory model/management
Spark3's new memory model/management
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 

Cody Roux - Pure Type Systems - Boston Haskell Meetup

  • 1. Pure Type Systems: Dependents When You Need Them Cody Roux Draper Laboratories February 17, 2015 Cody Roux (Draper Labs) PTSes February 17, 2015 1 / 38
  • 2. Introduction This talk is not about Haskell! Cody Roux (Draper Labs) PTSes February 17, 2015 2 / 38
  • 3. Introduction Or is it? Wait, which Haskell? good ol’ Haskell 98 -XTypeFamilies -XExistentialQuantification -XRank2Types -XRankNTypes -XDataKinds -XPolyKinds -XGADTs -XConstraintKinds -XImpredicativeTypes etc. Cody Roux (Draper Labs) PTSes February 17, 2015 3 / 38
  • 4. Introduction This talk is about abstraction! We want to understand -XFooBar in a unified framework Cody Roux (Draper Labs) PTSes February 17, 2015 4 / 38
  • 5. Abstraction The simplest form of abstraction We have an expression 2 + 2 We can abstract it as x + x where x = 2 Have we gained anything? Cody Roux (Draper Labs) PTSes February 17, 2015 5 / 38
  • 6. Abstraction We can form the λ-abstraction λx. x + x This is already a very powerful idea! Cody Roux (Draper Labs) PTSes February 17, 2015 6 / 38
  • 7. STLC The Simply Typed λ-Calculus Some base types A, B, C, ... Higher-order functions λx.λf .f x : A → (A → B) → B A small miracle: every function is terminating. Cody Roux (Draper Labs) PTSes February 17, 2015 7 / 38
  • 8. Polymorphism We want to have polymorphic functions (λx.x) 3 → 3 (λx.x) true → true How do we add this feature? Cody Roux (Draper Labs) PTSes February 17, 2015 8 / 38
  • 9. Polymorphic formulas There are 2 possible answers! First Add type-level variables, X, Y , Z, ... Add polymorphic quantification ∀X.X → X Cody Roux (Draper Labs) PTSes February 17, 2015 9 / 38
  • 10. Polymorphic formulas What does ∀X.T quantify over? 1 Only the simple types 2 Any type from the extended language These lead to dramatically different systems! In the first case, the extension is conservative (no “new” functions) In the second case, it is not (system F) Cody Roux (Draper Labs) PTSes February 17, 2015 10 / 38
  • 11. Dependent types We can add term-level information to types: [1, 2, 3] : ListN [1, 2, 3] : VecN 3 We can add quantification as well: reverse : ∀n, VecN n → VecN n When is this kind of dependency conservative? Cody Roux (Draper Labs) PTSes February 17, 2015 11 / 38
  • 12. Pure Type Systems Pure type systems: are a generic framework for logics/programming lang. only allow universal quantification/dependent function space Cody Roux (Draper Labs) PTSes February 17, 2015 12 / 38
  • 13. Pure Type Systems Pure type systems are: 1 Expressive: ∃ a PTS that can express set theory 2 Well studied: invented in the 80s (Barendregt) and studied ever since! 3 Flexible: found at the core of several functional languages, including Haskell, Agda, Coq. 4 Can be complex! There are several longstanding open questions including 1 Typed Conversion ⇔ Untyped Conversion 2 Weak Normalization ⇔ Strong Normalization Cody Roux (Draper Labs) PTSes February 17, 2015 13 / 38
  • 14. Pure Type Systems Can we answer our questions using PTS? Cody Roux (Draper Labs) PTSes February 17, 2015 14 / 38
  • 15. Pure Type Systems A Pure Type System is defined as 1 A set of Sorts S 2 A set of Axioms A ⊆ S × S 3 A set of Rules R ⊆ S × S × S That’s it! Cody Roux (Draper Labs) PTSes February 17, 2015 15 / 38
  • 16. Pure Type Systems Informally Elements ∗, , ι, ... ∈ S represent a category of objects. For example ∗ may represent the category of propositions may represent the category of types ι may represent the category of natural numbers Cody Roux (Draper Labs) PTSes February 17, 2015 16 / 38
  • 17. Pure Type Systems (s1, s2) ∈ A informally means: s1 is a member of the category s2 Cody Roux (Draper Labs) PTSes February 17, 2015 17 / 38
  • 18. Pure Type Systems (s1, s2, s3) ∈ R informally means: Quantifying over an element of s2 parametrized over an element of s1 gives a result in s3 if A : s1 and B(x) : s2 when x : A then ∀x : A.B(x) : s3 We will write Πx : A.B instead of ∀x : A.B(x) (tradition) Cody Roux (Draper Labs) PTSes February 17, 2015 18 / 38
  • 19. Pure Type Systems Given a PTS P we have the following type system: Type/Sort formation Γ ⊢axiom (s1, s2) ∈ A Γ ⊢ s1 : s2 Γ ⊢ A : s1 Γ, x : A ⊢ B : s2 prod (s1, s2, s3) ∈ R Γ ⊢ Πx : A.B : s3 Cody Roux (Draper Labs) PTSes February 17, 2015 19 / 38
  • 20. Pure Type Systems Term formation Γ ⊢ A : svar s ∈ S Γ, x : A ⊢ x : A Γ, x : A ⊢ t : B Γ ⊢ Πx : A.B : s abs s ∈ S Γ ⊢ λx : A.t : Πx : A.B Γ ⊢ t : Πx : A.B Γ ⊢ u : Aapp Γ ⊢ t u : B[x → u] Cody Roux (Draper Labs) PTSes February 17, 2015 20 / 38
  • 21. Pure Type Systems Conversion Γ ⊢ t : A Γ ⊢ A′ : sconv A ≃β A′ , s ∈ S Γ ⊢ t : A′ Where ≃β is β-equality (λx : A.t)u ≃β t[x → u] We omit the boring rules... Cody Roux (Draper Labs) PTSes February 17, 2015 21 / 38
  • 22. Pure Type Systems The rest of this talk Understanding this definition! Cody Roux (Draper Labs) PTSes February 17, 2015 22 / 38
  • 23. Simply Typed Lambda Calculus We can model the STLC using S = {∗, } A = {(∗, )} R = {(∗, ∗, ∗)} We have e.g. A : ∗ ⊢ λx : A.x : A → A taking A → A = Πx : A. A Cody Roux (Draper Labs) PTSes February 17, 2015 23 / 38
  • 24. The λ-cube Some more examples, contained in a family called the λ-cube: The sorts are ∗, ∗ : The rules are (k1, k2, k2) with ki = ∗ or Each dimension of the cube highlights a different feature Cody Roux (Draper Labs) PTSes February 17, 2015 24 / 38
  • 25. The λ-cube STLC F λΠ λ2 λω Fω λΠω CC Cody Roux (Draper Labs) PTSes February 17, 2015 25 / 38
  • 26. λ-cube STLC = (∗, ∗) F = (∗, ∗) ( , ∗) λω = (∗, ∗) ( , ) λΠ = (∗, ∗) (∗, ) λ2 = (∗, ∗) (∗, ) ( , ∗) Fω = (∗, ∗) ( , ∗) ( , ) λΠω = (∗, ∗) (∗, ) ( , ) CC = (∗, ∗) (∗, ) ( , ∗) ( , ) STLC F λΠ λ2 λω Fω λΠω CC Cody Roux (Draper Labs) PTSes February 17, 2015 26 / 38
  • 27. λ-cube features Calculus Rule Feature Example STLC (∗, ∗) Ordinary (higher-order) functions id : N → N F ( , ∗) Impredicative polymorphism id : ∀X.X → X λω ( , ) Type constructors rev : List A → List A λΠ (∗, ) Dependent Types head : VecN (n + 1) → N Cody Roux (Draper Labs) PTSes February 17, 2015 27 / 38
  • 28. Example Let’s work out an example in CC: Induction on lists ∀A P l, P (nil A) → (∀a r, P r → P (cons A y r)) → P l Π(A: ∗)(P : List A → ∗)(l : List A). P (nil A) → Π(a : A)(r : List A). P r → P (cons A y r) → P l X → Y still means Π : A. B Whiteboard time! Cody Roux (Draper Labs) PTSes February 17, 2015 28 / 38
  • 29. Example No whiteboard? List : ∗ → ∗ nil : ΠA : ∗. List A cons : ΠA : ∗. A → List A → List A Cody Roux (Draper Labs) PTSes February 17, 2015 29 / 38
  • 30. Example ⊢ ∗ : A: ∗ ⊢ List A : ∗ . . . ⊢ ∗ : A: ∗ ⊢ List A → ∗ : . . . ⊢ P (nil A) : ∗ ... . . . ⊢ . . . : ∗ ... A: ∗ ⊢ Π(P : List A → ∗)(l : List A) . . . : ∗ ⊢ Π(A: ∗)(P : List A → ∗)(l : List A). P (nil A) → Π(a : A)(r : List A). P r → P (cons A y r) → P l : ∗ Cody Roux (Draper Labs) PTSes February 17, 2015 30 / 38
  • 31. Other Calculi Here are a few other examples: Name Sorts Axioms Rules STLC(1 base type) ι, ∗ (ι, ∗) (∗, ∗, ∗) STLC ∗, (∗, ) (∗, ∗, ∗) ∗ : ∗ ∗ (∗, ∗) (∗, ∗, ∗) System F ∗, (∗, ) (∗, ∗, ∗), ( , ∗, ∗) CC ∗, (∗, ) (∗, ∗, ∗), ( , ∗, ∗), (∗, , ), ( , , ) U− ∗, , △ (∗, ), (∗, ∗, ∗), ( , ∗, ∗), ( , △) ( , , ), (△, , ) CCω ∗, i , (∗, i ), (∗, ∗, ∗), ( i , ∗, ∗), (core of Coq) i ∈ N ( i , j ), i < j ( i , j , k), k ≥ max(i, j) Cody Roux (Draper Labs) PTSes February 17, 2015 31 / 38
  • 32. Normalization A PTS is normalizing ⇔ Γ ⊢ t : T ⇒ t has a β-normal form. Normalization is a central property: 1 It ensures decidability of type-checking 2 It implies consistency of the system as a logic Cody Roux (Draper Labs) PTSes February 17, 2015 32 / 38
  • 33. Normalization Normalization is hard to predict: Name Axioms Rules Norm. STLC(1 base type) (ι, ∗) (∗, ∗, ∗) Yes STLC (∗, ) (∗, ∗, ∗) Yes ∗ : ∗ (∗, ∗) (∗, ∗, ∗) No System F (∗, ) (∗, ∗, ∗), ( , ∗, ∗) Yes CC (∗, ) (∗, ∗, ∗), ( , ∗, ∗), Yes (∗, , ), ( , , ) U− (∗, ), (∗, ∗, ∗), ( , ∗, ∗), No ( , △) ( , , ), (△, , ) CCω (∗, i ), (∗, ∗, ∗), ( i , ∗, ∗), Yes (core of Coq) ( i , j ), i < j ( i , j , k), k ≥ max(i, j) Cody Roux (Draper Labs) PTSes February 17, 2015 33 / 38
  • 34. Other Features PTSes can capture things like predicative polymorphism: Only instantiate ∀s with monomorphic types ∀X.X → X → N → N yes ∀X.X → X → (∀Y .Y → Y ) → (∀Y .Y → Y ) no Sorts: ∗, ˆ∗, Axioms: ∗ : , ˆ∗ : Rules: STLC + {( , ∗, ˆ∗), ( , ˆ∗, ˆ∗)} Cody Roux (Draper Labs) PTSes February 17, 2015 34 / 38
  • 35. Other Features We can seperate type-level data and program-level data Sorts: ∗t, ∗p, t, p Axioms: ∗t : t, ∗p : p Rules: {(∗t, ∗t, ∗t ), (∗p, ∗p, ∗p), (∗t, p, p)} Nt lives in ∗t, Np lives in ∗p Similar to GADTs! Cody Roux (Draper Labs) PTSes February 17, 2015 35 / 38
  • 36. More about U− Remember U− : R = {(∗, ∗, ∗), ( , ∗, ∗), ( , , ), (△, , )} This corresponds to Kind Polymorphism! But... It is inconsistent! U− ⊢ t : ∀X. X This is (maybe) bad news for constraint kinds! Cody Roux (Draper Labs) PTSes February 17, 2015 36 / 38
  • 37. Conclusion Pure Type Systems are functional languages with simple syntax They can explain many aspects of the Haskell Type System. Pure Type Systems give fine grained ways of extending the typing rules. The meta-theory can be studied in a single generic framework. There are still hard theory questions about PTS. Cody Roux (Draper Labs) PTSes February 17, 2015 37 / 38
  • 38. The End Cody Roux (Draper Labs) PTSes February 17, 2015 38 / 38