A Machine-to-Machine Interaction Interface for Lean 4
Go to file
Leni Aniva 75f14358cd
merge: branch 'dev' into frontend/refactor
2025-07-11 21:03:26 -07:00
Pantograph feat(frontend): Improve `InfoTree` printing 2025-07-11 20:00:05 -07:00
Test Merge pull request 'feat(frontend): Command-level `frontend.process`' (#229) from frontend/command into dev 2025-07-11 16:05:56 -07:00
doc doc: Wording 2025-07-11 21:02:51 -07:00
.gitignore doc: Remove outdated documentation 2024-12-05 17:18:35 -08:00
LICENSE doc: Change license to Apache2 2024-10-21 09:59:13 -07:00
Main.lean feat(repl): Flush stdout 2025-04-20 09:27:03 -07:00
Pantograph.lean feat: Environment pickling 2024-11-08 14:49:49 -08:00
README.md doc: Remove stale documentation 2025-07-11 20:09:54 -07:00
Repl.lean feat(frontend): Cancel token in frontend 2025-07-11 14:55:40 -07:00
Tomograph.lean fix(frontend): Tomograph fix 2025-07-11 16:24:30 -07:00
flake.lock build: Update flake 2025-07-11 16:30:28 -07:00
flake.nix build: Update flake 2025-07-11 16:30:28 -07:00
lake-manifest.json test: Update LSpec 2025-03-29 15:22:31 -07:00
lakefile.lean chore: Remove tomograph as default target 2025-07-11 16:27:14 -07:00
lean-toolchain chore: Update Lean to v4.21.0 2025-06-30 15:05:07 -07:00

README.md

Pantograph

A Machine-to-Machine interaction system for Lean 4.

Pantograph

Pantograph provides interfaces to execute proofs, construct expressions, and examine the symbol list of a Lean project for machine learning.

See documentations for design rationale and references.

Installation

For Nix users, run

nix build .#{sharedLib,executable}

to build either the shared library or executable.

For non-Nix users, install lake and lean fixed to the version of the lean-toolchain file, and run

lake build

This builds the executable in .lake/build/bin/repl.

Executable Usage

The default build target is a Read-Eval-Print-Loop (REPL). See REPL Documentation

Another executable is the tomograph, which processes a Lean file and displays syntax or elaboration level data.

Library Usage

Pantograph/Library.lean exposes a series of interfaces which allow FFI call with Pantograph which mirrors the REPL commands above. Note that there isn't a 1-1 correspondence between executable (REPL) commands and library functions.

Inject any project path via the pantograph_init_search function.

Development

A Lean development shell is provided in the Nix flake. Nix usage is optional.

Testing

The tests are based on LSpec. To run tests, use either

nix flake check

or

lake test

You can run an individual test by specifying a prefix

lake test -- "Tactic/No Confuse"