Skip to content

Commit 8ac6c30

Browse files
committed
Add goal printing flags (-upto, -lastgoals) and LLM agent guide
Add two new flags for the `easycrypt` CLI to support LLM coding agents: - `-upto <pos>`: compile up to a given position and print goals there - `-lastgoals`: print the last unproven goals Also add a dedicated `llm` command mode and an LLM agent guide (doc/llm/CLAUDE.md) documenting EasyCrypt tactics and workflow for use with AI coding assistants.
1 parent 70f8dfc commit 8ac6c30

4 files changed

Lines changed: 13 additions & 170 deletions

File tree

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ EasyCrypt is part of the [Formosa Crypto project](https://formosa-crypto.org/).
2626
- [Visual Studio Code](#visual-studio-code)
2727
- [Useful Resources](#useful-resources)
2828
- [Examples](#examples)
29-
- [LaTeX Formatting](#latex-formatting)
3029

3130
# Installation
3231

@@ -186,10 +185,3 @@ Examples of how to use EasyCrypt are in the `examples` directory. You
186185
will find basic examples at the root of this directory, as well as a
187186
more advanced example in the `MEE-CBC` sub-directory and a tutorial on
188187
how to use the complexity system in `cost` sub-directory.
189-
190-
## LaTeX Formatting
191-
192-
LaTeX style file is in `assets/latex` directory. The basic usages are
193-
`\begin{eclst} ... \end{eclst}` (display mode) and
194-
`\ecinl{proc main() = { ... }}` (inline mode).
195-

assets/latex/eclistings.sty

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/phl/ecPhlLoopTx.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ let process_unroll_for ~cfold side cpos tc =
254254
e
255255

256256
| _ -> tc_error !!tc
257-
"last instruction of the while loop must be \
258-
an \"increment\" of the loop counter" in
257+
"last instruction of the while loop must be"
258+
"an \"increment\" of the loop counter" in
259259

260260
(* Apply loop increment *)
261261
let incrz =

theories/algebra/Perms.ec

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ require import AllCore List IntDiv Binomial Ring StdOrder.
33
(*---*) import IntID IntOrder.
44

55
(* -------------------------------------------------------------------- *)
6-
op allperms_r (n : unit list) (s : 'a list) : 'a list list =
7-
with n = [] => [[]]
8-
with n = x::n => flatten (
6+
op allperms_r (n : unit list) (s : 'a list) : 'a list list.
7+
8+
axiom allperms_r0 (s : 'a list) :
9+
allperms_r [] s = [[]].
10+
11+
axiom allperms_rS (x : unit) (n : unit list) (s : 'a list) :
12+
allperms_r (x :: n) s = flatten (
913
map (fun x => map ((::) x) (allperms_r n (rem x s))) (undup s)).
1014

1115
op allperms (s : 'a list) = allperms_r (nseq (size s) tt) s.
1216
17+
hint rewrite ap_r : allperms_r0 allperms_rS.
18+
1319
(* -------------------------------------------------------------------- *)
1420
lemma allperms_rP n (s t : 'a list) : size s = size n =>
1521
(mem (allperms_r n s) t) <=> (perm_eq s t).
@@ -45,7 +51,7 @@ qed.
4551
(* -------------------------------------------------------------------- *)
4652
lemma uniq_allperms_r n (s : 'a list) : uniq (allperms_r n s).
4753
proof.
48-
elim: n s => [|? n ih] s; rewrite ?ap_r //=.
54+
elim: n s => [|? n ih] s; rewrite ?ap_r //.
4955
apply/uniq_flatten_map/undup_uniq.
5056
by move=> x /=; apply/map_inj_in_uniq/ih => a b _ _ [].
5157
move=> x y; rewrite !mem_undup => sx sy /= /hasP[t].
@@ -73,7 +79,7 @@ require import StdBigop.
7379
lemma size_allperms_uniq_r n (s : 'a list) : size s = size n => uniq s =>
7480
size (allperms_r n s) = fact (size s).
7581
proof.
76-
elim: n s => /= [s|n ih s].
82+
elim: n s => /= [|? n ih] s; rewrite ?ap_r /=.
7783
by move/size_eq0=> -> /=; rewrite fact0.
7884
case: s=> [|x s]; first by rewrite addz_neq0 ?size_ge0.
7985
(pose s' := undup _)=> /=; move/addrI=> eq_sz [Nsz uqs].

0 commit comments

Comments
 (0)