A Machine-to-Machine Interaction Interface for Lean 4
Find a file
2025-08-26 13:53:42 -07:00
doc doc: Add style guide 2025-08-18 23:54:13 -07:00
Pantograph Merge branch 'dev' into serial/sharecommon 2025-08-26 16:52:59 -04:00
Test refactor: Use Name in GoalStart 2025-08-26 16:38:56 -04:00
.gitignore doc: Remove outdated documentation 2024-12-05 17:18:35 -08:00
flake.lock build: Use upstream nix output directly 2025-08-16 18:28:33 -07:00
flake.nix chore: Remove lean from flake output 2025-08-16 18:29:15 -07:00
lake-manifest.json chore(test): Update LSpec 2025-08-08 21:31:25 -07:00
lakefile.lean chore(test): Update LSpec 2025-08-08 21:31:25 -07:00
lean-toolchain chore: Update Lean to v4.22.0 2025-08-13 20:56:53 -07:00
LICENSE doc: Change license to Apache2 2024-10-21 09:59:13 -07:00
Main.lean chore: Code cleanup 2025-08-18 23:52:41 -07:00
Pantograph.lean feat: Environment pickling 2024-11-08 14:49:49 -08:00
README.md doc: Add contributing 2025-07-30 11:54:19 -07:00
Repl.lean refactor: Use Name in GoalStart 2025-08-26 16:38:56 -04:00
Tomograph.lean feat(frontend): Use delaborator to refactor 2025-07-21 22:24:47 -07:00

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

See Contributing.