Subset Coercions in Coq

We propose a new language for writing programs with dependent types on top of the COQ proof assistant. This language permits to establish a phase distinction between writing and proving algorithms in the COQ environment. Concretely, this means allowing to write algorithms as easily as in a practical functional programming language whilst giving them as rich a specification as desired and proving that the code meets the specification using the whole COQ proof apparatus. This is achieved by extending conversion to an equivalence which relates types and subsets based on them, a technique originating from the "Predicate subtyping" feature of PVS and following mathematical convention. The typing judgements can be translated to the Calculus of (Co-)Inductive Constructions (CIC) by means of an interpretation which inserts coercions at the appropriate places. These coercions can contain existential variables representing the propositional parts of the final term, corresponding to proof obligations (or PVS type-checking conditions). A prototype implementation of this process is integrated with the COQ environment.

[1]  Shankar Natarajan,et al.  The Formal Semantics of PVS , 1999 .

[2]  Pavel Naumov,et al.  Logic of subtyping , 2006, Theor. Comput. Sci..

[3]  Gang Chen Sous-typage, conversion de types et elimination de la transitivite , 1998 .

[4]  Amokrane Saïbi Typing algorithm in type theory with inheritance , 1997, POPL '97.

[5]  Catherine Parent,et al.  Synthesizing Proofs from Programs in the Calculus of Inductive Constructions , 1995, MPC.

[6]  Zhaohui Luo,et al.  Coercive Subtyping in Type Theory , 1996, CSL.

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

[8]  Benjamin Werner On the Strength of Proof-Irrelevant Type Theories , 2006, IJCAR.

[9]  Robin Adams Pure type systems with judgemental equality , 2006, J. Funct. Program..

[10]  Martin Wirsing,et al.  Extraction of Structured Programs from Specification Proofs , 1999, WADT.

[11]  P. Medawar A view from the left , 1984, Nature.

[12]  Bengt Nordström,et al.  Programming in Martin-Löf's Type Theory , 1990 .

[13]  Bengt Nordström,et al.  Programming in Martin-Lo¨f's type theory: an introduction , 1990 .

[14]  Herman Geuvers,et al.  A short and flexible proof of Strong Normalization for the Calculus of Constructions , 1994, TYPES.

[15]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.

[16]  Benjamin Werner On the Strength of Proof-irrelevant Type Theories , 2008, Log. Methods Comput. Sci..

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

[18]  Maribel Fernández,et al.  Curry-Style Types for Nominal Terms , 2006, TYPES.

[19]  Alex K. Simpson,et al.  Computational Adequacy in an Elementary Topos , 1998, CSL.

[20]  Gang Chen Coercive subtyping for the calculus of constructions , 2003, POPL '03.

[21]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[22]  Giuseppe Longo,et al.  A Logic of Subtyping (Extended Abstract) , 1995, LICS 1995.

[23]  Benjamin Werner,et al.  The Not So Simple Proof-Irrelevant Model of CC , 2002, TYPES.

[24]  Natarajan Shankar,et al.  Principles and Pragmatics of Subtyping in PVS , 1999, WADT.

[25]  Giuseppe Longo,et al.  A logic of subtyping , 1995, Proceedings of Tenth Annual IEEE Symposium on Logic in Computer Science.