Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arthurpaulino/leanrepl
https://github.com/arthurpaulino/leanrepl
lean lean4
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/arthurpaulino/leanrepl
- Owner: arthurpaulino
- License: apache-2.0
- Created: 2022-01-17T03:02:35.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-01T20:38:28.000Z (over 2 years ago)
- Last Synced: 2024-11-29T14:40:37.022Z (23 days ago)
- Topics: lean, lean4
- Language: Lean
- Homepage:
- Size: 12.7 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LeanREPL
A simple REPL environment for Lean 4 that also supports meta-commands
(commands starting with "!").The code in this repository was adapted from:
* [`dselsam/lean-gym`](https://github.com/dselsam/lean-gym)
* [`abentkamp/hoare-logic`](https://github.com/abentkamp/hoare-logic)## Usage
Run `.../LeanREPL$ lake build` and an executable file will be created under
`build/bin`.Then you can run it and pass the initial imported modules. `Init` is already
added by default. Example:```bash
.../LeanREPL$ ./build/bin/LeanREPL Std
```## Meta-commands
Meta-commands are just commands that start with "!" and allow extra control
of the REPL. The ones available are:* `!rb ` rolls the REPL back to the state it was `n` commands ago
* `!reset` resets the REPL to the initial state
* `!quit` exits the REPLExample:
```lean
> def a := 1
> def a := 2 -- causes an error and doesn't stack a new state
repl:1:4: error: 'a' has already been declared
> def b := 2
> def c := 3
> !rb 2 -- undoes the definitions of `b` and `c`
> #check a
a : Nat
> #check b
repl:1:7: error: unknown identifier 'b'
> #check c
repl:1:7: error: unknown identifier 'c'
> !reset -- undoes all definitions
> #check a
repl:1:7: error: unknown identifier 'a'
> !quit
```