Abstract
Graded Type Theory provides a mechanism to track and reason about resource usage in type systems. In this paper, we develop GraD, a novel version of such a graded dependent type system that includes functions, tensor products, additive sums, and a unit type. Since standard operational semantics is resource-agnostic, we develop a heap-based operational semantics and prove a soundness theorem that shows correct accounting of resource usage. Several useful properties, including the standard type soundness theorem, non-interference of irrelevant resources in computation and single pointer property for linear resources, can be derived from this theorem. We hope that our work will provide a base for integrating linearity, irrelevance and dependent types in practical programming languages like Haskell.
- Martín Abadi, Anindya Banerjee, Nevin Heintze, and Jon G. Riecke. 1999. A Core Calculus of Dependency. In Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Antonio, Texas, USA) ( POPL '99). Association for Computing Machinery, New York, NY, USA, 147-160. https://doi.org/10.1145/292540.292555 Andreas Abel. 2018. Resourceful Dependent Types. Presentation at 4th International Conference on Types for Proofs and Programs (TYPES 2018 ), Braga, Portugal..Google Scholar
- Andreas Abel and Jean-Philippe Bernardy. 2020. A Unified View of Modalities in Type Systems. Proceedings of the ACM on Programming Languages 4, ICFP ( 2020 ). To appear.Google Scholar
Digital Library
- Andreas Abel and Gabriel Scherer. 2012. On Irrelevance and Algorithmic Equality in Predicative Type Theory. Logical Methods in Computer Science 8, 1 ( 2012 ). https://doi.org/10.2168/LMCS-8( 1 :29) 2012 Google Scholar
Cross Ref
- The Agda-Team. 2020. Run-time Irrelevance. https://agda.readthedocs. io/en/v2.6.1.1/language/runtime-irrelevance. html Robert Atkey. 2018. The Syntax and Semantics of Quantitative Type Theory. In LICS '18: 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, July 9-12, 2018, Oxford, United Kingdom. https://doi.org/10.1145/3209108.3209189 H. P. Barendregt. 1993. Lambda Calculi with Types. Oxford University Press, Inc., USA, 117-309.Google Scholar
- Bruno Barras and Bruno Bernardo. 2008. The Implicit Calculus of Constructions as a Programming Language with Dependent Types. In Foundations of Software Science and Computational Structures (FOSSACS 2008 ), Roberto Amadio (Ed.). Springer Berlin Heidelberg, Budapest, Hungary, 365-379.Google Scholar
- P. N. Benton. 1995. A Mixed Linear and Non-Linear Logic: Proofs, Terms and Models (Extended Abstract). In Selected Papers from the 8th International Workshop on Computer Science Logic (CSL '94). Springer-Verlag, London, UK, UK, 121-135.Google Scholar
- Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R. Newton, Simon Peyton Jones, and Arnaud Spiwack. 2018. Linear Haskell: practical linearity in a higher-order polymorphic language. Proc. ACM Program. Lang. 2, POPL ( 2018 ), 5 : 1-5 : 29. https://doi.org/10.1145/3158093 Google Scholar
Digital Library
- Guillaume Bonfante, François Lamarche, and Thomas Streicher. 2001. A model of a dependent linear calculus. Intern report A01-R-262 || bonfante01c.Google Scholar
- Edwin Brady. 2020. Idris 2: Quantitative Type Theory in Action. (Feb. 2020 ). Draft available from https://www.typedriven.org.uk/edwinb/idris-2-quantitative-type-theory-in-action.html.Google Scholar
- Aloïs Brunel, Marco Gaboardi, Damiano Mazza, and Steve Zdancewic. 2014. A Core Quantitative Coefect Calculus. In Programming Languages and Systems, Zhong Shao (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 351-370.Google Scholar
- Iliano Cervesato and Frank Pfenning. 2002. A Linear Logical Framework. Information and Computation 179, 1 ( 2002 ), 19-75.Google Scholar
- Jawahar Chirimar, Carl A. Gunter, and Jon G. Riecke. 1996. Reference counting as a computational interpretation of linear logic. Journal of Functional Programming 6, 2 (March 1996 ), 195-244. https://doi.org/10.1017/S0956796800001660 U. Dal Lago and M. Gaboardi. 2011. Linear Dependent Types and Relative Completeness. In 2011 IEEE 26th Annual Symposium on Logic in Computer Science. 133-142.Google Scholar
Cross Ref
- Ugo Dal Lago and Martin Hofmann. 2009. Bounded Linear Logic, Revisited. In Typed Lambda Calculi and Applications, Pierre-Louis Curien (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 80-94.Google Scholar
- Ugo Dal lago and Barbara Petit. 2012. Linear Dependent Types in a Call-by-Value Scenario. In Proceedings of the 14th Symposium on Principles and Practice of Declarative Programming (PPDP '12). Association for Computing Machinery, New York, NY, USA, 115-126.Google Scholar
- Richard A. Eisenberg. 2016. Dependent Types in Haskell: Theory and Practice. Ph.D. Dissertation. University of Pennsylvania.Google Scholar
- Richard A. Eisenberg. 2018. Quantifiers for Dependent Haskell. GHC Proposal # 102. https://github.com/goldfirere/ghcproposals/blob/pi/proposals/0000-pi.rstGoogle Scholar
- Marco Gaboardi, Andreas Haeberlen, Justin Hsu, Arjun Narayan, and Benjamin C. Pierce. 2013. Linear Dependent Types for Diferential Privacy. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '13). Association for Computing Machinery, New York, NY, USA, 357-370.Google Scholar
- Marco Gaboardi, Shin-ya Katsumata, Dominic A Orchard, Flavien Breuvart, and Tarmo Uustalu. 2016. Combining efects and coefects via grading. In ICFP. 476-489.Google Scholar
- Dan R Ghica and Alex I Smith. 2014. Bounded linear types in a resource semiring. In European Symposium on Programming Languages and Systems. Springer, 331-350.Google Scholar
Digital Library
- Jean-Yves Girard, Andre Scedrov, and Philip J. Scott. 1992. Bounded linear logic: a modular approach to polynomial-time computability. Theoretical Computer Science 97, 1 ( 1992 ), 1-66.Google Scholar
- Jonathan S. Golan. 1999. Semirings and their Applications. Springer Netherlands. https://doi.org/10.1007/ 978-94-015-9333-5 Adam Gundry. 2013. Type Inference, Haskell and Dependent Types. Ph.D. Dissertation. University of Strathclyde.Google Scholar
- Neelakantan R. Krishnaswami, Pierre Pradic, and Nick Benton. 2015. Integrating Linear and Dependent Types. In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '15). ACM, New York, NY, USA, 17-30.Google Scholar
Digital Library
- John Launchbury. 1993. A natural semantics for lazy evaluation. POPL '93: Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languagesl (3 1993 ), 144-154. https://doi.org/10.1145/158511.158618 Conor McBride. 2016. I Got Plenty o' Nuttin'. Springer International Publishing, Cham, 207-233.Google Scholar
Digital Library
- Alexandre Miquel. 2001. The Implicit Calculus of Constructions Extending Pure Type Systems with an Intersection Type Binder and Subtyping. Springer Berlin Heidelberg, Berlin, Heidelberg, 344-359. https://doi.org/10.1007/3-540-45413-6_27 Nathan Mishra-Linger and Tim Sheard. 2008. Erasure and Polymorphism in Pure Type Systems. In Foundations of Software Science and Computational Structures (FoSSaCS). Springer.Google Scholar
Digital Library
- Benjamin Moon, Harley Eades III, and Dominic Orchard. 2020. Graded Modal Dependent Type Theory (Extended Abstract). TyDe (May 2020 ).Google Scholar
- Jason Reed and Benjamin C. Pierce. 2010. Distance Makes the Types Grow Stronger: A Calculus for Diferential Privacy. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (Baltimore, Maryland, USA) ( ICFP '10). Association for Computing Machinery, New York, NY, USA, 157-168. https://doi.org/10.1145/1863543.1863568 David N. Turner and Philip Wadler. 1999. Operational interpretations of linear logic. Theoretical Computer Science 227, 1 ( 1999 ), 231-248. https://doi.org/10.1016/S0304-3975 ( 99 ) 00054-7 Google Scholar
Digital Library
- Dennis Volpano, Cynthia Irvine, and Geofrey Smith. 1996. A Sound Type System for Secure Flow Analysis. J. Comput. Secur. 4, 2-3 ( Jan. 1996 ), 167-187.Google Scholar
Digital Library
- Philip Wadler. 1990. Linear types can change the world. In IFIP TC, Vol. 2. 347-359.Google Scholar
- Stephanie Weirich, Pritam Choudhury, Antoine Voizard, and Richard A. Eisenberg. 2019. A Role for Dependent Types in Haskell. Proc. ACM Program. Lang. 3, ICFP, Article 101 ( July 2019 ), 29 pages. https://doi.org/10.1145/3341705 Stephanie Weirich, Antoine Voizard, Pedro Henrique Avezedo de Amorim, and Richard A. Eisenberg. 2017. A Specification for Dependent Types in Haskell. Proc. ACM Program. Lang. 1, ICFP, Article 31 ( Aug. 2017 ), 29 pages. https://doi.org/10. 1145/3110275 Google Scholar
Digital Library
- James Wood and Robert Atkey. 2020. A Linear Algebra Approach to Linear Metatheory. arXiv: 2005. 02247 [cs.PL]Google Scholar
Index Terms
A graded dependent type system with a usage-aware semantics
Recommendations
Graded Modal Dependent Type Theory
Programming Languages and SystemsAbstractGraded type theories are an emerging paradigm for augmenting the reasoning power of types with parameterizable, fine-grained analyses of program properties. There have been many such theories in recent years which equip a type theory with ...
Parametric quantifiers for dependent type theory
Polymorphic type systems such as System F enjoy the parametricity property: polymorphic functions cannot inspect their type argument and will therefore apply the same algorithm to any type they are instantiated on. This idea is formalized mathematically ...
Degrees of Relatedness: A Unified Framework for Parametricity, Irrelevance, Ad Hoc Polymorphism, Intersections, Unions and Algebra in Dependent Type Theory
LICS '18: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer ScienceDependent type theory allows us to write programs and to prove properties about those programs in the same language. However, some properties do not require much proof, as they are evident from a program's implementation, e.g. if a polymorphic program ...






Comments