Skip to main content

Generic interface for hooking up to any Interactive Theorem Prover (ITP) and collecting data for training ML models for AI in formal theorem proving.

Reason this release was yanked:

Has some bugs which can spoil installations

Project description

itp-interface

Generic interface for hooking up to any Interactive Theorem Prover (ITP) and collecting data for training ML models for AI in formal theorem proving.

Quick Setup for Lean 4:

  1. Install itp-interface using the following command:
pip install itp-interface
  1. Run the following command to prepare the REPL for Lean 4. (The default version is 4.7.0-rc2. You can change the version by setting the LEAN_VERSION environment variable. If no version is set, then 4.7.0-rc2 is used.)

NOTE: The Lean 4 version must match the version of the Lean 4 project you are working with.

export LEAN_VERSION="4.15.0"
install-lean-repl
  1. Run the following command to build the REPL for Lean 4. Make sure that lean --version returns the correct version before running the command below. If not then check if $HOME/.elan/bin is in your path. Recommended to run source $HOME/.elan/env before running the command below.
install-itp-interface

NOTE: These steps are only tested on Linux. For Windows, you can use WSL. These steps will not setup the Coq interface.

Full Setup for Coq and Lean:

  1. Install OCaml first. Use the instructions here: https://opam.ocaml.org/doc/Install.html . The opam version used in this project is 2.1.3 (OCaml 4.14.0). Note that OCaml officially only supports Linux installations. One can use WSL on Windows machines.

  2. Run the following to install Coq on Linux. The Coq version used in this project is <= 8.15.

sudo apt install build-essential unzip bubblewrap
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
  1. Add the following to your .bashrc file: (sometimes the path ~/.opam/default might not exist, so use the directory with version number present in the ~/.opam directory)
export PATH="/home/$USER/.opam/default/bin:$PATH"
  1. Create a Miniconda environment and activate it.

  2. Run the commands for installing the Lean 4 interface as mentioned in Quick Setup for Lean 4.

  3. Change to the project root directory, and run the setup script i.e. ./src/scripts/setup.sh from the root directory.

  4. Add the following to your .bashrc file for Lean:

export PATH="/home/$USER/.elan/bin:$PATH"

Generating Proof Step Data:

1.a. You need to run the following command to generate sample proof step data for Lean 4:

python src/itp_interface/main/run_tool.py --config-name simple_lean_data_gen

Check the simple_lean_data_gen.yaml configuration in the src/itp_interface/configs directory for more details. These config files are based on the hydra library (see here).

1.b. You need to run the following command to generate sample proof step data for Coq:

python src/itp_interface/main/run_tool.py --config-name simple_coq_data_gen

Check the simple_coq_data_gen.yaml configuration in the src/itp_interface/configs directory for more details about where the generated data is stored and where the different ITP (Coq and Lean) projects are located in the file system.

Important Note:

The ITP projects must be built before running proof step data generation. Make sure that the switch is set correctly while generating data for Coq projects because the Coq projects can be using different versions of Coq. Instructions for Coq project setup are listed in src/itp_interface/main/config/repo/coq_repos.yaml file.

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

itp_interface-1.0.0.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

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

itp_interface-1.0.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file itp_interface-1.0.0.tar.gz.

File metadata

  • Download URL: itp_interface-1.0.0.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for itp_interface-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f62b175ef03a4be0ce5ce02c00666dcec13ddf00edcaef193056a950e8ac2e3c
MD5 d0848b1acf30ead9939bd947e2f91d33
BLAKE2b-256 e7d1dd845cb4a78f19618a2a4261e35a87dd4645f98bbf2fbe6e46669f984863

See more details on using hashes here.

File details

Details for the file itp_interface-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: itp_interface-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for itp_interface-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a37441e1ad04e9f3d5cd8b6093355566aa1b020fc81a4d680af3462db2155ed
MD5 ee118f4374565ae5b9c7109894fa4483
BLAKE2b-256 04f4d9d5a96430ccbb272215324178b187ae9b72b323ed8d4ced8c4f8579ede1

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