isabelle-client
is a TCP client for
Isabelle server. For more information
about the server see Chapter 4 of the Isabelle system
manual.
The best way to install this package is to use pip
:
pip install isabelle-client
Another option is to use Anaconda:
conda install -c conda-forge isabelle-client
One can also download and run the client together with Isabelle in a Docker contanier:
docker build -t isabelle-client https://github.com/inpefess/isabelle-client.git
docker run -d --rm -p 8888:8888 --name isabelle-client isabelle-client
And navigate to example page in your browser.
from isabelle_client import get_isabelle_client, start_isabelle_server
# start Isabelle server
server_info, _ = start_isabelle_server()
# create a client object
isabelle = get_isabelle_client(server_info)
# send a theory file from the current directory to the server
response = isabelle.use_theories(
theories=["Example"], master_dir=".", watchdog_timeout=0
)
# shut the server down
isabelle.shutdown()
For more details, follow the usage example from documentation or a notebook.
You can also pass a theory file body (something you typically put
between begin
and end
keywords) to a high-level connector
that will generate a temporary file for you, send it to the Isabelle
server and get the result for you. For example, this snippet:
from isabelle_client.isabelle_connector import IsabelleConnector
from isabelle_client.isabelle_connector import IsabelleTheoryError
isabelle_connector = IsabelleConnector()
try:
isabelle_connector.build_theory(
r'lemma "\<forall> x. \<forall> y. x = y"' "\nby auto"
)
print("Theory is validated!")
except IsabelleTheoryError as error:
print(error.args[0])
will produce something like:
: Failed to finish proof\<^here>: : goal (1 subgoal): : 1. \<And>x y. x = y
More documentation can be found here.
There are Python clients to other interactive theorem provers, for example:
Modules helping to inetract with Isabelle server from Python are parts of the Proving for Fun project.
There are also clients to Isabelle server in other programming languages, e.g. this one in Rust.
isabelle-client helped to build some cool LLM stuff (in reversed chronological order):
- StepProof: Step-by-step verification of natural language mathematical proofs (Hu et al.) with code
- HybridProver: Augmenting Theorem Proving with LLM-Driven Proof Synthesis and Refinement (Hu et al.)
- Verification and Refinement of Natural Language Explanations through LLM-Symbolic Theorem Proving (Quan et al., EMNLP 2024) with code
If you’re writing a research paper, you can cite the Isabelle client using the following DOI. You can also cite Isabelle 2021 (and an earlier version of the client) with this DOI. There also is a somewhat more complete (but unpublished) pre-print.
Please follow the contribution guide while adhering to the code of conduct.