Giter Club home page Giter Club logo

leanrepl's Introduction

LeanREPL

A simple REPL environment for Lean 4 that also supports meta-commands (commands starting with "!").

The code in this repository was adapted from:

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:

.../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 <n> rolls the REPL back to the state it was n commands ago
  • !reset resets the REPL to the initial state
  • !quit exits the REPL

Example:

> 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

leanrepl's People

Contributors

arthurpaulino avatar patrickmassot avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.