Python Code Generation for Isabelle/HOL
Nikolaus Huber, Roly Perera, Dominic Orchard
Key points
From the paper's conclusion- We validate the backend on regression suites covering large parts of the HOL library and by testing six verified data structures and algorithms against established Python libraries.
Abstract
The Isabelle theorem prover provides an environment for formalising mathematics and reasoning about programs. To make verified implementations practically usable, its code generator translates functions expressed in the executable fragment of its logic into conventional programming languages. Its targets have traditionally been functional languages (Standard ML, OCaml, Haskell, and Scala), recently joined by Go. Python, which is becoming the dominant language of scientific computing, data science, and education, has remained out of reach. In this work, we close this gap with a Python backend for Isabelle's code generator. This generator enables verified algorithms to be used in Python applications, or to serve as verified references against which established Python libraries can be differentially tested, without leaving the Python ecosystem. We validate the backend on regression suites covering large parts of the HOL library and by testing six verified data structures and algorithms against established Python libraries. The generated code is slower than hand-written libraries, but well suited as a verified reference.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- IsaGraphLib: Formally Verified Efficient Graph Algorithms in Isabelle/HOLarXiv · 2026
- VeriBase: Automated Construction of Theorem Libraries for Software VerificationarXiv · 2026
- Agentic Verified Optimization of Real-World SoftwarearXiv · 2026
- PastaLean: Deterministic transpilation from Python to Lean for VerificationarXiv · 2026
- A First Introduction to Isabelle/ML Metaprogramming: Automatic Estimation of Polynomial DegreesarXiv · 2026
- Automatic Certified Differentiation in LeanarXiv · 2026