Skip to content

Commit 32a1e16

Browse files
coderabbitai[bot]hyperpolymath
authored andcommitted
docs(lean4): clarify filesystem no-op and snapshot restore docstrings
1 parent 9db426d commit 32a1e16

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎proofs/lean4/FilesystemCNO.lean‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ theorem create_unlink_is_cno (p : Path) (fs : Filesystem) (h : noFileAt p fs) :
202202
unfold createUnlinkOp
203203
exact create_unlink_inverse p fs h
204204

205-
/-- read followed by write. `noncomputable` — wraps axioms. -/
205+
/-- Write the content returned by `readFile` back to `p`, leaving the filesystem
206+
unchanged if `readFile` returns `none`. `noncomputable` — wraps axioms. -/
206207
noncomputable def readWriteOp (p : Path) : FsOp :=
207208
fun fs =>
208209
match readFile p fs with
@@ -218,7 +219,8 @@ theorem read_write_is_cno (p : Path) :
218219
| some content =>
219220
exact read_write_identity p fs content h
220221

221-
/-- chmod to current permissions. `noncomputable` — wraps axioms. -/
222+
/-- Set permissions at `p` to those returned by `stat`, leaving the filesystem
223+
unchanged if `stat` returns `none`. `noncomputable` — wraps axioms. -/
222224
noncomputable def chmodNopOp (p : Path) : FsOp :=
223225
fun fs =>
224226
match stat p fs with
@@ -323,6 +325,8 @@ axiom snapshot_restore_identity (fs : Filesystem) :
323325

324326
-- `noncomputable` because `restore` and `snapshot` are axioms with no
325327
-- executable body; without this Lean 4.16 refuses to emit code for `def`.
328+
/-- Restore a snapshot of the input filesystem onto that same filesystem.
329+
Returns the input filesystem by `snapshot_restore_identity`. -/
326330
noncomputable def snapshotRestoreOp : FsOp :=
327331
fun fs => restore (snapshot fs) fs
328332

0 commit comments

Comments
 (0)