Abstract
Work to date on combining linear types and dependent types has deliberately and successfully avoided doing so. Entirely fit for their own purposes, such systems wisely insist that types depend only on the replicable sublanguage, thus sidestepping the issue of counting uses of limited-use data either within types or in ways which are only really needed to shut the typechecker up. As a result, the linear implication (‘lollipop’) stubbornly remains a non-dependent \(S \multimap T\). This paper defines and establishes the basic metatheory of a type theory supporting a ‘dependent lollipop’ \((x\!:\!S)\multimap T[x]\), where what the input used to be is in some way commemorated by the type of the output. For example, we might convert list to length-indexed vectors in place by a function with type \((l\!:\!\mathsf {List}\,X)\multimap \mathsf {Vector}\,X\,(\mathsf {length}\,l)\). Usage is tracked with resource annotations belonging to an arbitrary rig, or ‘riNg without Negation’. The key insight is to use the rig’s zero to mark information in contexts which is present for purposes of contemplation rather than consumption, like a meal we remember fondly but cannot eat twice. We need no runtime copies of l to form the above vector type. We can have plenty of nothing with no additional runtime resource, and nothing is plenty for the construction of dependent types.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Abel, A.: Normalization by Evaluation: Dependent Types and Impredicativity, Habilitationsschrift (2013)
Abel, A., Coquand, T., Dybjer, P.: Normalization by evaluation for Martin-Löf Type theory with typed equality judgements. In: Proceedings of the 22nd IEEE Symposium on Logic in Computer Science (LICS 2007), 10–12 July 2007, Wroclaw, Poland, pp. 3–12. IEEE Computer Society (2007)
Adams, R.: Pure type systems with judgemental equality. J. Funct. Program. 16(2), 219–246 (2006)
Asperti, A., Ricciotti, W., Coen, C.S., Tassi, E.: A bi-directional refinement algorithm for the calculus of (co)inductive constructions. Logical Meth. Comput. Sci. 8(1), 1–49 (2012)
Bernardy, J.-P., Jansson, P., Paterson, R.: Proofs for free - parametricity for dependent types. J. Funct. Program. 22(2), 107–152 (2012)
Brady, E.: Idris, a general-purpose dependently typed programming language: design and implementation. J. Funct. Program. 23(5), 552–593 (2013)
Caires, L., Pfenning, F.: Session types as intuitionistic linear propositions. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 222–236. Springer, Heidelberg (2010)
Cervesato, I., Pfenning, F.: A linear logical framework. Inf. Comput. 179(1), 19–75 (2002)
de Vries, E., Plasmeijer, R., Abrahamson, D.M.: Uniqueness typing simplified. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 201–218. Springer, Heidelberg (2008)
Dolan, S.: Fun with semirings: a functional pearl on the abuse of linear algebra. In: Morrisett, G., Uustalu, T. (eds.) ACM SIGPLAN International Conference on Functional Programming, ICFP 2013, 25–27 September, pp. 101–110. ACM, Boston (2013)
Domínguez, F., Pardo, A.: Program fusion with paramorphisms. In: Proceedings of the International Conference on Mathematically Structured Functional Programming, MSFP 2006, pp. 6–6. British Computer Society, Swinton (2006)
Gaboardi, M., Haeberlen, A., Hsu, J., Narayan, A., Pierce, B.C.: Linear dependent types for differential privacy. In: Giacobazzi, R., Cousot, R. (eds.) The 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2013, 23–25 January, pp. 357–370. ACM, Rome (2013)
Gay, S.J., Vasconcelos, V.T.: Linear type theory for asynchronous session types. J. Funct. Program. 20(1), 19–50 (2010)
Gentzen, G.: Untersuchungen über das logische schließen. Math. Z. 29(2–3), 176–210 (1935). 405–431
Girard, J.-Y.: Linear logic. Theor. Comput. Sci. 50, 1–102 (1987)
Krishnaswami, N.R., Pradic, P., Benton, N.: Integrating linear and dependent types. In: Rajamani, S.K., Walker, D. (eds.) Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, 15-17 January 2015, pp. 17–30. ACM, Mumbai (2015)
Luo, Z.: ECC, an extended calculus of constructions. In: Proceedings of the Fourth Annual Symposium on Logic in Computer Science (LICS 1989), 5–8 June 1989, pp. 386–395. IEEE Computer Society, Pacific Grove (1989)
Martin-Löf, P.: An Intuitionistic theory of types: predicative part. In: Rose, H.E., Shepherdson, J.C. (eds.) Logic Colloquium 1973. North-Holland Publishing Company, Amsterdam (1975)
McKinna, J., Pollack, R.: Some lambda calculus and type theory formalized. J. Autom. Reasoning 23(3–4), 373–409 (1999)
Miquel, A.: The implicit calculus of constructions. In: Abramsky, S. (ed.) TLCA 2001. LNCS, vol. 2044, pp. 344–359. Springer, Heidelberg (2001)
Petricek, T., Orchard, D.A., Mycroft, A.: Coeffects: a calculus of context-dependent computation. In: Jeuring, J., Chakravarty, M.M.T. (eds.) Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming, 1–3 September 2014, pp. 123–135. ACM, Gothenburg (2014)
Pierce, B.C., Turner, D.N.: Local type inference. ACM Trans. Program. Lang. Syst. 22(1), 1–44 (2000)
Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress, pp. 513–523 (1983)
Shi, R., Xi, H.: A linear type system for multicore programming in ATS. Sci. Comput. Program. 78(8), 1176–1192 (2013)
Swamy, N., Chen, J., Fournet, C., Strub, P.-Y., Bhargavan, K., Yang, J.: Secure distributed programming with value-dependent types. J. Funct. Program. 23(4), 402–451 (2013)
Takahashi, M.: Parallel reductions in \(\lambda \)-calculus (revised version). Inf. Comput. 118(1), 120–127 (1995)
Toninho, B., Caires, L., Pfenning, F.: Dependent session types via intuitionistic linear type theory. In: Schneider-Kamp, P., Hanus, M. (eds.) Proceedings of the 13th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, 20–22 July 2011, pp. 161–172. ACM, Odense (2011)
Vákár, M.: Syntax and Semantics of Linear Dependent Types. CoRR, abs/1405.0033 (2014)
Wadler, P.: Theorems for free! In: FPCA, pp. 347–359 (1989)
Wadler, P.: Is there a use for linear logic? In: Consel, C., Danvy, O. (eds.) Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM 1991, Yale University, New Haven, Connecticut, USA, 17-19 June 1991, pp. 255–273. ACM (1991)
Wadler, P.: Propositions as sessions. In: Thiemann, P., Findler, R.B. (eds) ACM SIGPLAN International Conference on Functional Programming, ICFP 2012, 9–15 September 2012, pp. 273–286. ACM, Copenhagen (2012)
Watkins, K., Cervesato, I., Pfenning, F., Walker, D.W.: A concurrent logical framework: the propositional fragment. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 355–377. Springer, Heidelberg (2004)
Acknowledgements
Writing was a substitute for sleep in a busy summer of talks in the Netherlands, Germany and England. I thank everyone who interacted with me in the daytimes at least for their forbearance, and some for very useful conversations and feedback, notably James McKinna and Shayan Najd. The ideas were incubated during my visit to Microsoft Research Cambridge in 2014: I’m grateful to Nick Benton for feedback and encouragement. My talk on this topic at SREPLS in Cambridge provoked a very helpful interaction with Andy Pitts, Dominic Orchard, Tomas Petricek, and Stephen Dolan—his semiring-sensitivity provoked the generality of the resource treatment here [10]. I apologize to and thank the referees of all versions of this paper. Sam Lindley and Craig McLaughlin also deserve credit for helping me get my act together.
The inspiration, however, comes from Phil. The clarity of the connection he draws between classical linear logic and session types [31] is what attracted me to this problem. One day he, Simon Gay and I bashed rules at my whiteboard, trying to figure out a dependent version of that ‘Propositions As Sessions’ story. The need to distinguish ‘contemplation’ from ‘consumption’ emerged that afternoon: it has not yet delivered a full higher-order theory of ‘dependent session types’, but in my mind, it showed me the penny I had to make drop.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
McBride, C. (2016). I Got Plenty o’ Nuttin’. In: Lindley, S., McBride, C., Trinder, P., Sannella, D. (eds) A List of Successes That Can Change the World. Lecture Notes in Computer Science(), vol 9600. Springer, Cham. https://doi.org/10.1007/978-3-319-30936-1_12
Download citation
DOI: https://doi.org/10.1007/978-3-319-30936-1_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-30935-4
Online ISBN: 978-3-319-30936-1
eBook Packages: Computer ScienceComputer Science (R0)