Skip to content

Commit 124926a

Browse files
committed
update readme
1 parent 8e88e86 commit 124926a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ Commands may be of the form
2020
{ "cmd" : "example : f = 2 := rfl", "env" : 1 }
2121
```
2222

23+
```json
24+
{ "cmd" : "example : f = 2 := rfl", "env" : 1, "gc": true }
25+
```
26+
27+
The input includes:
28+
* A required `cmd` field containing the Lean command to execute
29+
* An optional `env` field specifying a previous environment ID to build upon
30+
* An optional `gc` field (default: false) to discard the environment after execution
31+
* Optional fields for additional information:
32+
* `allTactics`: when true, includes all tactic steps in the response
33+
* `rootGoals`: when true, includes root goals as sorries
34+
* `infotree`: specifies the level of info tree detail ("full", "tactics", "original", or "substantive")
35+
2336
The `env` field, if present,
2437
must contain a number received in the `env` field of a previous response,
2538
and causes the command to be run in the existing environment.

REPL/JSON.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ structure CommandOptions where
2323
/-- Run Lean commands.
2424
If `env = none`, starts a new session (in which you can use `import`).
2525
If `env = some n`, builds on the existing environment `n`.
26+
Setting `gc = true` will discard the environment after execution, useful for memory management.
27+
When `gc = true`, the response's `env` field will be `none`.
2628
-/
2729
structure Command extends CommandOptions where
2830
env : Option Nat

0 commit comments

Comments
 (0)