Abstract
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.
Supplemental Material
- Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. In: ESOP '06: European Symposium on Programming. LNCS, vol. 3924. Springer (2006) Google Scholar
Digital Library
- Ahn, K.Y., Sheard, T.: A hierarchy of mendler style recursion combinators: taming inductive datatypes with negative occurrences. In: ICFP '11: International Conference on Functional programming. pp. 234--246. ACM (2011) Google Scholar
Digital Library
- Ahn, K.Y., Sheard, T., Fiore, M., Pitts, A.M.: The Nax programming language (work in progress) (2012), talk presented at IFL 2012: the 24th Symposium on Implementation and Application of Functional LanguagesGoogle Scholar
- Altenkirch, T., Danielsson, N.A., Löh, A., Oury, N.: ΠΣ: Dependent types without the sugar. Functional and Logic Programming pp. 40--55 (2010) Google Scholar
Digital Library
- Appel, A.W., McAllester, D.: An indexed model of recursive types for foundational proof-carrying code. ACM Trans. Program. Lang. Syst. 23(5), 657--683 (2001) Google Scholar
Digital Library
- Augustsson, L.: Cayenne -- a language with dependent types. In: ICFP '98: International Conference on Functional Programming. pp. 239--250. ACM (1998) Google Scholar
Digital Library
- Barendregt, H.P.: Lambda calculi with types. In: Abramsky, S., Gabbay, D.M., Maibaum, T.S.E. (eds.) Handbook of Logic in Computer Science. pp. 117--309. Oxford University Press (1992) Google Scholar
Digital Library
- Barthe, G., Capretta, V., Pons, O.: Setoids in type theory. Journal of Functional Programming 13(2), 261--293 (2003) Google Scholar
Digital Library
- Bertot, Y., Komendantsky, V.: Fixed point semantics and partial recursion in coq. In: PPDP '08: Principles and practice of declarative programming. pp. 89--96. ACM (2008) Google Scholar
Digital Library
- Brady, E.C.: Idris--systems programming meets full dependent types. In: PLPV'11: Programming languages meets program verification. pp. 43--54. ACM (2011) Google Scholar
Digital Library
- Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1--18 (2005)Google Scholar
Cross Ref
- Casinghino, C., Sjöberg, V., Weirich, S.: Step-indexed normalization for a language with general recursion. In: MSFP '12: Mathematically Structured Functional Programming. EPTCS, vol. 76, pp. 25--39 (2012)Google Scholar
- Chen, C., Xi, H.: Combining programming with theorem proving. In: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming. pp. 66--77. ICFP '05, ACM, New York, NY, USA (2005), prefixhttp://doi.acm.org/10.1145/1086365.1086375 Google Scholar
Digital Library
- Constable, R.L., Smith, S.F.: Partial objects in constructive type theory. In: Logic in Computer Science (LICS'87). pp. 183--193. IEEE (1987)Google Scholar
- Crary, K.: Type Theoretic Methodology for Practical Programming Languages. Ph.D. thesis, Cornell University (1998) Google Scholar
Digital Library
- Geuvers, H.: A short and flexible proof of Strong Normalization for the Calculus of Constructions. In: TYPES '94. LNCS, vol. 996, pp. 14--38 (1995) Google Scholar
Digital Library
- Girard, J.Y.: Interprétation fonctionelle et élimination des coupures de l'arithmétique d'ordre supérieur. Ph.D. thesis, Université Paris VII (1972)Google Scholar
- Jia, L., Vaughan, J.A., Mazurak, K., Zhao, J., Zarko, L., Schorr, J., Zdancewic, S.: AURA: A programming language for authorization and audit. In: ICFP '08: International Conference on Functional Programming). pp. 27--38. ACM (2008) Google Scholar
Digital Library
- Jia, L., Walker, D.: Modal proofs as distributed programs (extended abstract). In: ESOP'04: European Symposium on Programming. LNCS, vol. 2986, pp. 219--233. Springer (2004)Google Scholar
- Kimmell, G., Stump, A., Eades III, H.D., Fu, P., Sheard, T., Weirich, S., Casinghino, C., Sjöberg, V., Collins, N., Ahn, K.Y.: Equational reasoning about programs with general recursion and call-by-value semantics. In: PLPV '12: Programming languages meets program verification. ACM (2012) Google Scholar
Digital Library
- Licata, D.R., Harper, R.: Positively dependent types. In: PLPV '09: Programming languages meets program verification. pp. 3--14. ACM (2008) Google Scholar
Digital Library
- Luo, Z.: Computation and Reasoning: A Type Theory for Computer Science. Oxford University Press, USA (1994) Google Scholar
Digital Library
- McBride, C., McKinna, J.: The view from the left. J. Funct. Program. 14(1), 69--111 (2004) Google Scholar
Digital Library
- Miquel, A.: The implicit calculus of constructions - extending pure type systems with an intersection type binder and subtyping. In: TLCA '01: Proceeding of 5th international conference on Typed Lambda Calculi and Applications. LNCS, vol. 2044, pp. 344--359. Springer (2001) Google Scholar
Digital Library
- Murphy, VII, T., Crary, K., Harper, R.: Type-safe distributed programming with ML5. In: Trustworthy Global Computing 2007 (2007) Google Scholar
Digital Library
- Nanevski, A., Morrisett, G., Shinnar, A., Govereau, P., Birkedal, L.: Ynot: dependent types for imperative programs. In: ICFP '08: International Conference on Functional Programming. pp. 229--240. ACM (2008) Google Scholar
Digital Library
- Nieuwenhuis, R., Oliveras, A.: Fast congruence closure and extensions. Inf. Comput. 205(4), 557--580 (2007) Google Scholar
Digital Library
- Norell, U.: Towards a practical programming language based on dependent type theory. Ph.D. thesis, Chalmers University of Technology (2007)Google Scholar
- Peyton-Jones, S., Vytiniotis, D., Weirich, S., Washburn, G.: Simple unification-based type inference for GADTs. In: ICFP '06: International Conference on Functional Programming. pp. 50--61. ACM (2006) Google Scholar
Digital Library
- Pierce, B.C.: Types and Programming Languages. MIT Press (2002) Google Scholar
Digital Library
- Pierce, B.C., Turner, D.N.: Local type inference. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), San Diego, California (1998) Google Scholar
Digital Library
- Sewell, P., Nardelli, F., Owens, S., Peskine, G., Ridge, T., Sarkar, S., Strnisa, R.: Ott: Effective tool support for the working semanticist. J. Funct. Program. 20(1), 71--122 (2010) Google Scholar
Digital Library
- Sheard, T., Linger, N.: Programming in ωmega. In: Horváth, Z., Plasmeijer, R., Soós, A., Zsók, V. (eds.) 2nd Central European Functional Programming School (CEFP). LNCS, vol. 5161, pp. 158--227. Springer (2007) Google Scholar
Digital Library
- Sjöberg, V., Casinghino, C., Ahn, K.Y., Collins, N., Eades III, H.D., Fu, P., Kimmell, G., Sheard, T., Stump, A., Weirich, S.: Irrelevance, heterogeneous equality, and call-by-value dependent type systems. In: MSFP '12: Mathematically Structured Functional Programming. EPTCS, vol. 76, pp. 112--162 (2012)Google Scholar
- Smith, S.F.: Partial Objects in Type Theory. Ph.D. thesis, Cornell University (1988) Google Scholar
Digital Library
- Stump, A., Deters, M., Petcher, A., Schiller, T., Simpson, T.W.: Verified programming in guru. In: Altenkirch, T., Millstein, T.D. (eds.) PLPV. pp. 49--58. ACM (2009) Google Scholar
Digital Library
- Svendsen, K., Birkedal, L., Nanevski, A.: Partiality, state and dependent types. In: Typed lambda calculi and applications (TLCA'11). LNCS, vol. 6690, pp. 198--212. Springer (2011) Google Scholar
Digital Library
- Swamy, N., Chen, J., Fournet, C., Strub, P.Y., Bhargavan, K., Yang, J.: Secure Distributed Programming with Value-dependent Types. In: ICFP '11: International Conference on Functional Programming. pp. 285--296. ACM (2011) Google Scholar
Digital Library
- Tait, W.W.: Intensional interpretations of functionals of finite type i. The Journal of Symbolic Logic 32(2), pp. 198--212 (1967)Google Scholar
Cross Ref
- The Coq Development Team: The Coq Proof Assistant Reference Manual, Version 8.3. INRIA (2010), http://coq.inria.fr/V8.3/refman/Google Scholar
- The Coq Development Team: The Coq Proof Assistant, Frequently Asked Questions. INRIA (2011), http://coq.inria.fr/faq/Google Scholar
- The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics (2013), http://arxiv.org/abs/1308.0729Google Scholar
- Werner, B.: Une Théorie des Constructions Inductives. Ph.D. thesis, Université Paris 7 (1994)Google Scholar
- Winskel, G.: The formal semantics of programming languages: an introduction. MIT Press, Cambridge, MA, USA (1993) Google Scholar
Digital Library
Index Terms
Combining proofs and programs in a dependently typed language
Recommendations
Combining proofs and programs in a dependently typed language
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesMost 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 ...
Bidirectional Elaboration of Dependently Typed Programs
PPDP '14: Proceedings of the 16th International Symposium on Principles and Practice of Declarative ProgrammingDependently typed programming languages allow programmers to express a rich set of invariants and verify them statically via type checking. To make programming with dependent types practical, dependently typed systems provide a compact language for ...
Dependently typed programming in Agda
TLDI '09: Proceedings of the 4th international workshop on Types in language design and implementationDependently typed languages have for a long time been used to describe proofs about programs. Traditionally, dependent types are used mostly for stating and proving the properties of the programs and not in defining the programs themselves. An ...







Comments