2024-04-11 12:37:58 -07:00
|
|
|
# PyPantograph
|
2024-04-19 16:47:35 -07:00
|
|
|
|
2024-10-01 10:57:21 -07:00
|
|
|
A Machine-to-Machine Interaction System for Lean 4.
|
2024-04-19 16:47:35 -07:00
|
|
|
|
2024-10-01 10:57:21 -07:00
|
|
|
## Installation
|
2024-04-29 12:23:28 -07:00
|
|
|
|
2024-10-01 10:57:21 -07:00
|
|
|
1. Install `poetry`
|
|
|
|
2. Clone this repository with submodules:
|
|
|
|
```sh
|
2024-10-17 08:44:48 -07:00
|
|
|
git clone --recurse-submodules <repo-path>
|
2024-04-19 16:47:35 -07:00
|
|
|
```
|
2024-10-01 10:57:21 -07:00
|
|
|
3. Install `elan` and `lake`: See [Lean Manual](https://docs.lean-lang.org/lean4/doc/setup.html)
|
|
|
|
4. Execute
|
|
|
|
```sh
|
|
|
|
poetry build
|
|
|
|
poetry install
|
2024-04-19 16:47:35 -07:00
|
|
|
```
|
|
|
|
|
2024-10-17 21:28:23 -07:00
|
|
|
## Documentation
|
|
|
|
|
|
|
|
Build the documentations by
|
|
|
|
```sh
|
|
|
|
jupyter-book build docs
|
|
|
|
```
|
|
|
|
Then serve
|
|
|
|
```sh
|
|
|
|
cd docs/_build/html
|
|
|
|
python3 -m http.server -d .
|
|
|
|
```
|
|
|
|
|
2024-07-01 12:18:00 -07:00
|
|
|
## Examples
|
|
|
|
|
2024-10-17 08:44:48 -07:00
|
|
|
For API interaction examples, see `examples/README.md`. The examples directory
|
|
|
|
also contains a comprehensive Jupyter notebook.
|
2024-09-13 18:18:16 -07:00
|
|
|
|
|
|
|
## Experiments
|
|
|
|
|
2024-10-01 11:06:01 -07:00
|
|
|
In `experiments/`, there are some experiments:
|
2024-10-17 08:44:48 -07:00
|
|
|
1. `minif2f` is an example of executing a `sglang` based prover on the miniF2F dataset
|
2024-10-01 11:06:01 -07:00
|
|
|
2. `dsp` is an Lean implementation of Draft-Sketch-Prove
|
2024-09-06 22:41:34 -07:00
|
|
|
|
2024-10-17 08:44:48 -07:00
|
|
|
The experiments should be run in `poetry shell`. The environment variable
|
|
|
|
`OPENAI_API_KEY` must be set when running experiments calling the OpenAI API.
|
2024-10-01 11:34:30 -07:00
|
|
|
|
2024-09-06 22:41:34 -07:00
|
|
|
## Referencing
|
|
|
|
|
2024-10-22 22:24:05 -07:00
|
|
|
[Paper Link](https://arxiv.org/abs/2410.16429)
|
|
|
|
|
2024-09-06 22:41:34 -07:00
|
|
|
```bib
|
|
|
|
@misc{pantograph,
|
2024-10-22 22:24:05 -07:00
|
|
|
title={Pantograph: A Machine-to-Machine Interaction Interface for Advanced Theorem Proving, High Level Reasoning, and Data Extraction in Lean 4},
|
|
|
|
author={Leni Aniva and Chuyue Sun and Brando Miranda and Clark Barrett and Sanmi Koyejo},
|
|
|
|
year={2024},
|
|
|
|
eprint={2410.16429},
|
|
|
|
archivePrefix={arXiv},
|
|
|
|
primaryClass={cs.LO},
|
|
|
|
url={https://arxiv.org/abs/2410.16429},
|
2024-09-06 22:41:34 -07:00
|
|
|
}
|
|
|
|
```
|