Skip to content

Commit cbfd864

Browse files
david-christiansenVierkantor
authored andcommitted
chore: bump to nightly-2025-05-20 (#444)
1 parent b91190c commit cbfd864

File tree

14 files changed

+57
-158
lines changed

14 files changed

+57
-158
lines changed

Manual/Elaboration.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ example (b : B) : ⟨b.1, b.2⟩ = b := rfl
185185
error: type mismatch
186186
rfl
187187
has type
188-
?m.736 = ?m.736 : Prop
188+
?m.744 = ?m.744 : Prop
189189
but is expected to have type
190190
e1 = e2 : Prop
191191
-/

Manual/Intro.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ declaration uses 'sorry'
9999

100100
Error messages are shown like this:
101101
```leanOutput output (severity := error)
102-
Application type mismatch: In the appplication
102+
Application type mismatch: In the application
103103
Nat.succ "two"
104-
the final argument
104+
the argument
105105
"two"
106106
has type
107107
String : Type

Manual/Language/InductiveTypes.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,14 @@ inductive Either' (α : Type u) (β : Type v) : Type (max u v) where
264264
| right : β → Either' α β
265265
```
266266
```leanOutput Either'
267-
inductive datatype parameter mismatch
267+
Mismatched inductive type parameter in
268+
Either' α β
269+
The provided argument
268270
α
269-
expected
271+
is not definitionally equal to the expected parameter
270272
α✝
273+
274+
Note: The value of parameter 'α✝' must be fixed throughout the inductive declaration. Consider making this parameter an index if it must vary.
271275
```
272276

273277
Placing the parameters after the colon results in parameters that can be instantiated by the constructors:

Manual/Language/InductiveTypes/Structures.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,9 @@ it is a type error to apply {name}`printEven` directly to {name}`two`:
533533
#check printEven two
534534
```
535535
```leanOutput printTwo
536-
Application type mismatch: In the appplication
536+
Application type mismatch: In the application
537537
printEven two
538-
the final argument
538+
the argument
539539
two
540540
has type
541541
EvenPrime : Type

Manual/Meta/Basic.lean

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -152,111 +152,3 @@ def commandWithoutAsync : (act : CommandElabM α) → CommandElabM α :=
152152

153153
def withoutAsync [Monad m] [MonadWithOptions m] : (act : m α) → m α :=
154154
withOptions (Elab.async.set · false)
155-
156-
157-
/--
158-
Consistently rewrite all substrings that look like automatic metavariables (e.g "?m.123") so
159-
that they're ?m.1, ?m.2, etc.
160-
-/
161-
def normalizeMetavars (str : String) : String := Id.run do
162-
let mut out := ""
163-
let mut iter := str.iter
164-
let mut gensymCounter := 1
165-
let mut nums : Std.HashMap String Nat := {}
166-
-- States are:
167-
-- * none - Not looking at a metavar
168-
-- * 0 - Saw the ?
169-
-- * 1 - Saw the m
170-
-- * 2 - Saw the .
171-
-- * 3 - Saw one or more digits
172-
let mut state : Option (Fin 4 × String.Iterator) := none
173-
while h : iter.hasNext do
174-
let c := iter.curr' h
175-
176-
match state with
177-
| none =>
178-
if c == '?' then
179-
state := some (0, iter)
180-
else
181-
out := out.push c
182-
| some (0, i) =>
183-
state := if c == 'm' then some (1, i) else none
184-
| some (1, i) =>
185-
state := if c == '.' then some (2, i) else none
186-
| some (2, i) =>
187-
state := if c.isDigit then some (3, i) else none
188-
| some (3, i) =>
189-
unless c.isDigit do
190-
state := none
191-
let mvarStr := i.extract iter
192-
match nums[mvarStr]? with
193-
| none =>
194-
nums := nums.insert mvarStr gensymCounter
195-
out := out ++ s!"?m.{gensymCounter}"
196-
gensymCounter := gensymCounter + 1
197-
| some s => out := out ++ s!"?m.{s}"
198-
out := out.push c
199-
200-
iter := iter.next
201-
match state with
202-
| some (3, i) =>
203-
let mvarStr := i.extract iter
204-
match nums[mvarStr]? with
205-
| none =>
206-
nums := nums.insert mvarStr gensymCounter
207-
out := out ++ s!"?m.{gensymCounter}"
208-
gensymCounter := gensymCounter + 1
209-
| some s => out := out ++ s!"?m.{s}"
210-
| some (_, i) =>
211-
out := out ++ i.extract iter
212-
| _ => pure ()
213-
214-
out
215-
216-
/-- info: "List ?m.1" -/
217-
#guard_msgs in
218-
#eval normalizeMetavars "List ?m.9783"
219-
220-
/-- info: "List ?m.1 " -/
221-
#guard_msgs in
222-
#eval normalizeMetavars "List ?m.9783 "
223-
224-
/-- info: "x : ?m.1\nxs : List ?m.1\nelem : x ∈ xs\n⊢ xs.length > 0\n" -/
225-
#guard_msgs in
226-
#eval normalizeMetavars
227-
r##"x : ?m.1034
228-
xs : List ?m.1034
229-
elem : x ∈ xs
230-
⊢ xs.length > 0
231-
"##
232-
233-
/-- info: "x : ?m.1\nxs : List ?m.1\nelem : x ∈ xs\n⊢ xs.length > 0" -/
234-
#guard_msgs in
235-
#eval normalizeMetavars
236-
r##"x : ?m.1034
237-
xs : List ?m.1034
238-
elem : x ∈ xs
239-
⊢ xs.length > 0"##
240-
241-
/-- info: "x : ?m.1\nxs : List ?m.2\nelem : x ∈ xs\n⊢ xs.length > 0" -/
242-
#guard_msgs in
243-
#eval normalizeMetavars
244-
r##"x : ?m.1034
245-
xs : List ?m.10345
246-
elem : x ∈ xs
247-
⊢ xs.length > 0"##
248-
249-
/-- info: "x : ?m.1\nxs : List ?m.2\nelem : x ∈ xs\n⊢ xs.length > 0" -/
250-
#guard_msgs in
251-
#eval normalizeMetavars
252-
r##"x : ?m.1035
253-
xs : List ?m.1034
254-
elem : x ∈ xs
255-
⊢ xs.length > 0"##
256-
257-
#eval normalizeMetavars
258-
r##"x : ?m.1035
259-
α : Type ?u.1234
260-
xs : List ?m.1034
261-
elem : x ∈ xs
262-
⊢ xs.length > 0"##

Manual/Meta/Syntax.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ where
830830
return bar ++ .nest 2 (← production which stx |>.run' {})
831831

832832
def testGetBnf (config : FreeSyntaxConfig) (isFirst : Bool) (stxs : List Syntax) : TermElabM String := do
833-
let (tagged, _) ← getBnf config isFirst stxs |>.run {} {partContext := ⟨⟨default, default, default, default, default⟩, default⟩}
833+
let (tagged, _) ← getBnf config isFirst stxs |>.run (← ``(Manual)) (.const ``Manual []) {} {partContext := ⟨⟨default, default, default, default, default⟩, default⟩}
834834
pure tagged.stripTags
835835

836836
namespace Tests
@@ -897,7 +897,7 @@ info: antiquot ::= ...
897897

898898
end Tests
899899

900-
instance : MonadWithReaderOf Core.Context DocElabM := inferInstanceAs (MonadWithReaderOf Core.Context (ReaderT PartElabM.State (StateT DocElabM.State TermElabM)))
900+
instance : MonadWithReaderOf Core.Context DocElabM := inferInstanceAs (MonadWithReaderOf Core.Context (ReaderT DocElabContext (ReaderT PartElabM.State (StateT DocElabM.State TermElabM))))
901901

902902
def withOpenedNamespace (ns : Name) (act : DocElabM α) : DocElabM α :=
903903
try

Manual/Meta/Tactics.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Verso.Code.Highlighted
1111
import Verso.Doc.ArgParse
1212
import Verso.Doc.Suggestion
1313
import SubVerso.Highlighting.Code
14+
import SubVerso.Examples.Messages
1415
import VersoManual
1516

1617
import Manual.Meta.Basic
@@ -22,6 +23,7 @@ open Lean Elab Term Tactic
2223
open Verso ArgParse Doc Elab Genre.Manual Html Code Highlighted.WebAssets
2324
open Verso.Genre.Manual.InlineLean.Scopes (runWithOpenDecls runWithVariables)
2425
open SubVerso.Highlighting
26+
open SubVerso.Examples.Messages
2527

2628
structure TacticOutputConfig where
2729
«show» : Bool := true

Manual/NotationsMacros.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ example (cmd1 cmd2 : TSyntax `command) : MacroM (TSyntax `command) := `($cmd1 $c
273273
```
274274
The result is two type errors like the following:
275275
```leanOutput cmdQuot
276-
Application type mismatch: In the appplication
276+
Application type mismatch: In the application
277277
cmd1.raw
278-
the final argument
278+
the argument
279279
cmd1
280280
has type
281281
TSyntax `command : Type

Manual/NotationsMacros/SyntaxDef.lean

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -756,44 +756,45 @@ In particular, Indentation-sensitvity is specified by combining {name Lean.Parse
756756
:::example "Aligned Columns"
757757
This syntax for saving notes takes a bulleted list of items, each of which must be aligned at the same column.
758758
```lean
759-
syntax "note " ppLine withPosition((colEq " " str ppLine)+) : term
759+
syntax "note " ppLine withPosition((colEq " " str ppLine)+) : term
760760
```
761761

762762
There is no elaborator or macro associated with this syntax, but the following example is accepted by the parser:
763763
```lean (error := true) (name := noteEx1)
764764
#check
765765
note
766-
"One"
767-
"Two"
766+
"One"
767+
"Two"
768768
```
769769
```leanOutput noteEx1
770-
elaboration function fortermNote____»' has not been implemented
770+
elaboration function fortermNote____»' has not been implemented
771771
note
772-
"One"
773-
"Two"
772+
"One"
773+
"Two"
774+
774775
```
775776

776777
The syntax does not require that the list is indented with respect to the opening token, which would require an extra `withPosition` and a `colGt`.
777778
```lean (error := true) (name := noteEx15)
778779
#check
779780
note
780-
"One"
781-
"Two"
781+
"One"
782+
"Two"
782783
```
783784
```leanOutput noteEx15
784-
elaboration function fortermNote____»' has not been implemented
785+
elaboration function fortermNote____»' has not been implemented
785786
note
786-
"One"
787-
"Two"
787+
"One"
788+
"Two"
788789
```
789790

790791

791792
The following examples are not syntactically valid because the columns of the bullet points do not match.
792793
```syntaxError noteEx2
793794
#check
794795
note
795-
"One"
796-
"Two"
796+
"One"
797+
"Two"
797798
```
798799
```leanOutput noteEx2
799800
<example>:4:3-4:4: expected end of input
@@ -802,8 +803,8 @@ The following examples are not syntactically valid because the columns of the bu
802803
```syntaxError noteEx2
803804
#check
804805
note
805-
"One"
806-
"Two"
806+
"One"
807+
"Two"
807808
```
808809
```leanOutput noteEx2
809810
<example>:4:5-4:6: expected end of input

Manual/RecursiveDefs/PartialFixpoint.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ The error message on the recursive call is:
175175
```leanOutput nonTailPos
176176
Could not prove 'List.findIndex' to be monotone in its recursive calls:
177177
Cannot eliminate recursive call `List.findIndex ys p` enclosed in
178-
let_fun r := ys✝.findIndex p;
178+
have r := ys✝.findIndex p;
179179
if r = -1 then -1 else r + 1
180180
```
181181

0 commit comments

Comments
 (0)