From Global to Local State, Coalgebraically and Compositionally

Jim Laird
{"title":"From Global to Local State, Coalgebraically and Compositionally","authors":"Jim Laird","doi":"10.1016/j.entcs.2019.09.011","DOIUrl":null,"url":null,"abstract":"<div><p>We describe a type theory or metalanguage for constructing and reasoning about higher-order programs with global and local state, and its categorical model. This provides an encapsulation primitive for abstracting global state and making it local to an object, so that it is passed only between its invocations. Our calculus and its semantics extend the interpretation of lambda-terms in a Cartesian closed category with a monoidal action on a category of evaluation contexts — <em>the sequoid</em> — which is dual to the action of the function type. This gives an interpretation of a new type constructor which allows the representation of both global state — via “state-passing-style” interpretation which uses it to represent output states — and local state, via encapsulation, which corresponds to the unique map into a <em>final coalgebra</em> for the sequoid. This provides the equational theory of our calculus with a coinduction rule for proving equivalence between objects with local state. We show that this theory is sound and complete with respect to the categorical semantics by constructing a term model and we show that it is consistent by giving a concrete example based on a category of games and strategies previously used to interpret general references.</p></div>","PeriodicalId":38770,"journal":{"name":"Electronic Notes in Theoretical Computer Science","volume":"347 ","pages":"Pages 203-222"},"PeriodicalIF":0.0000,"publicationDate":"2019-11-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/j.entcs.2019.09.011","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Electronic Notes in Theoretical Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1571066119301276","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 0

Abstract

We describe a type theory or metalanguage for constructing and reasoning about higher-order programs with global and local state, and its categorical model. This provides an encapsulation primitive for abstracting global state and making it local to an object, so that it is passed only between its invocations. Our calculus and its semantics extend the interpretation of lambda-terms in a Cartesian closed category with a monoidal action on a category of evaluation contexts — the sequoid — which is dual to the action of the function type. This gives an interpretation of a new type constructor which allows the representation of both global state — via “state-passing-style” interpretation which uses it to represent output states — and local state, via encapsulation, which corresponds to the unique map into a final coalgebra for the sequoid. This provides the equational theory of our calculus with a coinduction rule for proving equivalence between objects with local state. We show that this theory is sound and complete with respect to the categorical semantics by constructing a term model and we show that it is consistent by giving a concrete example based on a category of games and strategies previously used to interpret general references.

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
从全局到局部状态,共代数和组合
我们描述了一种用于构造和推理具有全局和局部状态的高阶程序的类型理论或元语言,以及它的分类模型。这提供了一个封装原语,用于抽象全局状态并使其成为对象的局部状态,以便仅在其调用之间传递。我们的演算及其语义扩展了笛卡尔闭范畴中lambda项的解释,该范畴在求值上下文(sequoid)的范畴上具有一元作用,它是函数类型作用的对偶。这给出了一个新的类型构造函数的解释,它允许表示全局状态(通过“状态传递风格”的解释,使用它来表示输出状态)和局部状态(通过封装),它对应于到sequoid的最终协代数的唯一映射。这为微积分的等式理论提供了一个证明具有局部状态的物体之间等价的协归纳规则。我们通过构建一个术语模型来证明这个理论在范畴语义方面是健全和完整的,我们通过给出一个基于之前用于解释一般参考的游戏和策略类别的具体例子来证明它是一致的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
Electronic Notes in Theoretical Computer Science
Electronic Notes in Theoretical Computer Science Computer Science-Computer Science (all)
自引率
0.00%
发文量
0
期刊介绍: ENTCS is a venue for the rapid electronic publication of the proceedings of conferences, of lecture notes, monographs and other similar material for which quick publication and the availability on the electronic media is appropriate. Organizers of conferences whose proceedings appear in ENTCS, and authors of other material appearing as a volume in the series are allowed to make hard copies of the relevant volume for limited distribution. For example, conference proceedings may be distributed to participants at the meeting, and lecture notes can be distributed to those taking a course based on the material in the volume.
期刊最新文献
Preface Murphree's Numerical Term Logic Tableaux A Note on Constructive Interpolation for the Multi-Modal Logic Km Paracomplete Logics Dual to the Genuine Paraconsistent Logics: The Three-valued Case Building a Maximal Independent Set for the Vertex-coloring Problem on Planar Graphs
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1