Work

A nondeterministic monad for safe external calls from formally verified functional code: With parametricity arguments, and a case study on hash-consing and BDDs

Year: 2026
Type: preprint
Abstract: We address the issue of mixing formally verified, functional code and unverified, impure code. Is this practice safe? In this paper, we discuss issues arising from the assumption that all constructs are functional and deterministic, which may not hold for external code. We argue that (a) much external functionality, including computational oracles and hash tables, can be wrapped in a “may-return” monad, and (b) many desirable properties are simply ensured by the type safety of the external code. However, working permanently in a nondeterministic monad is cumbersome---especially when the result is actually deterministic. To address this, we introduce exit operators, most notably a “deterministic exit” monadic operator. We illustrate this with the example of a library for computing over binary decision diagrams (BDDs), and clarify the impact of not being able to prove full reduction.
Source: HAL
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W7170997341
Cites:
Cited by:
Related to: 10