Skip to content

Commit ce23da4

Browse files
dstebilaclaude
andcommitted
Copy editing
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0a533f8 commit ce23da4

File tree

11 files changed

+56
-55
lines changed

11 files changed

+56
-55
lines changed

examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ The [`examples/joy_old`](https://github.com/ProofFrog/examples/tree/main/joy_old
192192

193193
## External Uses of ProofFrog
194194

195-
A list of external projects and papers using ProofFrog is maintained on the [external uses page]{% link researchers/external-uses.md %}.
195+
A list of external projects and papers using ProofFrog is maintained on the [external uses page]({% link researchers/external-uses.md %}).

manual/cli-reference.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The ProofFrog command-line interface (`proof_frog`) lets you parse, type-check,
3737
### Synopsis
3838

3939
```
40-
python -m proof_frog version [OPTIONS]
40+
proof_frog version [OPTIONS]
4141
```
4242

4343
### Behavior
@@ -48,7 +48,7 @@ Prints the installed ProofFrog version string to standard output and exits. The
4848

4949
```bash
5050
# Print the installed version
51-
python -m proof_frog version
51+
proof_frog version
5252
```
5353

5454
Expected output (version may differ):
@@ -64,7 +64,7 @@ ProofFrog 0.4.0
6464
### Synopsis
6565

6666
```
67-
python -m proof_frog parse [OPTIONS] FILE
67+
proof_frog parse [OPTIONS] FILE
6868
```
6969

7070
### Behavior
@@ -81,13 +81,13 @@ Parses any FrogLang source file (`.primitive`, `.scheme`, `.game`, or `.proof`)
8181

8282
```bash
8383
# Parse a primitive definition
84-
python -m proof_frog parse examples/Primitives/PRG.primitive
84+
proof_frog parse examples/Primitives/PRG.primitive
8585

8686
# Parse a scheme and get JSON output
87-
python -m proof_frog parse --json examples/joy/Schemes/SymEnc/OTP.scheme
87+
proof_frog parse --json examples/joy/Schemes/SymEnc/OTP.scheme
8888

8989
# Parse a proof file
90-
python -m proof_frog parse examples/joy/Proofs/Ch2/OTPSecure.proof
90+
proof_frog parse examples/joy/Proofs/Ch2/OTPSecure.proof
9191
```
9292

9393
### Common Errors
@@ -101,7 +101,7 @@ python -m proof_frog parse examples/joy/Proofs/Ch2/OTPSecure.proof
101101
### Synopsis
102102

103103
```
104-
python -m proof_frog check [OPTIONS] FILE
104+
proof_frog check [OPTIONS] FILE
105105
```
106106

107107
### Behavior
@@ -118,13 +118,13 @@ Type-checks and performs semantic analysis on any FrogLang file. This goes beyon
118118

119119
```bash
120120
# Type-check a symmetric encryption scheme
121-
python -m proof_frog check examples/joy/Schemes/SymEnc/OTP.scheme
121+
proof_frog check examples/joy/Schemes/SymEnc/OTP.scheme
122122

123123
# Type-check a primitive definition
124-
python -m proof_frog check examples/Primitives/SymEnc.primitive
124+
proof_frog check examples/Primitives/SymEnc.primitive
125125

126126
# Check a proof file and emit JSON diagnostics
127-
python -m proof_frog check --json examples/joy/Proofs/Ch2/OTPSecure.proof
127+
proof_frog check --json examples/joy/Proofs/Ch2/OTPSecure.proof
128128
```
129129

130130
### Common Errors
@@ -140,7 +140,7 @@ python -m proof_frog check --json examples/joy/Proofs/Ch2/OTPSecure.proof
140140
### Synopsis
141141

142142
```
143-
python -m proof_frog prove [OPTIONS] FILE
143+
proof_frog prove [OPTIONS] FILE
144144
```
145145

146146
### Behavior
@@ -168,16 +168,16 @@ Pass `-v` once to print the canonical game form after each hop, which is invalua
168168

169169
```bash
170170
# Verify the OTP security proof from Joy of Cryptography examples
171-
python -m proof_frog prove examples/joy/Proofs/Ch2/OTPSecure.proof
171+
proof_frog prove examples/joy/Proofs/Ch2/OTPSecure.proof
172172

173173
# Verbose: print canonical game forms at each hop
174-
python -m proof_frog prove -v examples/joy/Proofs/Ch2/OTPSecure.proof
174+
proof_frog prove -v examples/joy/Proofs/Ch2/OTPSecure.proof
175175

176176
# Very verbose: also show transformation rule firings
177-
python -m proof_frog prove -vv examples/joy/Proofs/Ch2/OTPSecure.proof
177+
proof_frog prove -vv examples/joy/Proofs/Ch2/OTPSecure.proof
178178

179179
# Verify a PRG security proof, skipping lemma re-verification
180-
python -m proof_frog prove --skip-lemmas examples/Proofs/PRG/CounterPRG_PRGSecurity.proof
180+
proof_frog prove --skip-lemmas examples/Proofs/PRG/CounterPRG_PRGSecurity.proof
181181
```
182182

183183
### Common Errors
@@ -195,7 +195,7 @@ python -m proof_frog prove --skip-lemmas examples/Proofs/PRG/CounterPRG_PRGSecur
195195
### Synopsis
196196

197197
```
198-
python -m proof_frog describe [OPTIONS] FILE
198+
proof_frog describe [OPTIONS] FILE
199199
```
200200

201201
### Behavior
@@ -212,13 +212,13 @@ Prints a concise, human-readable summary of any FrogLang file's interface — th
212212

213213
```bash
214214
# Describe a primitive
215-
python -m proof_frog describe examples/Primitives/PRG.primitive
215+
proof_frog describe examples/Primitives/PRG.primitive
216216

217217
# Describe a scheme
218-
python -m proof_frog describe examples/joy/Schemes/SymEnc/OTP.scheme
218+
proof_frog describe examples/joy/Schemes/SymEnc/OTP.scheme
219219

220220
# Describe with JSON output (useful for tooling)
221-
python -m proof_frog describe --json examples/Primitives/SymEnc.primitive
221+
proof_frog describe --json examples/Primitives/SymEnc.primitive
222222
```
223223

224224
---
@@ -228,7 +228,7 @@ python -m proof_frog describe --json examples/Primitives/SymEnc.primitive
228228
### Synopsis
229229

230230
```
231-
python -m proof_frog download-examples [OPTIONS] [DIRECTORY]
231+
proof_frog download-examples [OPTIONS] [DIRECTORY]
232232
```
233233

234234
### Behavior
@@ -246,16 +246,16 @@ Downloads the [ProofFrog examples repository](https://github.com/ProofFrog/examp
246246

247247
```bash
248248
# Download the examples matching your version of ProofFrog into an "examples" directory
249-
python -m proof_frog download-examples
249+
proof_frog download-examples
250250

251251
# Download into a custom directory
252-
python -m proof_frog download-examples my-examples
252+
proof_frog download-examples my-examples
253253

254254
# Download the latest main branch instead of the pinned version
255-
python -m proof_frog download-examples --ref main
255+
proof_frog download-examples --ref main
256256

257257
# Overwrite an existing examples directory
258-
python -m proof_frog download-examples --force
258+
proof_frog download-examples --force
259259
```
260260

261261
---
@@ -265,7 +265,7 @@ python -m proof_frog download-examples --force
265265
### Synopsis
266266

267267
```
268-
python -m proof_frog web [OPTIONS] [DIRECTORY]
268+
proof_frog web [OPTIONS] [DIRECTORY]
269269
```
270270

271271
### Behavior
@@ -279,13 +279,13 @@ The web interface provides the same verification engine as the CLI. It is partic
279279

280280
```bash
281281
# Start the editor using the current directory as the file root
282-
python -m proof_frog web
282+
proof_frog web
283283

284284
# Start the editor rooted at the bundled examples directory
285-
python -m proof_frog web examples/
285+
proof_frog web examples/
286286

287287
# Start the editor rooted at a specific project directory
288-
python -m proof_frog web /path/to/my/proofs
288+
proof_frog web /path/to/my/proofs
289289
```
290290

291291
---

manual/language-reference/execution-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The security model is **left/right indistinguishability**: a scheme is considere
3232

3333
## Game execution model
3434

35-
One execution of a game `G` with an adversary `A` proceeds in three stages:
35+
One execution of a game `G` with an adversary `A` proceeds in four stages:
3636

3737
1. **Field initialization.** All state fields are set up. Fields declared with an explicit initializer (`Type x = expr;`) are assigned the value of `expr`. Fields declared without an initializer (`Type x;`) are left in an undefined state until the first assignment.
3838

manual/limitations.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ polynomially many independent samples), that argument lives outside what ProofFr
5555
verifies.
5656

5757
**Recursive computation.** FrogLang methods cannot call themselves recursively, and
58-
there is no loop construct. The language is not Turing-complete. Proofs that require
59-
reasoning about an inductively defined sequence of games (for example, a hybrid argument
60-
over n independent challenges) must be structured using the `lemma:` mechanism to reason
61-
about a single step, with the inductive argument stated externally.
58+
loops are bounded (numeric `for` loops have a fixed range and generic `for` loops iterate
59+
over a finite collection; there is no general while loop or unbounded iteration). The
60+
language is not Turing-complete.
6261

6362
**Side channels.** Timing, power, cache, and other physical side-channel attacks are not
6463
modeled. All games are defined solely by the sequence of return values their oracles
@@ -233,6 +232,6 @@ If you encounter a case where the engine rejects a proof step that you believe i
233232
mathematically valid, please open an issue at
234233
[https://github.com/ProofFrog/ProofFrog/issues](https://github.com/ProofFrog/ProofFrog/issues).
235234
Include the smallest proof file that reproduces the problem, the full output of
236-
`python -m proof_frog prove -v <your-file.proof>` (which shows the canonical form of
235+
`proof_frog prove -v <your-file.proof>` (which shows the canonical form of
237236
each game and the point of failure), and a brief description of what you expected the
238237
engine to accept and why.

manual/troubleshooting.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ FrogLang does not allow.
134134
**Symptom:** `<file>:<line>: imported file not found: '<path>'`
135135

136136
**Likely cause:** The path in an `import` statement does not resolve to an
137-
existing file relative to the directory where the CLI was invoked.
137+
existing file relative to the importing file's directory.
138138

139139
**Fix:** Confirm the file exists at the given path and that the import is
140-
relative to the directory from which you are running `proof_frog`, not
141-
relative to the source file. Import paths in FrogLang are resolved from the
142-
working directory of the CLI invocation.
140+
relative to the directory containing the source file that has the `import`
141+
statement, not relative to the directory where the CLI is invoked. Import
142+
paths in FrogLang are resolved relative to the importing file's directory.
143143

144144
**See also:** [Language Reference: Basics]({% link manual/language-reference/basics.md %})
145145

manual/tutorial/otp-ots.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ nav_order: 2
99
# Tutorial Part 2 — One-time pad has one-time secrecy
1010
{: .no_toc }
1111

12-
In Tutorial Part 1, you ran an existing proof that that the one-time pad has one-time secrecy, broke it on purpose, and fixed it again. Now you will write that proof from scratch — all four files of it. By the end of this tutorial you will have defined a cryptographic primitive, a security game, a concrete scheme, and a game-hopping proof file, and you will have seen each one type-check or prove green as you finish it. We follow [Joy of Cryptography Section 2.5](https://joyofcryptography.com/provsec/#sec.abstract-defs) closely; if you have Rosulek's textbook handy, keep it open. Everything you write here is already in the `examples/joy/` directory, so you can always peek at the finished version if you get stuck.
12+
In Tutorial Part 1, you ran an existing proof that the one-time pad has one-time secrecy, broke it on purpose, and fixed it again. Now you will write that proof from scratch — all four files of it. By the end of this tutorial you will have defined a cryptographic primitive, a security game, a concrete scheme, and a game-hopping proof file, and you will have seen each one type-check or prove green as you finish it. We follow [Joy of Cryptography Section 2.5](https://joyofcryptography.com/provsec/#sec.abstract-defs) closely; if you have Rosulek's textbook handy, keep it open. Everything you write here is already in the `examples/joy/` directory, so you can always peek at the finished version if you get stuck.
1313

1414
{: .important }
1515
**Activate your virtual environment first.** Before running any `proof_frog` command in a fresh terminal, activate the Python virtual environment you created during [installation]({% link manual/installation.md %}): `source .venv/bin/activate` on macOS/Linux (bash/zsh), `source .venv/bin/activate.fish` on fish, or `.venv\Scripts\Activate.ps1` on Windows PowerShell. Your prompt should show `(.venv)` once it is active.
@@ -76,7 +76,7 @@ Primitives declare **method signatures only** — there are no method bodies her
7676
Two new language features appear here:
7777

7878
- `Message?` — the `?` suffix denotes a **nullable** (optional) type. In a symmetric encryption scheme, the decryption algorithm `Dec` returns either a `Message` or `None`; decryption is allowed to fail if the ciphertext is invalid. If we later create a scheme returning just plain `Message` where the primitive declared `Message?`, we will get a type mismatch that the engine will catch.
79-
- `deterministic` — this modifier on `Dec` tells the engine that `Dec` is a deterministic algorithm that always returns the same output for the same inputs. In general, algorithms in FrogLang are assumed to be probabilistics, unless explicitly declared to be deterministic. We will come back to why this matters in Step 4 when the proof engine uses it to justify certain algebraic simplifications.
79+
- `deterministic` — this modifier on `Dec` tells the engine that `Dec` is a deterministic algorithm that always returns the same output for the same inputs. In general, algorithms in FrogLang are assumed to be probabilistic, unless explicitly declared to be deterministic. We will come back to why this matters in Step 4 when the proof engine uses it to justify certain algebraic simplifications.
8080

8181
Finally, add a brace to close the block:
8282

@@ -407,7 +407,7 @@ Scheme OTP(Int lambda) extends SymEnc {
407407
Click **Type Check** in the web editor, or run:
408408
409409
```bash
410-
proof_frog OTP.scheme
410+
proof_frog check OTP.scheme
411411
```
412412
413413
Expected output:
@@ -569,15 +569,15 @@ Because `k` is sampled uniformly from `BitString<lambda>` and used exactly once
569569
570570
### Diving into the canonical forms
571571
572-
ProofFrog's engine works by trying to convert a game in to a "canonical form", by renaming variables to have standard names, removing unused statements, sorting the lines into a canonical order, and applying other mathematical and logical transformations. It then compares the canonical forms of the two games that are being checked for interchangeability.
572+
ProofFrog's engine works by trying to convert a game into a "canonical form", by renaming variables to have standard names, removing unused statements, sorting the lines into a canonical order, and applying other mathematical and logical transformations. It then compares the canonical forms of the two games that are being checked for interchangeability.
573573
574574
In the web editor, you can drill down into the canonical forms derived at each step. When you clicked "Run Proof" above, the Game Hop panel in the bottom left should have been updated to have one line highlighted in green: `OneTimeSecrecy(E).Random ✅`. Click on this green line, and you will see four different chunks of source code appear:
575575
576576
![Details of canonicalization of one hop of OTPSecure.proof](otpsecure-hopdetail.png){: .lightbox }
577577
578578
- Top left: The previous game (`OneTimeSecrecy(E).Real`), with the code of the one-time pad scheme `E` inlined. Notice that the variables from the OTP scheme have a prefix to avoid any collisions between variable names when inserted.
579579
- Middle left: The current game (`OneTimeSecrecy(E).Random`), with the code of the one-time pad scheme `E` inlined.
580-
- Top right: The canonicalized form of the previous game, `OneTimeSecrecy(E).Real`. Notice that the variable names have been replaced with canonical versions (`v1`) and that the engine has simplified the program by applyinh a mathematical identity it knows: that the XOR of a uniform random bit string with any bit string is equivalent to just sampling a uniform random bit string.
580+
- Top right: The canonicalized form of the previous game, `OneTimeSecrecy(E).Real`. Notice that the variable names have been replaced with canonical versions (`v1`) and that the engine has simplified the program by applying a mathematical identity it knows: that the XOR of a uniform random bit string with any bit string is equivalent to just sampling a uniform random bit string.
581581
- Bottom right: The canonicalized form of the current game, `OneTimeSecrecy(E).Random`. The canonicalization here is more obvious, and no extra transforms were applied.
582582
583583
As you can see, the two canonicalized forms are exactly the same: this is why ProofFrog concludes that the hop is valid.
@@ -593,7 +593,7 @@ If you really want to dive into the details of every transformation ProofFrog ap
593593
594594
**Proof Failed! Individual hops verified, but the proof is incomplete.** If the first and last game steps use the same side of the theorem (both `Real`, or both `Random`), the engine accepts all individual hops but reports that the overall sequence is incomplete. This is the error you saw in Tutorial Part 1 when you commented out the second game step. Make sure the sequence starts at `Real` and ends at `Random` (or vice versa).
595595
596-
**A hop fails.** If the engine cannot verify a hop as an equivalence, it will report which step failed and show a diagnostic. For a proof as small as this one, a failing hop usually means the scheme file has a typo — for example, `k * m` instead of `k + m` in `Enc`. See the [troubleshooting page]({ %link manual/troubleshooting.md %}) for a deeper guide to diagnosing failing steps.
596+
**A hop fails.** If the engine cannot verify a hop as an equivalence, it will report which step failed and show a diagnostic. For a proof as small as this one, a failing hop usually means the scheme file has a typo — for example, `k * m` instead of `k + m` in `Enc`. See the [troubleshooting page]({% link manual/troubleshooting.md %}) for a deeper guide to diagnosing failing steps.
597597
598598
---
599599

0 commit comments

Comments
 (0)