从全局到局部状态,共代数和组合

Q3 Computer Science
Jim Laird
{"title":"从全局到局部状态,共代数和组合","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":"{\"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}","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

摘要

我们描述了一种用于构造和推理具有全局和局部状态的高阶程序的类型理论或元语言,以及它的分类模型。这提供了一个封装原语,用于抽象全局状态并使其成为对象的局部状态,以便仅在其调用之间传递。我们的演算及其语义扩展了笛卡尔闭范畴中lambda项的解释,该范畴在求值上下文(sequoid)的范畴上具有一元作用,它是函数类型作用的对偶。这给出了一个新的类型构造函数的解释,它允许表示全局状态(通过“状态传递风格”的解释,使用它来表示输出状态)和局部状态(通过封装),它对应于到sequoid的最终协代数的唯一映射。这为微积分的等式理论提供了一个证明具有局部状态的物体之间等价的协归纳规则。我们通过构建一个术语模型来证明这个理论在范畴语义方面是健全和完整的,我们通过给出一个基于之前用于解释一般参考的游戏和策略类别的具体例子来证明它是一致的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
From Global to Local State, Coalgebraically and Compositionally

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.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
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.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信