skip to main content
research-article

Integrating Linear and Dependent Types

Published: 14 January 2015 Publication History

Abstract

In this paper, we show how to integrate linear types with type dependency, by extending the linear/non-linear calculus of Benton to support type dependency. Next, we give an application of this calculus by giving a proof-theoretic account of imperative programming, which requires extending the calculus with computationally irrelevant quantification, proof irrelevance, and a monad of computations. We show the soundness of our theory by giving a realizability model in the style of Nuprl, which permits us to validate not only the beta-laws for each type, but also the eta-laws. These extensions permit us to decompose Hoare triples into a collection of simpler type-theoretic connectives, yielding a rich equational theory for dependently-typed higher-order imperative programs. Furthermore, both the type theory and its model are relatively simple, even when all of the extensions are considered.

Supplementary Material

ZIP File (popl025.zip)
This is the source code for the dependent LNL typechecker
MOV File (2676969.mov)

References

[1]
A. Abel. Irrelevance in type theory with a heterogeneous equality judgement. In phFoundations of Software Science and Computational Structures, pages 57--71. Springer, 2011.
[2]
A. Ahmed, M. Fluet, and G. Morrisett. L3: A linear language with locations. phFundamenta Informaticae, 77 (4): 397--449, 2007.
[3]
T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In phPLPV, pages 57--68. ACM, 2007.
[4]
A. Appel, R. Dockins, A. Hobor, L. Beringer, J. Dodds, G. Stewart, S. Blazy, and X. Leroy. phProgram logics for certified compilers. Cambridge University Press, 2014.
[5]
E. S. Bainbridge, P. J. Freyd, A. Scedrov, and P. J. Scott. Functorial polymorphism. phTheoretical computer science, 70 (1): 35--64, 1990.
[6]
B. Barras and B. Bernardo. The implicit calculus of constructions as a programming language with dependent types. In phFoundations of Software Science and Computational Structures, pages 365--379. Springer, 2008.
[7]
N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. In phComputer Science Logic (CSL), 1994.
[8]
N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In phLogic in Computer Science (LICS), 1996.
[9]
ing, and Thamsborg}birkedal-metric-spacesL. Birkedal, K. Støvring, and J. Thamsborg. A relational realizability model for higher-order stateful adts. phThe Journal of Logic and Algebraic Programming, 81 (4): 491--521, 2012.
[10]
I. Cervesato and F. Pfenning. A linear logical framework. phInf. Comput., 179 (1): 19--75, 2002.
[11]
A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. phACM SIGPLAN Notices, 46 (6): 234--245, 2011.
[12]
R. L. Constable. Constructive mathematics as a programming logic I: Some principles of theory. In phAnnals of Mathematics, volume 24, pages 21--37. Elsevier, 1985.
[13]
B. A. Davey and H. A. Priestley. phIntroduction to lattices and order. Cambridge university press, 2002.
[14]
T. Dinsdale-Young, L. Birkedal, P. Gardner, M. Parkinson, and H. Yang. Views: compositional reasoning for concurrent programs. phACM SIGPLAN Notices, 48 (1): 287--300, 2013.
[15]
D. Dreyer, G. Neis, and L. Birkedal. The impact of higher-order state and control effects on local relational reasoning. phJournal of Functional Programming, 22 (4--5): 477--528, 2012.
[16]
lberg, and Simpson}eecJ. Egger, R. E. Møgelberg, and A. Simpson. Enriching an effect calculus with linear types. In phComputer Science Logic, pages 240--254. Springer, 2009.
[17]
003)}pataraiaM. H. Escardó. Joins in the frame of nuclei. phApplied Categorical Structures, 11 (2): 117--124, 2003.
[18]
J.-Y. Girard. Linear logic. phTheoretical computer science, 50 (1): 1--101, 1987.
[19]
J.-Y. Girard. Linear logic: Its syntax and semantics. In phAdvances in Linear Logic, volume 222 of phLondon Mathematical Society Lecture Notes. CUP, 1995.
[20]
R. Harper. Constructing type systems over an operational semantics. phJournal of Symbolic Computation, 14 (1): 71--84, 1992.
[21]
A. Hobor and J. Villard. The ramifications of sharing in data structures. phACM SIGPLAN Notices, 48 (1): 523--536, 2013.
[22]
J. B. Jensen and L. Birkedal. Fictional separation logic. In phProgramming Languages and Systems, pages 377--396. Springer, 2012.
[23]
A. Kopylov. phType Theoretical Foundations for Data Structures, Classes, and Objects. PhD thesis, 2004.
[24]
P. B. Levy. phCall-By-Push-Value: A Functional/Imperative Synthesis, volume 2 of phSemantics Structures in Computation. Springer, 2004.
[25]
P. Martin-Lof and G. Sambin. phIntuitionistic type theory. Bibliopolis Naples, 1984.
[26]
et al.(2014)Milit\ ao, Aldrich, and Caires}typestateF. Milit\ ao, J. Aldrich, and L. Caires. Substructural typestates. In phProceedings of the ACM SIGPLAN 2014 workshop on Programming languages meets program verification, pages 15--26. ACM, 2014.
[27]
A. Miquel. The implicit calculus of constructions extending pure type systems with an intersection type binder and subtyping. In phTLCA, pages 344--359. Springer, 2001.
[28]
A. Nanevski, G. Morrisett, and L. Birkedal. Polymorphism and separation in hoare type theory. In J. H. Reppy and J. L. Lawall, editors, phICFP, pages 62--73. ACM, 2006.
[29]
A. Nanevski, G. Morrisett, and L. Birkedal. Hoare type theory, polymorphism and separation. phJournal of Functional Programming, 18 (5--6): 865--911, 2008.
[30]
A. Nanevski, V. Vafeiadis, and J. Berdine. Structuring the verification of heap-manipulating programs. In M. V. Hermenegildo and J. Palsberg, editors, phPOPL, pages 261--274. ACM, 2010.
[31]
Z. Ni, D. Yu, and Z. Shao. Using XCAP to certify realistic systems code: Machine context management. In phTPHOLs, pages 189--206, 2007.
[32]
A. Nogin. Quotient types: A modular approach. In phTheorem Proving in Higher Order Logics, pages 263--280. Springer, 2002.
[33]
P. W. O'Hearn and D. J. Pym. The logic of bunched implications. phBulletin of Symbolic Logic, 5 (02): 215--244, 1999.
[34]
R. L. Petersen, L. Birkedal, A. Nanevski, and G. Morrisett. A realizability model for impredicative hoare type theory. In phProgramming Languages and Systems, pages 337--352. Springer, 2008.
[35]
F. Pfenning. Intensionality, extensionality, and proof irrelevance in modal type theory. In phLICS 2001. Proceedings., pages 221--230. IEEE, 2001.
[36]
F. Pfenning and R. Davies. A judgmental reconstruction of modal logic. phMathematical structures in computer science, 11 (04): 511--540, 2001.
[37]
F. Pottier. Syntactic soundness proof of a type-and-capability system with hidden state. phJournal of Functional Programming, 23 (1): 38--144, Jan. 2013.
[38]
J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In phLogic in Computer Science, 2002. Proceedings. 17th Annual IEEE Symposium on, pages 55--74. IEEE, 2002.
[39]
A. Spiwack. A dissection of L, 2014. URL http://assert-false.net/arnaud/papers.
[40]
K. Svendsen, L. Birkedal, and A. Nanevski. Partiality, state and dependent types. In C.-H. L. Ong, editor, phTLCA, volume 6690 of phLecture Notes in Computer Science, pages 198--212. Springer, 2011.
[41]
N. Swamy, J. Chen, C. Fournet, P.-Y. Strub, K. Bhargavan, and J. Yang. Secure distributed programming with value-dependent types. In phICFP, pages 266--278, 2011.
[42]
'ar(2014)}vakarM. Vákár. Syntax and semantics of linear dependent types, 2014. URL http://arxiv.org/abs/1405.0033.
[43]
K. Watkins, I. Cervesato, F. Pfenning, and D. Walker. A concurrent logical framework: The propositional fragment. In phTYPES, pages 355--377, 2003.
[44]
N. Zeilberger. On the unity of duality. phAnn. Pure Appl. Logic, 153 (1--3): 66--96, 2008.
[45]
D. Zhu and H. Xi. Safe Programming with Pointers through Stateful Views. In phPADL, pages 83--97, January 2005.

Cited By

View all
  • (2024)Polynomial Time and Dependent TypesProceedings of the ACM on Programming Languages10.1145/36329188:POPL(2288-2317)Online publication date: 5-Jan-2024
  • (2023)Semantic Encapsulation using Linking TypesProceedings of the 8th ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3609027.3609405(14-28)Online publication date: 30-Aug-2023
  • (2023)Parameterized Algebraic ProtocolsProceedings of the ACM on Programming Languages10.1145/35912777:PLDI(1389-1413)Online publication date: 6-Jun-2023
  • Show More Cited By

Index Terms

  1. Integrating Linear and Dependent Types

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
    January 2015
    716 pages
    ISBN:9781450333009
    DOI:10.1145/2676726
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 1
      POPL '15
      January 2015
      682 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2775051
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
    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: 14 January 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. dependent types
    2. hoare triples
    3. intersection types
    4. linear types
    5. proof irrelevance
    6. separation logic

    Qualifiers

    • Research-article

    Conference

    POPL '15
    Sponsor:

    Acceptance Rates

    POPL '15 Paper Acceptance Rate 52 of 227 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)46
    • Downloads (Last 6 weeks)8
    Reflects downloads up to 22 Oct 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Polynomial Time and Dependent TypesProceedings of the ACM on Programming Languages10.1145/36329188:POPL(2288-2317)Online publication date: 5-Jan-2024
    • (2023)Semantic Encapsulation using Linking TypesProceedings of the 8th ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3609027.3609405(14-28)Online publication date: 30-Aug-2023
    • (2023)Parameterized Algebraic ProtocolsProceedings of the ACM on Programming Languages10.1145/35912777:PLDI(1389-1413)Online publication date: 6-Jun-2023
    • (2023)A Formal Logic for Formal Category TheoryFoundations of Software Science and Computation Structures10.1007/978-3-031-30829-1_6(113-134)Online publication date: 21-Apr-2023
    • (2022)Logical Foundations of Quantitative EqualityProceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3531130.3533337(1-13)Online publication date: 2-Aug-2022
    • (2022)Semantic soundness for language interoperabilityProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523703(609-624)Online publication date: 9-Jun-2022
    • (2021)A graded dependent type system with a usage-aware semanticsProceedings of the ACM on Programming Languages10.1145/34343315:POPL(1-32)Online publication date: 4-Jan-2021
    • (2020)Linear Dependent Type Theory for Quantum Programming LanguagesProceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3373718.3394765(440-453)Online publication date: 8-Jul-2020
    • (2020)Fractional TypesReversible Computation10.1007/978-3-030-52482-1_10(169-186)Online publication date: 9-Jul-2020
    • (2020)What Kind of Programming Language Best Suits Integrative AGI?Artificial General Intelligence10.1007/978-3-030-52152-3_15(142-152)Online publication date: 16-Sep-2020
    • Show More Cited By

    View Options

    Get Access

    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