RETT, a Reasonably Exceptional Type Theory
Pierre-Marie Pédrot1, Nicolas Tabareau1, Hans Fehrmann2, Éric Tanter1, 2
1INRIA, 2University of Chile
ICFP 2019
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 1 / 19
RETT, a Reasonably Exceptional Type Theory Pierre-Marie Pdrot 1 , - - PowerPoint PPT Presentation
RETT, a Reasonably Exceptional Type Theory Pierre-Marie Pdrot 1 , Nicolas Tabareau 1 , Hans Fehrmann 2 , ric Tanter 1, 2 ICFP 2019 Pdrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 1 / 19 1 INRIA, 2
Pierre-Marie Pédrot1, Nicolas Tabareau1, Hans Fehrmann2, Éric Tanter1, 2
1INRIA, 2University of Chile
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 1 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 2 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 2 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 2 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 2 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 3 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 3 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 3 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 4 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 4 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 4 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 4 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 5 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 5 / 19
raise (Πx : A. B) ≡ λx : A. raise B match (raise I) ret P with ⃗ p ≡ raise (P (raise I))
rec
P P true P false b P b catch P P true P false P raise b P b catch P pt pf pe true pt catch P pt pf pe false pf catch P pt pf pe raise pe
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 6 / 19
raise (Πx : A. B) ≡ λx : A. raise B match (raise I) ret P with ⃗ p ≡ raise (P (raise I))
Brec : ΠP : B → □. P true → P false → Πb : B. P b
catchB : ΠP : B → □. P true → P false → P (raise B) → Πb : B. P b catchB P pt pf pe true ≡ pt catchB P pt pf pe false ≡ pf catchB P pt pf pe (raise B) ≡ pe
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 6 / 19
Use raise.
Use raise.
Use raise.
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 7 / 19
Use raise.
Use raise.
Use raise.
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 7 / 19
Use raise.
Use raise.
Use raise.
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 7 / 19
Use raise.
Use raise.
Use raise.
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 7 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 8 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 8 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 8 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 9 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 9 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 9 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 9 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 10 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 10 / 19
ExTT M
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 11 / 19
ExTT M
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 11 / 19
ExTT M
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 11 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 11 / 19
☹ Inconsistent ☺ Unrestricted use of exceptions ☺ Good for programming ☺ Consistent ☹ Exceptions virtually unusable ☹ Strange logical properties
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 12 / 19
☹ Inconsistent ☺ Unrestricted use of exceptions ☺ Good for programming ☺ Consistent ☹ Exceptions virtually unusable ☹ Strange logical properties
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 12 / 19
p i
e i
m i
Consistent No exceptions For proving Inconsistent Full exceptions For programming Consistent Local exceptions For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
p i
e i
m i
Consistent No exceptions For proving Inconsistent Full exceptions For programming Consistent Local exceptions For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
p i
e i
m i
Consistent No exceptions For proving Inconsistent Full exceptions For programming Consistent Local exceptions For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
i ∼ CIC
e i
m i
▷ Consistent ▷ No exceptions ▷ For proving Inconsistent Full exceptions For programming Consistent Local exceptions For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
i ∼ CIC
i ∼ ExTT
m i
▷ Consistent ▷ No exceptions ▷ For proving ▷ Inconsistent ▷ Full exceptions ▷ For programming Consistent Local exceptions For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
i ∼ CIC
i ∼ ExTT
i ∼ pExTT
▷ Consistent ▷ No exceptions ▷ For proving ▷ Inconsistent ▷ Full exceptions ▷ For programming ▷ Consistent ▷ Local exceptions ▷ For communication
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 13 / 19
i ∼ CIC
i ∼ ExTT
i ∼ pExTT
i
j
i j
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 14 / 19
i ∼ CIC
i ∼ ExTT
i ∼ pExTT
i
j
i j
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 14 / 19
i ∼ CIC
i ∼ ExTT
i ∼ pExTT
i
j
i ∨ j
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 14 / 19
CIC Brec : ΠP : B → □. P true → P false → Πb : B. P b ExTT Bcatch : ΠP : B → □. P true → P false → P (raise B) → Πb : B. P b
P
e m p e
m
p
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 15 / 19
CIC Brec : ΠP : B → □. P true → P false → Πb : B. P b ExTT Bcatch : ΠP : B → □. P true → P false → P (raise B) → Πb : B. P b
P : B → □β
B : □α
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 15 / 19
β
β
β
e → □m
e). P A x
(A lot to say, but I don’t have time.)
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 16 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 17 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 18 / 19
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 18 / 19
1 An inconsistent dependently-typed efgectful programming language 2 A consistent dependently-typed proof language 3 A consistent dependently-typed mediating language
Pédrot, Tabareau, Fehrmann & Tanter A Reasonably Exceptional Type Theory 21/08/2019 19 / 19