skip to main content
research-article

Integrating Linear and Dependent Types

Published:14 January 2015Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Ahmed, M. Fluet, and G. Morrisett. L3: A linear language with locations. phFundamenta Informaticae, 77 (4): 397--449, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In phPLPV, pages 57--68. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. S. Bainbridge, P. J. Freyd, A. Scedrov, and P. J. Scott. Functorial polymorphism. phTheoretical computer science, 70 (1): 35--64, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. In phComputer Science Logic (CSL), 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In phLogic in Computer Science (LICS), 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  10. I. Cervesato and F. Pfenning. A linear logical framework. phInf. Comput., 179 (1): 19--75, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. phACM SIGPLAN Notices, 46 (6): 234--245, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. A. Davey and H. A. Priestley. phIntroduction to lattices and order. Cambridge university press, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 003)}pataraiaM. H. Escardó. Joins in the frame of nuclei. phApplied Categorical Structures, 11 (2): 117--124, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  18. J.-Y. Girard. Linear logic. phTheoretical computer science, 50 (1): 1--101, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Harper. Constructing type systems over an operational semantics. phJournal of Symbolic Computation, 14 (1): 71--84, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Hobor and J. Villard. The ramifications of sharing in data structures. phACM SIGPLAN Notices, 48 (1): 523--536, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. B. Jensen and L. Birkedal. Fictional separation logic. In phProgramming Languages and Systems, pages 377--396. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Kopylov. phType Theoretical Foundations for Data Structures, Classes, and Objects. PhD thesis, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. B. Levy. phCall-By-Push-Value: A Functional/Imperative Synthesis, volume 2 of phSemantics Structures in Computation. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Martin-Lof and G. Sambin. phIntuitionistic type theory. Bibliopolis Naples, 1984.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Nanevski, G. Morrisett, and L. Birkedal. Hoare type theory, polymorphism and separation. phJournal of Functional Programming, 18 (5--6): 865--911, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Z. Ni, D. Yu, and Z. Shao. Using XCAP to certify realistic systems code: Machine context management. In phTPHOLs, pages 189--206, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Nogin. Quotient types: A modular approach. In phTheorem Proving in Higher Order Logics, pages 263--280. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. P. W. O'Hearn and D. J. Pym. The logic of bunched implications. phBulletin of Symbolic Logic, 5 (02): 215--244, 1999.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. F. Pfenning. Intensionality, extensionality, and proof irrelevance in modal type theory. In phLICS 2001. Proceedings., pages 221--230. IEEE, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. F. Pfenning and R. Davies. A judgmental reconstruction of modal logic. phMathematical structures in computer science, 11 (04): 511--540, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. A. Spiwack. A dissection of L, 2014. URL http://assert-false.net/arnaud/papers.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. 'ar(2014)}vakarM. Vákár. Syntax and semantics of linear dependent types, 2014. URL http://arxiv.org/abs/1405.0033.Google ScholarGoogle Scholar
  43. K. Watkins, I. Cervesato, F. Pfenning, and D. Walker. A concurrent logical framework: The propositional fragment. In phTYPES, pages 355--377, 2003.Google ScholarGoogle Scholar
  44. N. Zeilberger. On the unity of duality. phAnn. Pure Appl. Logic, 153 (1--3): 66--96, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  45. D. Zhu and H. Xi. Safe Programming with Pointers through Stateful Views. In phPADL, pages 83--97, January 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Integrating Linear and Dependent Types

    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

    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!