Table of Contents
Fetching ...

An Imperative Language for Verified Exact Real-Number Computation

Andrej Bauer, Sewon Park, Alex Simpson

TL;DR

A domain-theoretic denotational semantics that uses a variant of Plotkin powerdomain construction tailored to the authors' specific version of nondeterminism is devised, and formally verify parts of the development, notably the soundness of specification logic, in the Coq proof assistant.

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 $π$ 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.

An Imperative Language for Verified Exact Real-Number Computation

TL;DR

A domain-theoretic denotational semantics that uses a variant of Plotkin powerdomain construction tailored to the authors' specific version of nondeterminism is devised, and formally verify parts of the development, notably the soundness of specification logic, in the Coq proof assistant.

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 as the least positive zero of . 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.
Paper Structure (15 sections, 3 theorems, 73 equations, 13 figures)

This paper contains 15 sections, 3 theorems, 73 equations, 13 figures.

Key Result

Proposition 4.1

For any set $S$, it holds that $(\mathcal{P}_{\!\star}(S), \sqsubseteq)$ is an $\omega$-complete partial order with least element.

Figures (13)

  • Figure 3.1: Abstract syntax
  • Figure 3.2: Typing rules
  • Figure 4.1: Denotational semantics of pure expressions
  • Figure 4.2: Denotational semantics of general expressions, excluding $\mathtt{case}$ and $\mathtt{while}$
  • Figure 6.1: General proof rules
  • ...and 8 more figures

Theorems & Definitions (6)

  • Proposition 4.1
  • proof
  • Proposition 4.2
  • proof
  • Theorem 6.1
  • proof