Failure is Not an Option - An Exceptional Type Theory

We define the exceptional translation, a syntactic translation of the Calculus of Inductive Constructions (CIC) into itself, that covers full dependent elimination. The new resulting type theory features call-by-name exceptions with decidable type-checking and canonicity, but at the price of inconsistency. Then, noticing parametricity amounts to Kreisel's realizability in this setting, we provide an additional layer on top of the exceptional translation in order to tame exceptions and ensure that all exceptions used locally are caught, leading to the parametric exceptional translation which fully preserves consistency. This way, we can consistently extend the logical expressivity of CIC with independence of premises, Markov's rule, and the negation of function extensionality while retaining η-expansion. As a byproduct, we also show that Markov's principle is not provable in CIC. Both translations have been implemented in a Coq plugin, which we use to formalize the examples.

[1]  Matthijs Vákár A Framework for Dependent Types and Effects , 2015, ArXiv.

[2]  Guillaume Munch-Maccagnoni Models of a Non-associative Composition , 2014, FoSSaCS.

[3]  A. Troelstra Metamathematical investigation of intuitionistic arithmetic and analysis , 1973 .

[4]  Benjamin Werner,et al.  Une Théorie des Constructions Inductives , 1994 .

[5]  Lars Birkedal,et al.  Hoare type theory, polymorphism and separation1 , 2008, Journal of Functional Programming.

[6]  Chantal Keller,et al.  Parametricity in an Impredicative Sort , 2012, ArXiv.

[7]  Thierry Coquand,et al.  The Independence of Markov's Principle in Type Theory , 2016, Log. Methods Comput. Sci..

[8]  Edwin Brady,et al.  Idris, a general-purpose dependently typed programming language: Design and implementation , 2013, Journal of Functional Programming.

[9]  Amal Ahmed,et al.  Type-preserving CPS translation of Σ and Π types is not not possible , 2017, Proc. ACM Program. Lang..

[10]  Jean-Philippe Bernardy,et al.  Realizability and Parametricity in Pure Type Systems , 2011, FoSSaCS.

[11]  Ohad Kammar,et al.  No value restriction is needed for algebraic effects and handlers , 2017, J. Funct. Program..

[12]  Hugo Herbelin,et al.  An Intuitionistic Logic that Proves Markov's Principle , 2010, 2010 25th Annual IEEE Symposium on Logic in Computer Science.

[13]  D. Dalen Review: Georg Kreisel, Godel's Intepretation of Heyting's Arithmetic; G. Kreisel, Relations Between Classes of Constructive Functionals; Georg Kreisel, A. Heyting, Interpretation of Analysis by Means of Constructive Functionals of Finite Types , 1971 .

[14]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[15]  Adam Chlipala,et al.  Effective interactive proofs for higher-order imperative programs , 2009, ICFP.

[16]  Gordon D. Plotkin,et al.  Dependent Types and Fibred Computational Effects , 2016, FoSSaCS.

[17]  Nicolas Tabareau,et al.  The Definitional Side of the Forcing , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[18]  Jeremy Avigad,et al.  Chapter V – Gödel’s Functional (“Dialectica”) Interpretation , 1998 .

[19]  Nicolas Tabareau,et al.  An effectful way to eliminate addiction to dependence , 2017, 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[20]  Simon Boulier,et al.  The next 700 syntactical models of type theory , 2017, CPP.

[21]  Nicolas Tabareau,et al.  Gradual certified programming in coq , 2015, DLS.

[22]  Stephanie Weirich,et al.  Combining proofs and programs in a dependently typed language , 2014, POPL.

[23]  Harvey M. Friedman,et al.  Classically and intuitionistically provably recursive functions , 1978 .

[24]  Thierry Coquand,et al.  The Calculus of Constructions , 1988, Inf. Comput..

[25]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[26]  Pierre-Yves Strub,et al.  Dependent types and multi-monadic effects in F* , 2016, POPL.

[27]  John Hatcliff,et al.  CPS Translations and Applications: The Cube and Beyond , 1999, High. Order Symb. Comput..

[28]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..