【24h】

Handling Local State with Global State

机译:用全球州处理地方国

获取原文
获取外文期刊封面目录资料

摘要

Equational reasoning is one of the most important tools of functional programming. To facilitate its application to monadic programs, Gibbons and Hinze have proposed a simple axiomatic approach using laws that characterise the computational effects without exposing their implementation details. At the same time Plotkin and Pretnar have proposed algebraic effects and handlers, a mechanism of layered abstractions by which effects can be implemented in terms of other effects. This paper performs a case study that connects these two strands of research. We consider two ways in which the nondeterminism and state effects can interact: the high-level semantics where every nondeterministic branch has a local copy of the state, and the low-level semantics where a single sequentially threaded state is global to all branches. We give a monadic account of the folklore technique of handling local state in terms of global state, provide a novel axiomatic characterisation of global state and prove that the handler satisfies Gibbons and Hinze's local state axioms by means of a novel combination of free monads and contextual equivalence. We also provide a model for global state that is necessarily non-monadic.
机译:等于推理是功能规划最重要的工具之一。为了促进其对Monadic程序的应用,Gibbons和Hinze建议使用表征计算效果的法律来提出简单的公理方法,而不会使其实施细节暴露。同时,Plotkin和Pretnar已经提出了代数效应和处理程序,可以在其他效果方面实现分层抽象的机制。本文表演了一个案例研究,可以连接这两条研究。我们考虑了两种方式,其中不确定和状态效应可以交互:每个非季度分支具有状态的本地副本的高级语义,以及单个顺序线程状态为全部分支的低级语义。我们在全球州处理当地状态的民间传说技术的一个星系,提供全球州的新公理表征,并证明了处理程序通过自由MONADS和CONTEXULAL的新组合来满足Gibbons和Hinze的局部状态公理等价。我们还为全球州提供了一个必然是非整体的模型。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号