Skip to content

Commit bdb58d1

Browse files
committed
Bump deps
1 parent 024eb85 commit bdb58d1

5 files changed

Lines changed: 50 additions & 51 deletions

File tree

BookGenMain.lean

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,66 @@ open Lean Elab Term Command in
2525
/--
2626
Extract the marked exercises and example code.
2727
-/
28-
partial def buildExercises (mode : Mode) (logError : String → IO Unit) (cfg : Config) (_state : TraverseState) (text : Part Manual) : IO Unit := do
28+
partial def buildExercises (mode : Mode) (cfg : Config) (_state : TraverseState) (text : Part Manual) : BuildLogT IO Unit := do
2929
let .multi := mode
3030
| pure ()
31-
let code := (← part text |>.run {}).snd
32-
let dest := cfg.destination / "example-code"
33-
let some mainDir := mainFileName.parent
34-
| throw <| IO.userError "Can't find directory of `BookGenMain.lean`"
35-
36-
IO.FS.createDirAll <| dest
37-
for ⟨fn, f⟩ in code do
38-
-- Make sure the path is relative to that of this one
39-
if let some fn' := fn.dropPrefix? mainDir.toString then
40-
let fn' := (fn'.dropWhile (· ∈ System.FilePath.pathSeparators)).copy
41-
let fn := dest / fn'
42-
fn.parent.forM IO.FS.createDirAll
43-
if (← fn.pathExists) then IO.FS.removeFile fn
44-
IO.FS.writeFile fn f
45-
else
46-
logError s!"Couldn't save example code. The path '{fn}' is not underneath '{mainDir}'."
31+
let logger ← readThe (Logger IO)
32+
saveExampleCode logger cfg text
4733

4834
where
49-
part : Part Manual → StateT (HashMap String String) IO Unit
35+
saveExampleCode (logger : Verso.Logger IO) (cfg : Config) (text : Part Manual) : IO Unit := do
36+
let code := (← part logger text |>.run {}).snd
37+
let dest := cfg.destination / "example-code"
38+
let some mainDir := mainFileName.parent
39+
| throw <| IO.userError "Can't find directory of `BookGenMain.lean`"
40+
41+
IO.FS.createDirAll <| dest
42+
for ⟨fn, f⟩ in code do
43+
-- Make sure the path is relative to that of this one
44+
if let some fn' := fn.dropPrefix? mainDir.toString then
45+
let fn' := fn'.toString.dropWhile (· ∈ System.FilePath.pathSeparators : Char → Bool)
46+
let fn := dest / fn'.copy
47+
fn.parent.forM IO.FS.createDirAll
48+
if (← fn.pathExists) then IO.FS.removeFile fn
49+
IO.FS.writeFile fn f
50+
else
51+
logger.reportError s!"Couldn't save example code. The path '{fn}' is not underneath '{mainDir}'."
52+
part (logger : Verso.Logger IO) : Part Manual → StateT (HashMap String String) IO Unit
5053
| .mk _ _ _ intro subParts => do
51-
for b in intro do block b
52-
for p in subParts do part p
53-
block : Block Manual → StateT (HashMap String String) IO Unit
54+
for b in intro do block logger b
55+
for p in subParts do part logger p
56+
block (logger : Verso.Logger IO) : Block Manual → StateT (HashMap String String) IO Unit
5457
| .other which contents => do
5558
if which.name == ``Block.savedLean then
5659
let .arr #[.str fn, .str code] := which.data
57-
| logError s!"Failed to deserialize saved Lean data {which.data}"
60+
| logger.reportError s!"Failed to deserialize saved Lean data {which.data}"
5861
modify fun saved =>
59-
saved.alter fn fun prior =>
60-
let prior := prior.getD ""
61-
some (prior ++ code ++ "\n")
62+
let prior := saved[fn]?.getD ""
63+
saved.insert fn (prior ++ code ++ "\n")
6264

6365
if which.name == ``Block.savedImport then
6466
let .arr #[.str fn, .str code] := which.data
65-
| logError s!"Failed to deserialize saved Lean import data {which.data}"
67+
| logger.reportError s!"Failed to deserialize saved Lean import data {which.data}"
6668
modify fun saved =>
67-
saved.alter fn fun prior =>
68-
let prior := prior.getD ""
69-
some (code.trimAsciiEnd.copy ++ "\n" ++ prior)
69+
let prior := saved[fn]?.getD ""
70+
saved.insert fn (code.trimAsciiEnd.copy ++ "\n" ++ prior)
7071

71-
for b in contents do block b
72+
for b in contents do block logger b
7273
| .concat bs | .blockquote bs =>
73-
for b in bs do block b
74+
for b in bs do block logger b
7475
| .ol _ lis | .ul lis =>
7576
for li in lis do
76-
for b in li.contents do block b
77+
for b in li.contents do block logger b
7778
| .dl dis =>
7879
for di in dis do
79-
for b in di.desc do block b
80+
for b in di.desc do block logger b
8081
| .para .. | .code .. => pure ()
8182

8283

8384
def config : RenderConfig where
8485
emitTeX := false
8586
emitHtmlSingle := .no
8687
emitHtmlMulti := .immediately
87-
htmlDepth := 2
88+
htmlDepth := 1
8889

8990
def main := manualMain (%doc IrisTutorialBook) (extraSteps := [buildExercises]) (config := config)

IrisTutorial/LinkedLists.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ theorem reverse_append_spec (l acc : Val) (xs ys : List Val) (Φ : Val → IProp
216216
itrivial
217217
iapply IH $$ Hl Hnode
218218
iintro %v Hv
219-
wp_finish
220219
simp only [List.reverse_cons, List.append_assoc, List.cons_append, List.nil_append]
221220
iapply HΦ $$ Hv
222221
```
@@ -239,7 +238,6 @@ theorem reverse_spec (l : Val) (xs : List Val) (Φ : Val → IProp GF) :
239238
itrivial
240239
iapply reverse_append_spec $$ Hl Hacc
241240
iintro %v Hv
242-
wp_finish
243241
simp only [List.append_nil]
244242
iapply HΦ $$ Hv
245243
```

lake-manifest.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,47 @@
55
"type": "git",
66
"subDir": "Iris",
77
"scope": "",
8-
"rev": "b7161660991216899f212eb33a9da47418655404",
8+
"rev": "5a790aed0dcad30219aa218c88a7fd306c092fae",
99
"name": "iris",
1010
"manifestFile": "lake-manifest.json",
11-
"inputRev": "b7161660991216899f212eb33a9da47418655404",
11+
"inputRev": "5a790aed0dcad30219aa218c88a7fd306c092fae",
1212
"inherited": false,
1313
"configFile": "lakefile.toml"},
1414
{"url": "https://github.com/leanprover/verso",
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "",
18-
"rev": "8bcbd2b8723307c329c12997a0c16a6ac174d3e9",
18+
"rev": "b677415e8a0becccc0b850137c2d8f6205132a91",
1919
"name": "verso",
2020
"manifestFile": "lake-manifest.json",
21-
"inputRev": "v4.30.0",
21+
"inputRev": "v4.31.0",
2222
"inherited": false,
2323
"configFile": "lakefile.lean"},
2424
{"url": "https://github.com/leanprover-community/batteries",
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "leanprover-community",
28-
"rev": "32dc18cde3684679f3c003de608743b57498c56f",
28+
"rev": "fa08db58b30eb033edcdab331bba000827f9f785",
2929
"name": "batteries",
3030
"manifestFile": "lake-manifest.json",
31-
"inputRev": "v4.30.0",
31+
"inputRev": "v4.31.0",
3232
"inherited": true,
3333
"configFile": "lakefile.toml"},
3434
{"url": "https://github.com/leanprover-community/quote4",
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "leanprover-community",
38-
"rev": "a6e6c34c4ef182f83b219a3a5a385f51f44bdc4c",
38+
"rev": "f46324995fca5f0483b742e4eb4daec7f4ee50d2",
3939
"name": "Qq",
4040
"manifestFile": "lake-manifest.json",
41-
"inputRev": "v4.30.0",
41+
"inputRev": "v4.31.0",
4242
"inherited": true,
4343
"configFile": "lakefile.toml"},
4444
{"url": "https://github.com/leanprover/illuminate",
4545
"type": "git",
4646
"subDir": null,
4747
"scope": "",
48-
"rev": "99ada816d9929a51132d5b5dc4f43c51f16d67d8",
48+
"rev": "20b8493528eed2fac9827ce18d41c475f0e1c50a",
4949
"name": "illuminate",
5050
"manifestFile": "lake-manifest.json",
5151
"inputRev": "main",
@@ -55,7 +55,7 @@
5555
"type": "git",
5656
"subDir": null,
5757
"scope": "",
58-
"rev": "a456461b368b71d2accd95234832cd9c174b5437",
58+
"rev": "63045536fe95024e6c18fc7b48e03f506701c5bc",
5959
"name": "plausible",
6060
"manifestFile": "lake-manifest.json",
6161
"inputRev": "main",
@@ -75,7 +75,7 @@
7575
"type": "git",
7676
"subDir": null,
7777
"scope": "",
78-
"rev": "ce893b9042128037e2d3c0158b9567fab9fae268",
78+
"rev": "0bd508e8362f56d4a05cbf63614d4c97db954041",
7979
"name": "subverso",
8080
"manifestFile": "lake-manifest.json",
8181
"inputRev": "main",

lakefile.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ defaultTargets = ["textbook"]
88
[[require]]
99
name = "verso"
1010
git = "https://github.com/leanprover/verso"
11-
rev = "v4.30.0"
11+
rev = "v4.31.0"
1212

1313
# iris-lean has no v4.30.0 release tag, so we pin to an exact commit that
14-
# is compatible with the Lean toolchain in `lean-toolchain` (leanprover/lean4:4.30.0).
14+
# is compatible with the Lean toolchain in `lean-toolchain` (leanprover/lean4:4.31.0).
1515
[[require]]
1616
name = "iris"
1717
git = "https://github.com/leanprover-community/iris-lean.git"
1818
subDir = "Iris"
19-
rev = "b7161660991216899f212eb33a9da47418655404"
19+
rev = "5a790aed0dcad30219aa218c88a7fd306c092fae"
2020

2121
# Book generation machinery inherited from the Verso textbook template
2222
# (savedLean/savedImport elaborators, bibliography helpers). No root module

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:4.30.0
1+
leanprover/lean4:v4.31.0

0 commit comments

Comments
 (0)