Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2535838.2535883acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Combining proofs and programs in a dependently typed language

Published: 08 January 2014 Publication History

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.

Supplementary Material

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

Cited By

View all
  • (2025)The Ethical Compiler: Addressing the Is-Ought Gap in Compilation (Invited Talk)Proceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706135(1-9)Online publication date: 10-Jan-2025
  • (2024)Gradual Indexed Inductive TypesProceedings of the ACM on Programming Languages10.1145/36746448:ICFP(544-572)Online publication date: 15-Aug-2024
  • (2024)Signature restriction for polymorphic algebraic effectsJournal of Functional Programming10.1017/S095679682400005434Online publication date: 27-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

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
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 08 January 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dependent types
  2. general recursion
  3. termination

Qualifiers

  • Research-article

Conference

POPL '14
Sponsor:

Acceptance Rates

POPL '14 Paper Acceptance Rate 51 of 220 submissions, 23%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)20
  • Downloads (Last 6 weeks)2
Reflects downloads up to 14 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)The Ethical Compiler: Addressing the Is-Ought Gap in Compilation (Invited Talk)Proceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706135(1-9)Online publication date: 10-Jan-2025
  • (2024)Gradual Indexed Inductive TypesProceedings of the ACM on Programming Languages10.1145/36746448:ICFP(544-572)Online publication date: 15-Aug-2024
  • (2024)Signature restriction for polymorphic algebraic effectsJournal of Functional Programming10.1017/S095679682400005434Online publication date: 27-May-2024
  • (2023)Dependently-Typed Programming with Logical Equality ReflectionProceedings of the ACM on Programming Languages10.1145/36078527:ICFP(649-685)Online publication date: 31-Aug-2023
  • (2022)A reasonably gradual type theoryProceedings of the ACM on Programming Languages10.1145/35476556:ICFP(931-959)Online publication date: 31-Aug-2022
  • (2021)Label dependent lambda calculus and gradual typingProceedings of the ACM on Programming Languages10.1145/34854855:OOPSLA(1-29)Online publication date: 15-Oct-2021
  • (2020)Type- and Control-Flow Directed DefunctionalizationProceedings of the 32nd Symposium on Implementation and Application of Functional Languages10.1145/3462172.3462193(79-92)Online publication date: 2-Sep-2020
  • (2020)Signature restriction for polymorphic algebraic effectsProceedings of the ACM on Programming Languages10.1145/34089994:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2020)Multi-Label Active Learning Algorithms for Image ClassificationACM Computing Surveys10.1145/337950453:2(1-35)Online publication date: 20-Mar-2020
  • (2020)A Survey of Hierarchical Energy Optimization for Mobile Edge ComputingACM Computing Surveys10.1145/337893553:2(1-44)Online publication date: 17-Apr-2020
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media