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 bugs which doesn't let release work smoothly

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.1.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.1-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: itp_interface-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 204dd2fc382a5dd1a1bebe5ec9f6865ca8e9baf15d6b129e1876c6300539df83
MD5 cd4403a2f3530e4938c92cef2c6efafe
BLAKE2b-256 70e0cf1c6d9598fef3e23c7f9948f3063adf14b075a74f8aebc5062888dd6265

See more details on using hashes here.

File details

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

File metadata

  • Download URL: itp_interface-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b75c94b2237973660eafb39a2aec46591e48fa19798689d2887a3c33682add7
MD5 011621df58c156a29b5b4417ee93a35d
BLAKE2b-256 6bf8f2e7da91264f077048a9bb84549de418c0a2028008209f7a1fca13cc75d7

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