Skip to content

Commit 3242978

Browse files
authored
chore: bump to Lean v4.31.0 (#534)
1 parent 979a638 commit 3242978

8 files changed

Lines changed: 30 additions & 16 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ The documentation is very much work in progress but the links below should be up
3737

3838
Contributions to `lean4game` are always welcome!
3939

40+
Check out the [Development Instructions](./doc/development.md)
41+
4042
### Translation
4143

42-
We welcome translations of the game interface and of the various games hosted on the [Lean Game Server](https://adam.math.hhu.de) into different languages!
44+
We welcome translations of the game interface and of the various games hosted on the [Lean Game Server](https://adam.math.hhu.de) into different languages!
4345

44-
* For translating the *interface*, please refer to [these instructions](doc/translation-interface.md).
46+
* For translating the *interface*, please refer to [these instructions](doc/translation-interface.md).
4547
* For translating *individual games*, please contact the maintainers (see [table below](#contact)) and consult any game specific translation guidelines. Our [generic guidlines](doc/translation-guide-for-game-translators.md) may give a rough indication of the steps involved.
4648
* We also have some [guidelines for game maintainers](doc/translation-guide-for-game-maintainers.md) regarding translations.
4749

doc/development.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Development
2+
3+
## Updating Lean version
4+
5+
1. make sure `lean-i18n` has been updated
6+
1. edit `server/lean-toolchain` to contain the desired version: `leanprover/lean4:v4.31.0`
7+
2. edit all `require` statements in `server/lakefile.lean` to contain the toolchain (e.g. `"v4.31.0"`) instead of `"main"`
8+
3. call `lake update --keep-toolchain`
9+
4. undo the changes in `server/lakefile.lean`
10+
5. `npm run build:server`

server/GameServer/Hints.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ instance : Repr GoalHintEntry := {
3232
TODO: explain better. -/
3333
unsafe def evalHintMessageUnsafe : Expr → MetaM (Array Expr → MessageData) :=
3434
evalExpr (Array Expr → MessageData)
35-
(.forallE default (mkApp (mkConst ``Array [levelZero]) (mkConst ``Expr))
35+
(.forallE default (mkApp (mkConst ``Array [Level.zero]) (mkConst ``Expr))
3636
(mkConst ``MessageData) .default)
3737

3838
@[implemented_by evalHintMessageUnsafe]

server/GameServer/RpcHandlers.lean

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ def getProofState (p : ProofStateParams) : RequestM (RequestTask (Option ProofSt
213213
bindTaskCostly doc.cmdSnaps.waitAll fun (snaps, _) => do
214214
mapTaskCostly doc.reporter fun () => do
215215
let mut steps : Array <| InteractiveGoalsWithHints := #[]
216-
let mut diag : Array InteractiveDiagnostic ← doc.diagnosticsRef.get
216+
217+
let mut diag : Array InteractiveDiagnostic ← doc.diagnosticsMutex.atomically do
218+
let ds ← get
219+
let stickyDiags ← ds.stickyDiagsRef.get
220+
let diags := ds.diags
221+
return stickyDiags ++ diags |>.toArray
217222

218223
-- Level is completed if there are no errors or warnings
219224
let completedWithWarnings : Bool := ¬ diag.any (·.severity? == some .error)

server/GameServer/Tactic/Hint.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ elab (name := Hint) "Hint" args:hintArg* msg:interpolatedStr(term) : tactic => d
4242
-- want the text to possibly contain quotation of the local variables which might have been
4343
-- named differently by the player.
4444
let varsName := `vars
45-
let text ← withLocalDeclD varsName (mkApp (mkConst ``Array [levelZero]) (mkConst ``Expr)) fun vars => do
45+
let text ← withLocalDeclD varsName (mkApp (mkConst ``Array [Level.zero]) (mkConst ``Expr)) fun vars => do
4646
let mut text ← `(m! $msg)
4747
let goalDecl ← goal.getDecl
4848
let decls := goalDecl.lctx.decls.toArray.filterMap id

server/lake-manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "hhu-adam",
8-
"rev": "084ba4a951815d4757eb13656231a9b405e73bcc",
8+
"rev": "1a99b00a940624c0a6c3009b756fb922acf0fe78",
99
"name": "i18n",
1010
"manifestFile": "lake-manifest.json",
11-
"inputRev": "main",
11+
"inputRev": "v4.31.0",
1212
"inherited": false,
1313
"configFile": "lakefile.lean"},
1414
{"url": "https://github.com/leanprover-community/batteries",
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "leanprover-community",
18-
"rev": "4ee56e687ce2b9b51b097bfa65947a499da0c453",
18+
"rev": "fa08db58b30eb033edcdab331bba000827f9f785",
1919
"name": "batteries",
2020
"manifestFile": "lake-manifest.json",
2121
"inputRev": "main",
22-
"inherited": false,
22+
"inherited": true,
2323
"configFile": "lakefile.toml"},
2424
{"url": "https://github.com/leanprover/lean4-cli",
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "leanprover",
28-
"rev": "13567aed1ac4f12aea9484178e07e51f8c9f7658",
28+
"rev": "92564e5770e4d09f2d86dfbf8ada1e9c715b384c",
2929
"name": "Cli",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",

server/lakefile.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ open Lake DSL
33

44
package GameServer
55

6-
-- Using this assumes that each dependency has a tag of the form `v4.X.0`.
7-
def leanVersion : String := s!"v{Lean.versionString}"
8-
9-
require "leanprover-community" / batteries @ git "main"
10-
require "hhu-adam" / i18n @ git "main"
6+
require "leanprover-community" / batteries @ git "v4.31.0"
7+
require "hhu-adam" / i18n @ git "v4.31.0"
118

129
-- dev dependency
1310
-- require "leanprover-community" / importGraph @ git "main"

server/lean-toolchain

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

0 commit comments

Comments
 (0)