skip to main content
research-article

Combining proofs and programs in a dependently typed language

Published:08 January 2014Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

d1_right_t3.mp4

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle Scholar
  4. Altenkirch, T., Danielsson, N.A., Löh, A., Oury, N.: ΠΣ: Dependent types without the sugar. Functional and Logic Programming pp. 40--55 (2010) Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Augustsson, L.: Cayenne -- a language with dependent types. In: ICFP '98: International Conference on Functional Programming. pp. 239--250. ACM (1998) Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Barthe, G., Capretta, V., Pons, O.: Setoids in type theory. Journal of Functional Programming 13(2), 261--293 (2003) Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Brady, E.C.: Idris--systems programming meets full dependent types. In: PLPV'11: Programming languages meets program verification. pp. 43--54. ACM (2011) Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1--18 (2005)Google ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle Scholar
  15. Crary, K.: Type Theoretic Methodology for Practical Programming Languages. Ph.D. thesis, Cornell University (1998) Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. Licata, D.R., Harper, R.: Positively dependent types. In: PLPV '09: Programming languages meets program verification. pp. 3--14. ACM (2008) Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Luo, Z.: Computation and Reasoning: A Type Theory for Computer Science. Oxford University Press, USA (1994) Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. McBride, C., McKinna, J.: The view from the left. J. Funct. Program. 14(1), 69--111 (2004) Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. Murphy, VII, T., Crary, K., Harper, R.: Type-safe distributed programming with ML5. In: Trustworthy Global Computing 2007 (2007) Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nieuwenhuis, R., Oliveras, A.: Fast congruence closure and extensions. Inf. Comput. 205(4), 557--580 (2007) Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Norell, U.: Towards a practical programming language based on dependent type theory. Ph.D. thesis, Chalmers University of Technology (2007)Google ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. Pierce, B.C.: Types and Programming Languages. MIT Press (2002) Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle Scholar
  35. Smith, S.F.: Partial Objects in Type Theory. Ph.D. thesis, Cornell University (1988) Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. Tait, W.W.: Intensional interpretations of functionals of finite type i. The Journal of Symbolic Logic 32(2), pp. 198--212 (1967)Google ScholarGoogle ScholarCross RefCross Ref
  40. The Coq Development Team: The Coq Proof Assistant Reference Manual, Version 8.3. INRIA (2010), http://coq.inria.fr/V8.3/refman/Google ScholarGoogle Scholar
  41. The Coq Development Team: The Coq Proof Assistant, Frequently Asked Questions. INRIA (2011), http://coq.inria.fr/faq/Google ScholarGoogle Scholar
  42. The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics (2013), http://arxiv.org/abs/1308.0729Google ScholarGoogle Scholar
  43. Werner, B.: Une Théorie des Constructions Inductives. Ph.D. thesis, Université Paris 7 (1994)Google ScholarGoogle Scholar
  44. Winskel, G.: The formal semantics of programming languages: an introduction. MIT Press, Cambridge, MA, USA (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Combining proofs and programs in a dependently typed language

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 49, Issue 1
        POPL '14
        January 2014
        661 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2578855
        Issue’s Table of Contents
        • cover image ACM Conferences
          POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
          January 2014
          702 pages
          ISBN:9781450325448
          DOI:10.1145/2535838

        Copyright © 2014 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 8 January 2014

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!