Reasoning about effect interaction by fusion

Author:

Yang Zhixuan1ORCID,Wu Nicolas1ORCID

Affiliation:

1. Imperial College London, UK

Abstract

Effect handlers can be composed by applying them sequentially, each handling some operations and leaving other operations uninterpreted in the syntax tree. However, the semantics of composed handlers can be subtle---it is well known that different orders of composing handlers can lead to drastically different semantics. Determining the correct order of composition is a non-trivial task. To alleviate this problem, this paper presents a systematic way of deriving sufficient conditions on handlers for their composite to correctly handle combinations, such as the sum and the tensor, of the effect theories separately handled. These conditions are solely characterised by the clauses for relevant operations of the handlers, and are derived by fusing two handlers into one using a form of fold/build fusion and continuation-passing style transformation. As case studies, the technique is applied to commutative and distributive interaction of handlers to obtain a series of results about the interaction of common handlers: (a) equations respected by each handler are preserved after handler composition; (b) handling mutable state before any handler gives rise to a semantics in which state operations are commutative with any operations from the latter handler; (c) handling the writer effect and mutable state in either order gives rise to a correct handler of the commutative combination of these two theories.

Funder

Engineering and Physical Sciences Research Council

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference46 articles.

1. Handling fibred algebraic effects

2. Andrej Bauer. 2018. What is algebraic about algebraic effects and handlers? arxiv:1807.05923. arxiv:1807.05923 Andrej Bauer. 2018. What is algebraic about algebraic effects and handlers? arxiv:1807.05923. arxiv:1807.05923

3. An Effect System for Algebraic Effects and Handlers

4. Programming with algebraic effects and handlers

5. Handle with care: relational interpretation of algebraic effects and handlers

Cited by 7 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Making a Curry Interpreter using Effects and Handlers;Proceedings of the 17th ACM SIGPLAN International Haskell Symposium;2024-08-28

2. A framework for higher-order effects & handlers;Science of Computer Programming;2024-05

3. Modular Denotational Semantics for Effects with Guarded Interaction Trees;Proceedings of the ACM on Programming Languages;2024-01-05

4. Modular Models of Monoids with Operations;Proceedings of the ACM on Programming Languages;2023-08-30

5. Reasoning about MLIR Semantics through Effects and Handlers;Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis;2023-07-12

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3