{"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.