A Core Quantitative Coeffect Calculus
Abstract
Linear logic is well known for its resource-awareness, which has inspired the design of several resource management mechanisms in programming language design. Its resource-awareness arises from the distinction between linear, single-use data and non-linear, reusable data. The latter is marked by the so-called exponential modality, which, from the categorical viewpoint, is a (monoidal) comonad.
Monadic notions of computation are well-established mechanisms used to express effects in pure functional languages. Less well-established is the notion of comonadic computation. However, recent works have shown the usefulness of comonads to structure context dependent computations. In this work, we present a language \(\ell \mathcal{R}\) PCF inspired by a generalized interpretation of the exponential modality. In \(\ell \mathcal{R}\) PCF the exponential modality carries a label—an element of a semiring \(\mathcal{R}\)—that provides additional information on how a program uses its context. This additional structure is used to express comonadic type analysis.
Keywords
Type System Natural Transformation Operational Semantic Linear Logic Observable QuantityReferences
- 1.Abadi, M., Banerjee, A., Heintze, N., Riecke, J.: A core calculus of dependency. In: POPL. ACM (1999)Google Scholar
- 2.Atkey, R.: Parameterised notions of computation. JFP 19(3-4) (2009)Google Scholar
- 3.Atkey, R., Johann, P., Kennedy, A.: Abstraction and invariance for algebraically indexed types. In: POPL. ACM (2013)Google Scholar
- 4.Benton, N., Bierman, G.M., Hyland, J.M.E., de Paiva, V.: Term assignment for intuitionistic linear logic. Technical Report 262, University of Cambridge (1992)Google Scholar
- 5.Benton, N., Tabareau, N.: Compiling functional types to relational specifications for low level imperative code. In: TLDI. ACM (2009)Google Scholar
- 6.Benton, N., Wadler, P.: Linear logic, monads and the lambda calculus. In: LICS. IEEE (1996)Google Scholar
- 7.Brunel, A.: Quantitative classical realizability. Inf. and Comp. (to appear, 2013)Google Scholar
- 8.Brunel, A., Madet, A.: Indexed realizability for bounded-time programming with references and type fixpoints. In: Jhala, R., Igarashi, A. (eds.) APLAS 2012. LNCS, vol. 7705, pp. 264–279. Springer, Heidelberg (2012)CrossRefGoogle Scholar
- 9.Dal Lago, U., Gaboardi, M.: Linear dependent types and relative completeness. In: LICS. IEEE (2011)Google Scholar
- 10.Dal Lago, U., Hofmann, M.: Bounded linear logic, revisited. In: Curien, P.-L. (ed.) TLCA 2009. LNCS, vol. 5608, pp. 80–94. Springer, Heidelberg (2009)CrossRefGoogle Scholar
- 11.Dal Lago, U., Hofmann, M.: Realizability models and implicit complexity. TCS 412(20) (2011)Google Scholar
- 12.D’Antoni, L., Gaboardi, M., Gallego Arias, E.J., Haeberlen, A., Pierce, B.: Sensitivity analysis using type-based constraints. In: FPCDSL. ACM (2013)Google Scholar
- 13.Filinski, A.: Representing layered monads. In: POPL. ACM (1999)Google Scholar
- 14.Gaboardi, M., Haeberlen, A., Hsu, J., Narayan, A., Pierce, B.C.: Linear dependent types for differential privacy. In: POPL. ACM (2013)Google Scholar
- 15.Ghica, D.R., Smith, A.: Geometry of synthesis III: Resource management through type inference. In: POPL. ACM (2011)Google Scholar
- 16.Ghica, D.R., Smith, A. I.: Bounded linear types in a resource semiring. In: Shao, Z. (ed.) ESOP 2014. LNCS, vol. 8410, pp. 331–350. Springer, Heidelberg (2014)Google Scholar
- 17.Girard, J.-Y.: Linear logic. TCS 50(1), 1–102 (1987)CrossRefzbMATHMathSciNetGoogle Scholar
- 18.Girard, J.-Y., Scedrov, A., Scott, P.: Bounded linear logic. TCS 97(1) (1992)Google Scholar
- 19.Guillou, B.: Strictification of categories weakly enriched in symmetric monoidal categories. Theory and Applications of Categories 24(20), 564–579 (2010)zbMATHMathSciNetGoogle Scholar
- 20.Heintze, N., Riecke, J.G.: The SLam calculus: Programming with secrecy and integrity. In: POPL. ACM (1998)Google Scholar
- 21.Hofmann, M., Scott, P.J.: Realizability models for BLL-like languages. TCS 318(1-2) (2004)Google Scholar
- 22.Krivine, J.-L.: A call-by-name lambda-calculus machine. HOSC 20(3) (2007)Google Scholar
- 23.Dal Lago, U., Schöpp, U.: Functional programming in sublinear space. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 205–225. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 24.Laird, J., Manzonetto, G., McCusker, G., Pagani, M.: Weighted relational models of typed lambda-calculi. In: LICS. IEEE (2013)Google Scholar
- 25.Laplaza, M.: Coherence for distributivity. Lecture Notes in Math. 281 (1972)Google Scholar
- 26.Melliès, P.-A.: Categorical semantics of linear logic. Panoramas et Syntheses (2009)Google Scholar
- 27.Melliès, P.-A.: Parametric monads and enriched adjunctions. Technical report (2012), http://www.pps.univ-paris-diderot.fr/~mellies/tensorial-logic/
- 28.Melliès, P.-A.: The parametric continuation monad. Mathematical Structures in Computer Science (to appear, 2014)Google Scholar
- 29.Moggi, E.: Computational lambda-calculus and monads. In: LICS. IEEE (1989)Google Scholar
- 30.Nielson, F., Nielson, H.R., Hankin, C.L.: Principles of Program Analysis. Springer (1999)Google Scholar
- 31.Nigam, V., Miller, D.: Algorithmic specifications in linear logic with subexponentials. In: PPDP. ACM (2009)Google Scholar
- 32.Orchard, D.: Programming contextual computations, Cambridge University (2013)Google Scholar
- 33.Petricek, T., Orchard, D., Mycroft, A.: Coeffects: Unified static analysis of context-dependence. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013, Part II. LNCS, vol. 7966, pp. 385–397. Springer, Heidelberg (2013)CrossRefGoogle Scholar
- 34.Pitts, A.M.: Step-indexed biorthogonality: a tutorial example, Dagstuhl (2010)Google Scholar
- 35.Reed, J., Pierce, B.C.: Distance makes the types grow stronger: A calculus for differential privacy. In: ICFP. ACM (2010)Google Scholar
- 36.Talpin, J.-P., Jouvelot, P.: The type and effect discipline. In: LICS. IEEE (1992)Google Scholar
- 37.Tate, R.: The sequential semantics of producer effect systems. In: POPL (2013)Google Scholar
- 38.Uustalu, T., Vene, V.: Signals and comonads. J. UCS 11(7) (2005)Google Scholar
- 39.Uustalu, T., Vene, V.: Comonadic notions of computation. ENTCS 203 (2008)Google Scholar
- 40.Wadler, P.: The essence of functional programming. In: POPL. ACM (1992)Google Scholar
- 41.Wadler, P.: The marriage of effects and monads. In: ICFP. ACM (1998)Google Scholar