Skip to main content

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 exists primarily to support Isabelle-MCP (Isa-LSP), an MCP server that drives Isabelle over its LSP interface for AI agents. That server needs PIDE/LSP requests the stock vscode_server does not expose, and the Isa-REPL it builds on needs an ML loader function that Isabelle2025-2 removed. This tool keeps the edits that add them as version-keyed unified diffs and applies, reverses, and checks them idempotently, then rebuilds the affected Scala when needed.

[!IMPORTANT] Isabelle-MCP and Isa-REPL require this patch — run my-better-isabelle patch against your Isabelle before using them.

Before using this tool, make sure the isabelle command is available — on your PATH, or passed explicitly via --isabelle-bin PATH. Every command needs it (to detect the version and locate ISABELLE_HOME) and aborts with an error if it cannot be found. The system patch command must likewise be installed.

pip install -e .
my-better-isabelle patch          # apply all patches for the detected version
my-better-isabelle status         # show what is applied
my-better-isabelle unpatch        # reverse them

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 Isabelle2024 Isabelle2025-2 What it adds
pide_control PIDE LSP control requests the stock vscode_server does not expose
register_thy native Restores Thy_Info.register_thy, removed in 2025-2
show_types_nv Custom show_types_nv option: suppress type annotations on free/fixed variables only
perspective_eof_clamp Clamp the caret-perspective window's lower bound to EOF (avoids an out-of-range Text.Range past the last line)
expose_map_syn Export the private Sign.map_syn so ML can wholesale replace/clear a theory's inner syntax

pide_control — PIDE LSP control extensions

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 the etc/symbols translation 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).

  • Isabelle2024pide_control authored, compiled (scala_build clean), and runtime-tested. register_thy ships natively, so no patch is needed.
  • Isabelle2025-2pide_control authored and round-trip-verified against pristine source, but not yet compiled. register_thy applies and reverse-detects cleanly, but the Pure/HOL heap has not yet been rebuilt with it. Verify before relying on either; see each feature doc for the exact scope tested.
  • 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

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

my_better_isabelle_prover-0.2.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

my_better_isabelle_prover-0.2.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file my_better_isabelle_prover-0.2.0.tar.gz.

File metadata

File hashes

Hashes for my_better_isabelle_prover-0.2.0.tar.gz
Algorithm Hash digest
SHA256 78e5195d93f159c8a8f198ba4a7b6a6ce30dcfdcdf0c528586bbb61d2e740412
MD5 3ea13a5eedb1fab132473e0d631326b6
BLAKE2b-256 1b174e14e9cb142a7302a8a239f9102b5f855291b865efe6ac9364765788e764

See more details on using hashes here.

File details

Details for the file my_better_isabelle_prover-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for my_better_isabelle_prover-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8110c22d127f8e0cf6010ec27f4751208bfde34881a20c1a58b8a4e8a7dfd0f7
MD5 5f150c8a32ce98f91075a8dac9adc021
BLAKE2b-256 8b691c550f4e26efc494cedcaece0c6d0198c22b0494b841bc2bb61707c43c9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page