Well-Behaved (Co)algebraic Semantics of Regular Expressions in Dafny

Stefan Zetzsche, Wojciech Rozowski
{"title":"Well-Behaved (Co)algebraic Semantics of Regular Expressions in Dafny","authors":"Stefan Zetzsche, Wojciech Rozowski","doi":"arxiv-2409.09889","DOIUrl":null,"url":null,"abstract":"Regular expressions are commonly understood in terms of their denotational\nsemantics, that is, through formal languages -- the regular languages. This\nview is inductive in nature: two primitives are equivalent if they are\nconstructed in the same way. Alternatively, regular expressions can be\nunderstood in terms of their operational semantics, that is, through\ndeterministic finite automata. This view is coinductive in nature: two\nprimitives are equivalent if they are deconstructed in the same way. It is\nimplied by Kleene's famous theorem that both views are equivalent: regular\nlanguages are precisely the formal languages accepted by deterministic finite\nautomata. In this paper, we use Dafny, a verification-aware programming\nlanguage, to formally verify, for the first time, what has been previously\nestablished only through proofs-by-hand: the two semantics of regular\nexpressions are well-behaved, in the sense that they are in fact one and the\nsame, up to pointwise bisimilarity. At each step of our formalisation, we\npropose an interpretation in the language of Coalgebra. We found that Dafny is\nparticularly well suited for the task due to its inductive and coinductive\nfeatures and hope our approach serves as a blueprint for future generalisations\nto other theories.","PeriodicalId":501124,"journal":{"name":"arXiv - CS - Formal Languages and Automata Theory","volume":"195 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Formal Languages and Automata Theory","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.09889","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Regular expressions are commonly understood in terms of their denotational semantics, that is, through formal languages -- the regular languages. This view is inductive in nature: two primitives are equivalent if they are constructed in the same way. Alternatively, regular expressions can be understood in terms of their operational semantics, that is, through deterministic finite automata. This view is coinductive in nature: two primitives are equivalent if they are deconstructed in the same way. It is implied by Kleene's famous theorem that both views are equivalent: regular languages are precisely the formal languages accepted by deterministic finite automata. In this paper, we use Dafny, a verification-aware programming language, to formally verify, for the first time, what has been previously established only through proofs-by-hand: the two semantics of regular expressions are well-behaved, in the sense that they are in fact one and the same, up to pointwise bisimilarity. At each step of our formalisation, we propose an interpretation in the language of Coalgebra. We found that Dafny is particularly well suited for the task due to its inductive and coinductive features and hope our approach serves as a blueprint for future generalisations to other theories.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Dafny 中正则表达式的完备(共)代数语义学
正则表达式通常从其指称语义学的角度来理解,也就是通过形式语言--正则表达式语言--来理解。这种观点在本质上是归纳性的:如果两个基元以相同的方式构造,它们就是等价的。另外,正则表达式也可以从其运算语义的角度来理解,即通过确定性有限自动机来理解。这种观点在本质上是共导的:如果两个正则表达式以相同的方式解构,它们就是等价的。克莱因的著名定理暗示这两种观点是等价的:正则表达式语言正是确定性有限自动机所接受的形式语言。在本文中,我们使用 Dafny 这种具有验证意识的编程语言,首次正式验证了以前只能通过手写证明来确立的观点:正则表达式的两种语义都是良好的,从这个意义上说,它们实际上是相同的,直到点上的二相似性。在我们形式化的每一步,我们都提出了用 Coalgebra 语言进行解释的方法。我们发现,由于 Dafny 的归纳和共推特性,它特别适合这项任务,并希望我们的方法可以作为未来推广到其他理论的蓝图。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Query Learning of Advice and Nominal Automata Well-Behaved (Co)algebraic Semantics of Regular Expressions in Dafny Run supports and initial algebra supports of weighted automata Alternating hierarchy of sushifts defined by nondeterministic plane-walking automata $\mathbb{N}$-polyregular functions arise from well-quasi-orderings
×
引用
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