Skip to main content

Isabelle REPL client

Project description

Isabelle REPL

Unofficial support for Isabelle's Read-Eval-Print-Loop.

Features

  • Python Client, easy for Machine Learning.
  • Full support for all Isabelle commands
  • Tracing the proof state and the output panel for each step of evaluation.
    • Plugin: collecting data from Isabelle's internal representations by plugins written in Isabelle/ML (example).
  • Socket based remote communication
  • Socket based Concurrency
  • State rollback (example)
  • Parsing terms & Retrival of lemmas (example)
  • Sledgehammer (example)
  • Retrivial of contextual information including assumptions, local facts, fixed terms, fixed types, and goals, in either the pretty-printed form or S expression (example).

Installation

We only support Isabelle2023 and Isabelle2024.

Ensuring <ISABELLE-BASE-DIRECTORY>/bin is in your $PATH environment

git clone https://github.com/xqyww123/Isa-REPL.git
cd Isa-REPL
git checkout $(isabelle version) # Error can raise if you are using an unsupported version of Isabelle
isabelle components -u .
pip install IsaREPL

Start up the REPL server

# merely an example:
./repl_server.sh 127.0.0.1:6666 HOL ./tmp -o threads=16
# Note, you must explicitly indicate the number of cpu cores that you want to use,
# otherwise, Isabelle only takes 8 core by default

Run ./repl_server.sh to see the full explanation of the arguments and options.

Example Clients

Every interface of our client is will documented (it is highly recommended to read our source). Some examples are given in the example folder.

# Run an example
./examples/example_eval.py 127.0.0.1:6666

To evaluate a whole theory file

./examples/eval_file.py 127.0.0.1:6666 $(isabelle getenv -b ISABELLE_HOME)/src/HOL/List.thy

Notes

Known Issues

The REPL server (or the Isabelle system) becomes unstable when the number of parallel threads exceeds 100. We suggest to launch multiple servers if your machine has more than 64 cpu cores, and give every server at most 64 cores by setting option -o threads=64

Documents

All documents are given as docstrings attaching to Python client interfaces, see the source.

Concurrency

This REPL supports concurrent evaluation of multiple files. However, to ensure proper error tracking and result tracing, it disables Isabelle's concurrency between commands within a single theory file. While Isabelle typically executes by commands asynchronously (continuing to the next command before completion), this REPL enforces synchronous evaluation. Each command must complete before the next begins, allowing for accurate capture and reporting of any failures.

Sledgehammer (via our auto_sledgehamemr wrapper, see example) is still concurrent.

Communication Protocol

It is possible to implement a client in other languages. However, the document for the communication protocol is not provided and I refer you to read our source code, as it should be simple enough.

Contribution

Feel free to open any GitHub issue if you have any feature requests.

I am not a professional python developer, so contribution is highly welcome to enrich the client's features.

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

isarepl-0.9.4.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

isarepl-0.9.4-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file isarepl-0.9.4.tar.gz.

File metadata

  • Download URL: isarepl-0.9.4.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for isarepl-0.9.4.tar.gz
Algorithm Hash digest
SHA256 8e644060456e5b3a2d2af3c5a9a51e8629911572c5a5ebd2bf9215433539d0f7
MD5 8b1cd19efdc545985f534bb0bc7c8726
BLAKE2b-256 f575281b4ed1b41374adb338f693a0e971ecff6b475b4c7896903d7d17dd6190

See more details on using hashes here.

File details

Details for the file isarepl-0.9.4-py3-none-any.whl.

File metadata

  • Download URL: isarepl-0.9.4-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for isarepl-0.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b893d79faea12081fa77f48fb7e9553fd91510f8c0d10cbf2fe4177192e12162
MD5 7720c2459ca2f836d7dd469180216c71
BLAKE2b-256 a39a9d7dad16965ea7e405642cbd8e9d4c313e4ffcccb325fcef40af834677d2

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