Coeffects: A Calculus of Context-Dependent Computation

被引:35
|
作者
Petricek, Tomas [1 ]
Orchard, Dominic [1 ]
Mycroft, Alan [1 ]
机构
[1] Univ Cambridge, Comp Lab, Cambridge, England
关键词
Context; Types; Coeffects; Indexed comonads;
D O I
10.1145/2628136.2628160
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The notion of context in functional languages no longer refers just to variables in scope. Context can capture additional properties of variables (usage patterns in linear logics; caching requirements in dataflow languages) as well as additional resources or properties of the execution environment (rebindable resources; platform version in a cross-platform application). The recently introduced notion of coeffects captures the latter, whole-context properties, but it failed to capture fine-grained per-variable properties. We remedy this by developing a generalized coeffect system with annotations indexed by a coeffect shape. By instantiating a concrete shape, our system captures previously studied flat (whole-context) coeffects, but also structural (per-variable) coeffects, making coeffect analyses more useful. We show that the structural system enjoys desirable syntactic properties and we give a categorical semantics using extended notions of indexed comonad. The examples presented in this paper are based on analysis of established language features (liveness, linear logics, dataflow, dynamic scoping) and we argue that such context-aware properties will also be useful for future development of languages for increasingly heterogeneous and distributed platforms.
引用
收藏
页码:123 / 135
页数:13
相关论文
共 50 条
  • [1] Coeffects: A Calculus of Context-Dependent Computation
    Petricek, Tomas
    Orchard, Dominic
    Mycroft, Alan
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (09) : 123 - 135
  • [2] CoBiC: Context-dependent Bioambient Calculus
    Bortolussi, Luca
    Vigliotti, Maria G.
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2009, 253 (03) : 187 - 201
  • [3] Cut elimination for a calculus with context-dependent rules
    Elbl, B
    [J]. ARCHIVE FOR MATHEMATICAL LOGIC, 2001, 40 (03) : 167 - 188
  • [4] Cut elimination for a calculus with context-dependent rules
    Birgit Elbl
    [J]. Archive for Mathematical Logic, 2001, 40 : 167 - 188
  • [5] A Neuromorphic Computational Primitive for Robust Context-Dependent Decision Making and Context-Dependent Stochastic Computation
    Liang, Dongchen
    Indiveri, Giacomo
    [J]. IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS II-EXPRESS BRIEFS, 2019, 66 (05) : 843 - 847
  • [6] Context-dependent computation by recurrent dynamics in prefrontal cortex
    Valerio Mante
    David Sussillo
    Krishna V. Shenoy
    William T. Newsome
    [J]. Nature, 2013, 503 : 78 - 84
  • [7] Context-dependent computation by recurrent dynamics in prefrontal cortex
    Mante, Valerio
    Sussillo, David
    Shenoy, Krishna V.
    Newsome, William T.
    [J]. NATURE, 2013, 503 (7474) : 78 - +
  • [8] Latent attractors: A general paradigm for context-dependent neural computation
    Doboli, Simona
    Minai, Ali A.
    [J]. TRENDS IN NEURAL COMPUTATION, 2007, 35 : 135 - +
  • [9] A Library-Based Approach to Context-Dependent Computation with Reactive Values
    Inoue, Hiroaki
    Igarashi, Atsushi
    [J]. COMPANION PROCEEDINGS OF THE 15TH INTERNATIONAL CONFERENCE ON MODULARITY (MODULARITY COMPANION'16), 2016, : 50 - 54
  • [10] A geometric framework for understanding dynamic information integration in context-dependent computation
    Zhang, Xiaohan
    Liu, Shenquan
    Chen, Zhe Sage
    [J]. ISCIENCE, 2021, 24 (08)