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.
Supplemental Material
Available for Download
This is the source code for the dependent LNL typechecker
- 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 Scholar
Digital Library
- A. Ahmed, M. Fluet, and G. Morrisett. L3: A linear language with locations. phFundamenta Informaticae, 77 (4): 397--449, 2007. Google Scholar
Digital Library
- T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In phPLPV, pages 57--68. ACM, 2007. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- E. S. Bainbridge, P. J. Freyd, A. Scedrov, and P. J. Scott. Functorial polymorphism. phTheoretical computer science, 70 (1): 35--64, 1990. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. In phComputer Science Logic (CSL), 1994. Google Scholar
Digital Library
- N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In phLogic in Computer Science (LICS), 1996. Google Scholar
Digital Library
- 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 Scholar
- I. Cervesato and F. Pfenning. A linear logical framework. phInf. Comput., 179 (1): 19--75, 2002. Google Scholar
Digital Library
- A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. phACM SIGPLAN Notices, 46 (6): 234--245, 2011. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- B. A. Davey and H. A. Priestley. phIntroduction to lattices and order. Cambridge university press, 2002.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 003)}pataraiaM. H. Escardó. Joins in the frame of nuclei. phApplied Categorical Structures, 11 (2): 117--124, 2003.Google Scholar
Cross Ref
- J.-Y. Girard. Linear logic. phTheoretical computer science, 50 (1): 1--101, 1987. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Harper. Constructing type systems over an operational semantics. phJournal of Symbolic Computation, 14 (1): 71--84, 1992. Google Scholar
Digital Library
- A. Hobor and J. Villard. The ramifications of sharing in data structures. phACM SIGPLAN Notices, 48 (1): 523--536, 2013. Google Scholar
Digital Library
- J. B. Jensen and L. Birkedal. Fictional separation logic. In phProgramming Languages and Systems, pages 377--396. Springer, 2012. Google Scholar
Digital Library
- A. Kopylov. phType Theoretical Foundations for Data Structures, Classes, and Objects. PhD thesis, 2004. Google Scholar
Digital Library
- P. B. Levy. phCall-By-Push-Value: A Functional/Imperative Synthesis, volume 2 of phSemantics Structures in Computation. Springer, 2004. Google Scholar
Digital Library
- P. Martin-Lof and G. Sambin. phIntuitionistic type theory. Bibliopolis Naples, 1984.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Nanevski, G. Morrisett, and L. Birkedal. Hoare type theory, polymorphism and separation. phJournal of Functional Programming, 18 (5--6): 865--911, 2008. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Z. Ni, D. Yu, and Z. Shao. Using XCAP to certify realistic systems code: Machine context management. In phTPHOLs, pages 189--206, 2007. Google Scholar
Digital Library
- A. Nogin. Quotient types: A modular approach. In phTheorem Proving in Higher Order Logics, pages 263--280. Springer, 2002. Google Scholar
Digital Library
- P. W. O'Hearn and D. J. Pym. The logic of bunched implications. phBulletin of Symbolic Logic, 5 (02): 215--244, 1999.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- F. Pfenning. Intensionality, extensionality, and proof irrelevance in modal type theory. In phLICS 2001. Proceedings., pages 221--230. IEEE, 2001. Google Scholar
Digital Library
- F. Pfenning and R. Davies. A judgmental reconstruction of modal logic. phMathematical structures in computer science, 11 (04): 511--540, 2001. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Spiwack. A dissection of L, 2014. URL http://assert-false.net/arnaud/papers.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 'ar(2014)}vakarM. Vákár. Syntax and semantics of linear dependent types, 2014. URL http://arxiv.org/abs/1405.0033.Google Scholar
- K. Watkins, I. Cervesato, F. Pfenning, and D. Walker. A concurrent logical framework: The propositional fragment. In phTYPES, pages 355--377, 2003.Google Scholar
- N. Zeilberger. On the unity of duality. phAnn. Pure Appl. Logic, 153 (1--3): 66--96, 2008.Google Scholar
Cross Ref
- D. Zhu and H. Xi. Safe Programming with Pointers through Stateful Views. In phPADL, pages 83--97, January 2005. Google Scholar
Digital Library
Index Terms
Integrating Linear and Dependent Types
Recommendations
Syntax and Semantics of Quantitative Type Theory
LICS '18: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer ScienceWe present Quantitative Type Theory, a Type Theory that records usage information for each variable in a judgement, based on a previous system by McBride. The usage information is used to give a realizability semantics using a variant of Linear ...
Integrating Linear and Dependent Types
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesIn 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 ...
Quantitative program reasoning with graded modal types
In programming, some data acts as a resource (e.g., file handles, channels) subject to usage constraints. This poses a challenge to software correctness as most languages are agnostic to constraints on data. The approach of linear types provides a ...







Comments