An Imperative Language for Verified Exact Real-Number Computation

Andrej Bauer, Sewon Park, Alex Simpson
{"title":"An Imperative Language for Verified Exact Real-Number Computation","authors":"Andrej Bauer, Sewon Park, Alex Simpson","doi":"arxiv-2409.11946","DOIUrl":null,"url":null,"abstract":"We introduce Clerical, a programming language for exact real-number\ncomputation that combines first-order imperative-style programming with a limit\noperator for computation of real numbers as limits of Cauchy sequences. We\naddress the semidecidability of the linear ordering of the reals by\nincorporating nondeterministic guarded choice, through which decisions based on\npartial comparison operations on reals can be patched together to give total\nprograms. The interplay between mutable state, nondeterminism, and computation\nof limits is controlled by the requirement that expressions computing limits\nand guards modify only local state. We devise a domain-theoretic denotational\nsemantics that uses a variant of Plotkin powerdomain construction tailored to\nour specific version of nondeterminism. We formulate a Hoare-style\nspecification logic, show that it is sound for the denotational semantics, and\nillustrate the setup by implementing and proving correct a program for\ncomputation of $\\pi$ as the least positive zero of $\\sin$. The modular\ncharacter of Clerical allows us to compose the program from smaller parts, each\nof which is shown to be correct on its own. We provide a proof-of-concept OCaml\nimplementation of Clerical, and formally verify parts of the development,\nnotably the soundness of specification logic, in the Coq proof assistant.","PeriodicalId":501208,"journal":{"name":"arXiv - CS - Logic in Computer Science","volume":"52 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Logic in Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.11946","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

We introduce Clerical, a programming language for exact real-number computation that combines first-order imperative-style programming with a limit operator for computation of real numbers as limits of Cauchy sequences. We address the semidecidability of the linear ordering of the reals by incorporating nondeterministic guarded choice, through which decisions based on partial comparison operations on reals can be patched together to give total programs. The interplay between mutable state, nondeterminism, and computation of limits is controlled by the requirement that expressions computing limits and guards modify only local state. We devise a domain-theoretic denotational semantics that uses a variant of Plotkin powerdomain construction tailored to our specific version of nondeterminism. We formulate a Hoare-style specification logic, show that it is sound for the denotational semantics, and illustrate the setup by implementing and proving correct a program for computation of $\pi$ as the least positive zero of $\sin$. The modular character of Clerical allows us to compose the program from smaller parts, each of which is shown to be correct on its own. We provide a proof-of-concept OCaml implementation of Clerical, and formally verify parts of the development, notably the soundness of specification logic, in the Coq proof assistant.
验证精确实数计算的命令式语言
我们介绍的 Clerical 是一种用于精确实数计算的编程语言,它将一阶命令式编程与用于计算作为考奇序列极限的实数的极限操作符相结合。我们解决了实数线性排序的半确定性问题,将非确定性保护选择纳入其中,通过这种方式,基于实数部分比较操作的决策可以被拼凑在一起,从而给出总程序。可变状态、非确定性和极限计算之间的相互作用是由计算极限和守护的表达式只能修改局部状态这一要求来控制的。我们设计了一种领域理论指称语义学,它使用了针对我们特定版本的非决定论而定制的普洛特金幂域构造变体。我们提出了一个霍尔风格的规范逻辑,证明它对指称语义是合理的,并通过实现一个计算$\pi$为$\sin$的最小正零的程序,证明了这一设置的正确性。Clerical 的模块化特性允许我们从更小的部分组成程序,而每个部分本身都被证明是正确的。我们提供了Clerical的概念验证OCam实现,并在Coq证明助手中正式验证了开发的部分内容,特别是规范逻辑的正确性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
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学术官方微信