Efgects, Substitution and Induction An Explosive Ménage à Trois Pierre-Marie Pédrot , Nicolas Tabareau INRIA TYPES 2019 13th June 2019 Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 1 / 19
CIC, a very fancy intuitionistic logical system . CIC, a very powerful functional programming language . It’s Time to CIC Ass CIC, the Calculus of Inductive Constructions. Not just higher-order logic, not just fjrst-order logic First class notion of computation and crazy inductive types Finest types to describe your programs No clear phase separation between runtime and compile time The Pinnacle of the Curry-Howard correspondence Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 2 / 19
CIC, a very powerful functional programming language . It’s Time to CIC Ass CIC, the Calculus of Inductive Constructions. Not just higher-order logic, not just fjrst-order logic First class notion of computation and crazy inductive types Finest types to describe your programs No clear phase separation between runtime and compile time The Pinnacle of the Curry-Howard correspondence Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 2 / 19 CIC, a very fancy intuitionistic logical system .
It’s Time to CIC Ass CIC, the Calculus of Inductive Constructions. Not just higher-order logic, not just fjrst-order logic First class notion of computation and crazy inductive types Finest types to describe your programs No clear phase separation between runtime and compile time The Pinnacle of the Curry-Howard correspondence Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 2 / 19 CIC, a very fancy intuitionistic logical system . CIC, a very powerful functional programming language .
It’s Time to CIC Ass CIC, the Calculus of Inductive Constructions. Not just higher-order logic, not just fjrst-order logic First class notion of computation and crazy inductive types Finest types to describe your programs No clear phase separation between runtime and compile time The Pinnacle of the Curry-Howard correspondence Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 2 / 19 CIC, a very fancy intuitionistic logical system . CIC, a very powerful functional programming language .
It’s Time to CIC Ass CIC, the Calculus of Inductive Constructions. Not just higher-order logic, not just fjrst-order logic First class notion of computation and crazy inductive types Finest types to describe your programs No clear phase separation between runtime and compile time The Pinnacle of the Curry-Howard correspondence Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 2 / 19 CIC, a very fancy intuitionistic logical system . CIC, a very powerful functional programming language .
... and you’re asked the dreadful question. The Most Important Issue of Them All Yet CIC sufgers from a fundamental fmaw. You want to show the wonders of Coq to a fellow programmer You fjre your favourite IDE Could you write a Hello World? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 3 / 19
The Most Important Issue of Them All Yet CIC sufgers from a fundamental fmaw. You want to show the wonders of Coq to a fellow programmer You fjre your favourite IDE Could you write a Hello World? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 3 / 19 ... and you’re asked the dreadful question.
The Most Important Issue of Them All Yet CIC sufgers from a fundamental fmaw. You want to show the wonders of Coq to a fellow programmer You fjre your favourite IDE Could you write a Hello World? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 3 / 19 ... and you’re asked the dreadful question.
The Most Important Issue of Them All, Bis Thus, the same problem for mathematically inclined users. How do I reason classicall y? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 4 / 19 Intuitionistic Logic ⇔ Functional Programming
The Most Important Issue of Them All, Bis Thus, the same problem for mathematically inclined users. How do I reason classicall y? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 4 / 19 Intuitionistic Logic ⇔ Functional Programming
The Most Important Issue of Them All, Bis Thus, the same problem for mathematically inclined users. How do I reason classicall y? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 4 / 19 Intuitionistic Logic ⇔ Functional Programming
The Most Important Issue of Them All, Bis Thus, the same problem for mathematically inclined users. How do I reason classicall y? Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 4 / 19 Intuitionistic Logic ⇔ Functional Programming
Thesis We want a type theory with efgects! To program more! Non-termination Exceptions State... To prove more! Classical logic Univalence Choice... Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 5 / 19
Thesis We want a type theory with efgects! To program more! Non-termination Exceptions State... To prove more! Classical logic Univalence Choice... Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 5 / 19
Something is Rotten in the State of Type Theory Classical logic does not play well with type theory. Barthe and Uustalu: CPS cannot interpret dependent elimination Herbelin’s paradox: CIC + callcc is unsound! We have been working on efgectful type theories We are not the only ones, but our specialty: We justify them through program translations into CIC itself. Forcing, reader monad, exceptions, free algebraic... Efgectful theories are always half-broken dependent elimination has to be restricted (BTT) or consistency forsaken, or worse Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 6 / 19
Something is Rotten in the State of Type Theory Classical logic does not play well with type theory. Barthe and Uustalu: CPS cannot interpret dependent elimination Herbelin’s paradox: CIC + callcc is unsound! We have been working on efgectful type theories We are not the only ones, but our specialty: We justify them through program translations into CIC itself. Forcing, reader monad, exceptions, free algebraic... Efgectful theories are always half-broken dependent elimination has to be restricted (BTT) or consistency forsaken, or worse Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 6 / 19
Something is Rotten in the State of Type Theory Classical logic does not play well with type theory. Barthe and Uustalu: CPS cannot interpret dependent elimination Herbelin’s paradox: CIC + callcc is unsound! We have been working on efgectful type theories We are not the only ones, but our specialty: We justify them through program translations into CIC itself. Forcing, reader monad, exceptions, free algebraic... Efgectful theories are always half-broken dependent elimination has to be restricted (BTT) or consistency forsaken, or worse Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 6 / 19
Something is Rotten in the State of Type Theory Classical logic does not play well with type theory. Barthe and Uustalu: CPS cannot interpret dependent elimination Herbelin’s paradox: CIC + callcc is unsound! We have been working on efgectful type theories We are not the only ones, but our specialty: We justify them through program translations into CIC itself. Forcing, reader monad, exceptions, free algebraic... Efgectful theories are always half-broken dependent elimination has to be restricted (BTT) or consistency forsaken, or worse Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 6 / 19
The Important Bit This is not a coincidence! Herbelin / Barthe-Uustalu results are instances of a generic phenomenon! Also, this is kind of folklore. ... but I don’t recall reading it formally anywhere. Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 7 / 19
The Important Bit This is not a coincidence! Herbelin / Barthe-Uustalu results are instances of a generic phenomenon! Also, this is kind of folklore. ... but I don’t recall reading it formally anywhere. Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 7 / 19
Efgects, Efgects Everywhere! Such terms are typically called non-standard booleans. 13/06/2019 An Explosive Ménage à Trois Pédrot & Tabareau (INRIA) deciding inhabitation of a type. A A e.g. a function is _ empty This happens for many kind of efgects, including continuations. Defjnition but and 8 / 19 A type theory has observable efgects if there is a closed term t : B that is not observationally equivalent to a value , i.e. there is a context C [ · ] s.t. C [ true ] ≡ true C [ false ] ≡ true C [ t ] ≡ false
Efgects, Efgects Everywhere! Defjnition and but This happens for many kind of efgects, including continuations. Such terms are typically called non-standard booleans. Pédrot & Tabareau (INRIA) An Explosive Ménage à Trois 13/06/2019 8 / 19 A type theory has observable efgects if there is a closed term t : B that is not observationally equivalent to a value , i.e. there is a context C [ · ] s.t. C [ true ] ≡ true C [ false ] ≡ true C [ t ] ≡ false e.g. a function is _ empty : Π A . A → B deciding inhabitation of a type.
Recommend
More recommend