Skip to content

Commit 7f13cec

Browse files
committed
[llm] update CLAUDE.md with current workflow status
Add two workflow sections that were missing or stale: 4. Inspect and navigate nested subgoals with TREE and FOCUS Documents the dotted-path syntax (FOCUS 1.2.3), the [focus: k/N] reply tag, and the fact that TREE labels are dynamic (focus-first, not stable across focus changes). 5. Build a +strict_bullets-friendly proof with COMMIT Documents how COMMIT replays the recorded transcript and inserts bullets, plus the cycle (-, +, *, --, ++, **, ...) and the prior- bullet collision avoidance. Re-number the existing QUIET and SEARCH sections from 4/5 to 6/7. Fix one outdated pitfall ("subgoals must be closed in order") -- FOCUS path now lets the agent address them in any order. Reflects what's live in EcLlm; the protocol/meta-command table was already up to date.
1 parent 9d46ad0 commit 7f13cec

1 file changed

Lines changed: 68 additions & 4 deletions

File tree

doc/llm/CLAUDE.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,69 @@ REVERT before_split
177177
apply H. ← try a different approach
178178
```
179179

180-
**4. Use QUIET mode to save tokens during bulk tactic application:**
180+
**4. Inspect and navigate nested subgoals with `TREE` and `FOCUS`:**
181+
182+
When a tactic opens multiple subgoals, the engine focuses the first
183+
one. By default subsequent tactics act on it; siblings wait their
184+
turn. Use `TREE` to see the structure, including nested splits:
185+
186+
```
187+
TREE
188+
→ OK [uuid:N]
189+
[1.1.1] x = 0 <- focused
190+
[1.1.2] y = 1
191+
[1.2] z = 2
192+
[2] w = 3
193+
<END>
194+
```
195+
196+
The labels are dotted paths. `FOCUS P` rotates focus to the leaf at
197+
path `P`:
198+
199+
```
200+
FOCUS 1.2 ← work on `z = 2`
201+
FOCUS 2 ← work on `w = 3`
202+
FOCUS 1.1.1 ← back to `x = 0`
203+
```
204+
205+
`FOCUS k` (a single integer) targets the k-th open goal in the flat
206+
listing. `NEXT` is shorthand for `FOCUS 2`. Selecting an internal
207+
frame errors (`FOCUS: path must select a leaf goal, not a frame`).
208+
209+
Replies carry a `[focus: k/N]` tag when more than one goal is open
210+
(e.g. `OK [uuid:42] [focus: 1/3]`) so you always know which goal the
211+
next tactic will hit. **TREE labels are not stable across focus
212+
changes**`FOCUS 1.2` from one state may name a different goal in
213+
another, because the tree always shows the focused goal first.
214+
215+
**5. Build a `+strict_bullets`-friendly proof with `COMMIT`:**
216+
217+
The REPL records every successful interactive phrase. `COMMIT` walks
218+
the proof DAG and emits the recorded tactics with bullets inserted
219+
at every multi-child split. The output is a proof body that compiles
220+
under `pragma +strict_bullets`:
221+
222+
```
223+
LOAD "myfile.ec" 42
224+
split.
225+
- rewrite H. trivial. ← REPL accepts the unbulleted form
226+
- exact hq.
227+
COMMIT
228+
→ OK [uuid:N]
229+
split.
230+
- rewrite H. trivial.
231+
- exact hq.
232+
<END>
233+
```
234+
235+
Bullet characters cycle through `-`, `+`, `*`, `--`, `++`, `**`, ...
236+
and are chosen to avoid colliding with any frames the LOAD prefix
237+
already opened. Use `COMMIT` once the proof is complete (or at any
238+
checkpoint) and paste the result back into the source file.
239+
240+
`UNDO` / `REVERT` trim the COMMIT transcript automatically.
241+
242+
**6. Use QUIET mode to save tokens during bulk tactic application:**
181243

182244
```
183245
QUIET ON
@@ -188,7 +250,7 @@ QUIET OFF
188250
GOALS
189251
```
190252

191-
**5. Search for lemmas using patterns:**
253+
**7. Search for lemmas using patterns:**
192254

193255
EasyCrypt `search` uses pattern syntax, not keywords. Use `_` as
194256
wildcard:
@@ -267,8 +329,10 @@ SEARCH (_ %/ _)
267329
- `by` closes **all** remaining subgoals. If it fails, the error
268330
refers to the first unclosed goal, which may not be the intended
269331
one.
270-
- When a tactic generates multiple subgoals, each subgoal must be
271-
closed in order. Use `GOALS ALL` or `TREE` to see them all.
332+
- When a tactic generates multiple subgoals, the engine focuses the
333+
first one. Address them in any order via `FOCUS path`, or in the
334+
default order by closing each in turn. Use `TREE` or `GOALS ALL`
335+
to see what's open.
272336
- When more than one subgoal is open, replies carry a
273337
`[focus: k/N]` tag (e.g. `OK [uuid:42] [focus: 1/3]`) so you know
274338
which one the next tactic will hit.

0 commit comments

Comments
 (0)