Combining effects and coeffects via grading

Combining effects and coeffects via grading
复制标题

通过分级结合效应和协同效应

DOI:
10.1145/2951913.2951939
复制
发表时间:
2016
期刊:
--
影响因子:
--
通讯作者:
Gaboardi M
Gaboardi M
中科院分区:
--
文献类型:
--
作者:
Gaboardi M

文献摘要

参考文献

被引文献

相似文献

效应和协同效应是程序行为的两个普遍的、互补的方面。它们大致对应于改变执行上下文(效果)的计算与对上下文提出要求的计算(协同效果)。有效的特征包括偏爱性、非确定性、输入输出、状态和异常。协同效应特征包括资源需求、变量访问、线性概念和数据输入要求。程序的有效或协同效应行为可以通过基于类型的分析来捕获和描述,并通过幺群效应注释和半环协同效应提供细粒度信息。最近的各种工作已经根据效应的分级(强)单子和协效应的分级(单形)共单子提出了此类类型演算的模型。到目前为止,效应和协同效应已经被单独研究,但在实践中,许多计算既有效又具有协同效应,例如,可能抛出异常但有资源要求。为了解决这个问题,我们引入了一种新的通用微积分和组合效应-共效应系统。这可以描述程序对其上下文的变化和要求,以及这些有效和协同的计算特征之间的相互作用。效应-共效应系统具有效应分级单子和共效应分级共单元的指称模型,其中相互作用通过分级分配律的新概念来表达。这种分级语义将句法类型理论与指称模型统一起来。我们表明,我们的微积分可以实例化,以自然的方式描述程序与其评估上下文之间的各种不同类型的交互。
Effects and coeffects are two general, complementary aspects of program behaviour. They roughly correspond to computations which change the execution context (effects) versus computations which make demands on the context (coeffects). Effectful features include partiality, non-determinism, input-output, state, and exceptions. Coeffectful features include resource demands, variable access, notions of linearity, and data input requirements. The effectful or coeffectful behaviour of a program can be captured and described via type-based analyses, with fine grained information provided by monoidal effect annotations and semiring coeffects. Various recent work has proposed models for such typed calculi in terms of graded (strong) monads for effects and graded (monoidal) comonads for coeffects. Effects and coeffects have been studied separately so far, but in practice many computations are both effectful and coeffectful, e.g., possibly throwing exceptions but with resource requirements. To remedy this, we introduce a new general calculus with a combined effect-coeffect system. This can describe both the changes and requirements that a program has on its context, as well as interactions between these effectful and coeffectful features of computation. The effect-coeffect system has a denotational model in terms of effect-graded monads and coeffect-graded comonads where interaction is expressed via the novel concept of graded distributive laws. This graded semantics unifies the syntactic type theory with the denotational model. We show that our calculus can be instantiated to describe in a natural way various different kinds of interaction between a program and its evaluation context.
效果和单子的结合
DOI: --
发表时间: 1998
期刊: ACM SIGPLAN International Conference on Functional Programming
影响因子: --
作者:
Jennifer S Peel;M. Mcnarry;S. Heffernan;V. Nevola;L. Kilduff;M. Waldron
通讯作者: M. Waldron
轻仿射 lambda 演算和多时间强归一化
DOI: --
发表时间: 2001
期刊: Proceedings 16th Annual IEEE Symposium on Logic in Computer Science
影响因子: --
作者:
K. Terui
通讯作者: K. Terui
上下文感知编程语言
DOI: --
发表时间: 2017
期刊:
影响因子: --
作者:
T. Petříček
通讯作者: T. Petříček
DOI: --
发表时间: 2013
期刊:
影响因子: --
作者:
Danel Ahman;Tarmo Uustalu
通讯作者: Tarmo Uustalu
数据流编程的本质
DOI: --
发表时间: 2005
期刊: Asian Symposium on Programming Languages and Systems
影响因子: --
作者:
Tarmo Uustalu;Varmo Vene
通讯作者: Varmo Vene