Patch manager for Isabelle installations
Project description
my-better-isabelle-prover
A patch manager for Isabelle installations.
GitHub: https://github.com/xqyww123/my_better_isabelle_prover
It carries the patches that the surrounding Isabelle/ML research stack needs: the
SIMD FFI of Semantic_Embedding, and — for development —
Isa-REPL and Isa-Mini, notably an ML
loader function that Isabelle2025-2 removed. This tool keeps those edits as
version-keyed unified diffs and applies, reverses, and checks them idempotently,
then rebuilds the affected Scala when needed.
[!NOTE] Isabelle-MCP no longer needs any patch. It used to:
pide_controlgavevscode_serverthe PIDE requests it lacked, and its ML half gave PIDE a global-cancel command. Isabelle-MCP now ships its ownisabelle mcp_serverScala component (which carries those requests as its own code) and cancels through an ML prelude injected at prover startup, built from the publicEXECUTIONAPI alone. Bothpide_controlandperspective_eof_clampare therefore retired on Isabelle2025-2; they remain only for Isabelle2024, which Isabelle-MCP no longer targets. See thelast-isabelle2024-supporttag in both repositories.
[!IMPORTANT] Developing against Isa-REPL or Isa-Mini needs
my-better-isabelle patch --category all(see Categories).Before using this tool, make sure the
isabellecommand is available — on yourPATH, or passed explicitly via--isabelle-bin PATH. Every command needs it (to detect the version and locateISABELLE_HOME) and aborts with an error if it cannot be found. The systempatchcommand must likewise be installed.
pip install -e .
my-better-isabelle patch # apply the `user` patches for the detected version
my-better-isabelle patch --category all # ... plus the `dev` ones
my-better-isabelle status # show what is applied
my-better-isabelle unpatch # reverse them all
The Python version constraint is declared in pyproject.toml. See
reference.md for the full list of prerequisites and CLI
options.
Features
A feature is one self-consistent bundle of patches, stored per Isabelle
version. Run my-better-isabelle status to see which are applied.
| Feature | Category | Isabelle2024 | Isabelle2025-2 | What it adds |
|---|---|---|---|---|
pide_control |
user | ✓ | retired | PIDE LSP control requests the stock vscode_server does not expose. Isabelle-MCP now carries them in its own component — see the note above |
perspective_eof_clamp |
user | ✓ | retired | Clamp the caret-perspective window's lower bound to EOF (avoids an out-of-range Text.Range past the last line). Likewise now in Isabelle-MCP's own vscode_model.scala |
expose_foreign |
user | native | ✓ | Stop hiding Poly/ML's Foreign/RunCall/CInterface FFI structures, which 2025-2 forgets during the Pure bootstrap |
register_thy |
dev | native | ✓ | Restores Thy_Info.register_thy, removed in 2025-2 |
show_types_nv |
dev | ✓ | ✓ | Custom show_types_nv option: suppress type annotations on free/fixed variables only |
expose_map_syn |
dev | ✓ | ✓ | Export the private Sign.map_syn so ML can wholesale replace/clear a theory's inner syntax |
Categories
Each feature is either user or dev, and my-better-isabelle patch applies
only the user ones by default.
user— needed by the user-facing systems. On Isabelle2025-2 that is now only the SIMD FFI ofSemantic_Embedding(expose_foreign); the two Isabelle-MCP features are retired there and survive for Isabelle2024 alone.dev— needed only by developer/experiment infrastructure: Isa-REPL, and Isa-Mini's translator and AoA agent injector.
[!WARNING] The three
devpatches are compile-time dependencies of that stack —Thy_Info.register_thy,Printer.show_types_nv,Sign.map_synsimply do not exist without them, so the ML fails to compile. If you are building or running Isa-REPL / Isa-Mini, apply everything:my-better-isabelle patch --category all
status always lists every feature regardless of category; its exit code
reflects only the selected category (user by default). Categories live in
patches/categories.toml.
pide_control — PIDE LSP control extensions (Isabelle2024 only; retired on 2025-2)
[!NOTE] Retired on Isabelle2025-2 and reversed from that distribution. Isabelle-MCP forked the
vscode_serversources into its ownisabelle mcp_servercomponent, so the five LSP requests below are now that component's own code; and it replaced the ML half (Execution.cancel_execution+ theDocument.cancel_executionprotocol command) with an ML prelude injected at prover startup viause_prelude, built fromExecution.discontinue+Execution.cancel— public API, no patch. That removes this feature's worst cost: patchingsrc/Pure/**.MLinvalidated every session heap on the machine.It survives for Isabelle2024, whose VSCode sources the fork does not target (three of its files do not exist there and the Pure Scala API differs).
Edits five ML/Scala files to add these LSP requests (full request/response protocol in pide_control.md):
PIDE/theory_status— per-theory processing status for all loaded theories, including auto-loaded dependencies.PIDE/cancel_execution— immediately cancel all running processing, globally.PIDE/command_at_position— source text and range of the Isar command enclosing a position, with no caret move.PIDE/output_at_position— source, range, and rendered prover output of the command enclosing a position, in one request, with no caret move.PIDE/symbols— dump theetc/symbolstranslation table(s) so a client can decode/encode Isabelle symbol notation (\<forall>↔ ∀).
register_thy — restore removed theory registration (Isabelle2025-2)
Thy_Info.register_thy existed in 2024 but was removed by the 2025-2
theory-loader refactoring. Isa-REPL needs it to inject an already-built,
in-memory theory value into Isabelle's global loader database. The patch
re-adds it, restored from the 2024 source with one node-type adaptation. Pure ML
change — no scala_build. Details in
register_thy.md.
Supported versions & verification status
Patch targets are keyed by the exact output of isabelle version
(e.g. Isabelle2024, Isabelle2025-2).
- Isabelle2024 —
pide_controlauthored, compiled (scala_buildclean), and runtime-tested; still applied there.register_thyships natively, so no patch is needed. - Isabelle2025-2 —
pide_controlandperspective_eof_clampwere applied, compiled and runtime-tested here, and have now been reversed and retired (see the note above). The reversal was verified byte-for-byte against the pristine sources andisabelle scala_build -fwas re-run, so this distribution's Scala is stock again.register_thyapplies and reverse-detects cleanly. show_types_nv— recorded for Isabelle2024 (reverse-recorded from the existing hand edit) and ported to Isabelle2025-2. On 2025-2 it is applied, the Pure heap has been rebuilt, and it is runtime-verified (free-variable type annotation suppressed). The end-to-end consumer path (Isa-Mini/.../print_formats.ML,show_markup=false, HOL terms) is pending the HOL/Isa-Mini rebuild.
Documentation
- reference.md — CLI reference: subcommands, flags, examples, exit codes, and runtime prerequisites.
- develop.md — how the manager works, the patch-repository layout, and how to add a new patch.
- RELEASE.md — how a version is cut and published to PyPI.
- Feature docs (full protocol / rationale):
pide_control.md,expose_foreign.md,register_thy.md,show_types_nv.md,expose_map_syn.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file my_better_isabelle_prover-0.3.0.tar.gz.
File metadata
- Download URL: my_better_isabelle_prover-0.3.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f831205e283165a9788fe80f5ccec4601b340b7c53229ecf14514f2788e274c2
|
|
| MD5 |
5faeb29735724a4e3106bcc600e2350d
|
|
| BLAKE2b-256 |
9f8db22df5847c770c3316177c75c93cd460fe85daafe3cd06d8c3c286538e2e
|
File details
Details for the file my_better_isabelle_prover-0.3.0-py3-none-any.whl.
File metadata
- Download URL: my_better_isabelle_prover-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9273e9fa4d9ce7c7af1596ca3249c588e5fdae6776ee6ed6d3622bf868e5db6
|
|
| MD5 |
d8e2bd2165203a1eb904f9e910c7279a
|
|
| BLAKE2b-256 |
dac3471bb3870c7dc413a58aaf728a4a73b6af3f5d26d9db62c8e8309426fddd
|