Combining proofs and programs in a dependently typed language

Most dependently-typed programming languages either require that all expressions terminate (e.g. Coq, Agda, and Epigram), or allow infinite loops but are inconsistent when viewed as logics (e.g. Haskell, ATS, Ωmega. Here, we combine these two approaches into a single dependently-typed core language. The language is composed of two fragments that share a common syntax and overlapping semantics: a logic that guarantees total correctness, and a call-by-value programming language that guarantees type safety but not termination. The two fragments may interact: logical expressions may be used as programs; the logic may soundly reason about potentially nonterminating programs; programs can require logical proofs as arguments; and "mobile" program values, including proofs computed at runtime, may be used as evidence by the logic. This language allows programmers to work with total and partial functions uniformly, providing a smooth path from functional programming to dependently-typed programming.

[1]  Nathan Mishra-Linger,et al.  Erasure and Polymorphism in Pure Type Systems , 2008, FoSSaCS.

[2]  P. Aczel,et al.  Homotopy Type Theory: Univalent Foundations of Mathematics , 2013 .

[3]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

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

[5]  Chiyan Chen,et al.  Combining programming with theorem proving , 2005, ICFP '05.

[6]  Richard Statman,et al.  Lambda Calculus with Types , 2013, Perspectives in logic.

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

[8]  Robert L. Constable,et al.  Partial Objects In Constructive Type Theory , 1987, Logic in Computer Science.

[9]  Jaap van Oosten,et al.  The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics. http: //homotopytypetheory.org/book, Institute for Advanced Study, 2013, vii + 583 pp , 2014, Bulletin of Symbolic Logic.

[10]  William W. Tait,et al.  Intensional interpretations of functionals of finite type I , 1967, Journal of Symbolic Logic.

[11]  Gilles Barthe,et al.  Setoids in type theory , 2003, Journal of Functional Programming.

[12]  Stephanie Weirich,et al.  Step-Indexed Normalization for a Language with General Recursion , 2012, MSFP.

[13]  Zhaohui Luo,et al.  Computation and reasoning - a type theory for computer science , 1994, International series of monographs on computer science.

[14]  Samson Abramsky,et al.  Handbook of logic in computer science. , 1992 .

[15]  Alexandre Miquel,et al.  The Implicit Calculus of Constructions Extending Pure Type Systems with an Intersection Type Binder and Subtyping , 2001 .

[16]  Yves Bertot,et al.  Fixed point semantics and partial recursion in Coq , 2008, PPDP.

[17]  Karl Crary,et al.  Type-Safe Distributed Programming with ML5 , 2007, TGC.

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

[19]  Timothy W. Simpson,et al.  Verified programming in Guru , 2009, PLPV '09.

[20]  Lars Birkedal,et al.  Ynot: dependent types for imperative programs , 2008, ICFP.

[21]  François Monin,et al.  Principles and Practice of Declarative Programming , 1999, Lecture Notes in Computer Science.

[22]  Amal Ahmed,et al.  Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types , 2006, ESOP.

[23]  Chung-chieh Shan,et al.  Higher-order and Symbolic Computation Manuscript No. a Static Simulation of Dynamic Delimited Control , 2022 .

[24]  Scott F. Smith Partial Objects in Type Theory , 1988 .

[25]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

[26]  Ralf Hinze,et al.  Implementation and Application of Functional Languages , 2012, Lecture Notes in Computer Science.

[27]  Stephanie Weirich,et al.  Irrelevance, Heterogeneous Equality, and Call-by-value Dependent Type Systems , 2012, MSFP.

[28]  Venanzio Capretta,et al.  General recursion via coinductive types , 2005, Log. Methods Comput. Sci..

[29]  Edwin Brady,et al.  IDRIS ---: systems programming meets full dependent types , 2011, PLPV '11.

[30]  Tim Sheard,et al.  A hierarchy of mendler style recursion combinators: taming inductive datatypes with negative occurrences , 2011, ICFP '11.

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

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

[33]  Lars Birkedal,et al.  Partiality, State and Dependent Types , 2011, TLCA.

[34]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[35]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

[36]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

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

[38]  Tom Ridge,et al.  Ott: effective tool support for the working semanticist , 2007, ICFP '07.

[39]  Thorsten Altenkirch,et al.  PiSigma: Dependent Types without the Sugar , 2010, FLOPS.

[40]  Bruno Barras,et al.  The Implicit Calculus of Constructions as a Programming Language with Dependent Types , 2008, FoSSaCS.

[41]  Glynn Winskel,et al.  The formal semantics of programming languages - an introduction , 1993, Foundation of computing series.

[42]  Andrew W. Appel,et al.  An indexed model of recursive types for foundational proof-carrying code , 2001, TOPL.

[43]  Juan Chen,et al.  Secure distributed programming with value-dependent types , 2011, Journal of Functional Programming.

[44]  Nathan Mishra-Linger,et al.  Programming in Omega , 2008, CEFP.

[45]  Albert Oliveras,et al.  Fast congruence closure and extensions , 2007, Inf. Comput..

[46]  David Walker,et al.  Modal Proofs as Distributed Programs (Extended Abstract) , 2004, ESOP.

[47]  Steve Zdancewic,et al.  AURA: a programming language for authorization and audit , 2008, ICFP 2008.

[48]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[49]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[50]  Stephanie Weirich,et al.  Equational reasoning about programs with general recursion and call-by-value semantics , 2012, PLPV '12.

[51]  Karl Crary Type-Theoretic Methodology for Practical Programming Languages , 1998 .

[52]  Robert Harper,et al.  Positively dependent types , 2009, PLPV '09.