This paper introduces Isabelle Pool Server (IPS), a specialized verification service designed to bridge the gap between the Isabelle proof assistant and the high-throughput requirements of machine learning training loops and autonomous agents.
TL;DR
IPS provides a "prover-as-a-service" architecture for Isabelle, managing a pool of "warm" headless sessions behind an HTTP API. It introduces critical resource-management features—like memory-aware admission control, time budgets, and cheap backtracking—that enable Isabelle to scale efficiently for LLM training and multi-agent proving.
What Problem Does This Paper Address?
Traditionally, proof assistants like Isabelle were designed for human-in-the-loop interaction via editors (like jEdit) or batch processing of entire theories. However, the rise of "machine-driven" formal methods has created two new scenarios that existing tools struggle to support:
- The Training Scenario: LLM-based provers need to verify thousands of candidate proof steps per hour. This requires low-latency verification and the ability to "branch" or "backtrack" proof states without the massive overhead of restarting the prover.
- The Multi-Agent Serving Scenario: Multiple autonomous agents might share a single host. Without centralized resource management, these agents can easily exhaust system memory, leading to kernel OOM (Out-Of-Memory) kills that crash the entire environment.
Existing Isabelle connectors either lack resource management, are too slow for fine-grained steps, or don't provide reliable "verdicts" (e.g., they might accidentally accept a proof that uses a sorry placeholder).
Methods
IPS acts as a resource-management layer on top of a direct PIDE (Prover IDE) frontend. Its architecture is summarized in Figure 1.
Key technical innovations include:
- Session Pooling & Leasing: IPS maintains "warm" sessions pre-loaded with logic heaps (like HOL-Analysis). Clients lease these sessions; idle or abandoned leases are automatically reclaimed.
- Memory Gate: Using
cgroupmonitoring, IPS implements admission control. If a new session would push the host past a memory threshold, the request is refused with a "Retry-After" response rather than risking a system crash. - Document-Model Backtracking: Instead of replaying commands from scratch to branch a proof, IPS leverages PIDE’s document model to create checkpoints. Restoring a state is nearly instantaneous.
- Reliable Verdicts: IPS separates "did the command error?" from "is the theorem proved?". It provides explicit flags for
success,proof_open, andused_sorry, using a full batch build as the final arbiter of truth.
Datasets
The authors evaluated IPS using the HOL-Analysis library, a substantial body of formal mathematics consisting of 93 theories and approximately 166,000 commands.
They established a "census" benchmark: a scripted replay of this entire library at a single worker to serve as a performance baseline. They also compared IPS against PIDE MCP (commit dd46315), a contemporary tool designed to connect AI agents to Isabelle.
Key Insights and Ideas
- The "Perspective" Cost: A major "aha" moment was identifying why PIDE frontends often consume excessive memory. By default, many tools make the entire theory "visible" to run print functions. IPS defaults to an empty visible range, saving hundreds of megabytes per session.
- Scaling via Headless Sessions: By running sessions without an editor GUI and sharing a single "Gateway JVM," IPS can scale to 32 concurrent workers on a single 128 GB host.
- Cheap Branching: The cost of replaying a theory prefix to reach a proof state grows with the length of the file. In contrast, IPS's checkpoint/restore mechanism remains constant-time (around 4ms), making it at least 350 to 1,450 times faster than replaying for late-stage proof states.
Key Results
- Throughput: At 32 workers, IPS verified 3,181 chunks per minute (once sessions were up), achieving 24x the throughput of a single worker.
- Latency: The median latency for a verification call is roughly 0.41s to 0.52s, even under load.
- Memory Efficiency: IPS fits significantly more sessions into a 100 GB budget than PIDE MCP. For the
HOLheap, IPS supports 111 sessions compared to 78 for PIDE MCP (Topology A) or 38 (Topology B). - Robustness: In stress tests, IPS successfully refused the 28th concurrent session to stay within a 48 GB memory limit, whereas unmanaged tools would likely have triggered a system-wide crash.
Limitations and Future Work
- Session Scope: Currently, an IPS session is limited to a single theory with no physical file behind it. This simplifies pooling but means it cannot yet handle complex, multi-file project scopes.
- Security: There is currently no built-in authentication. IPS is intended to run on trusted networks or behind an authenticating proxy.
- Roadmap: The authors plan to implement "strict verdicts" that check the oracle set of a theorem (to ensure no unauthorized axioms were used) and explore consolidation with the newer PIDE AI tool.
For those interested in the implementation, the code is open-source and available on GitHub.
Summary updated