File tree Expand file tree Collapse file tree 13 files changed +147
-138
lines changed
Expand file tree Collapse file tree 13 files changed +147
-138
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ def casesExpand : TacticCodeAction := fun _ snap ctx _ node => do
299299 let targets := discrInfos.map (·.expr)
300300 match using_ with
301301 | none =>
302- if Tactic. tactic.customEliminators.get (← getOptions) then
302+ if tactic.customEliminators.get (← getOptions) then
303303 if let some elimName ← getCustomEliminator? targets induction then
304304 return some (← getElimExprNames (← getConstInfo elimName).type)
305305 matchConstInduct (← whnf (← inferType discr₀.expr)).getAppFn
@@ -341,7 +341,7 @@ def casesExpand : TacticCodeAction := fun _ snap ctx _ node => do
341341 (doc.meta.text.utf8PosToLspPos stx'.getTailPos?.get!, "" )
342342 else (endPos, " with" )
343343 let fallback := if let some ⟨startPos, endPos⟩ := fallback then
344- doc.meta.text.source.extract startPos endPos
344+ String.Pos.Raw.extract doc.meta.text.source startPos endPos
345345 else
346346 "sorry"
347347 let newText := Id.run do
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ private def modifyStep [BEq α] (m : Matcher α) [Iterator σ n α]
126126instance [Monad n] [BEq α] (m : Matcher α) [Iterator σ n α] :
127127 Iterator (m.Iterator σ n α) n σ where
128128 IsPlausibleStep it step := ∃ step', m.modifyStep it step' = step
129- step it := it.internalState.inner.step >>= fun step => pure ⟨m.modifyStep _ _, step, rfl⟩
129+ step it := it.internalState.inner.step >>=
130+ fun step => pure (.deflate ⟨m.modifyStep _ _, step.inflate, rfl⟩)
130131
131132private def finitenessRelation [Monad n] [BEq α] (m : Matcher α) [Iterator σ n α] [Finite σ n] :
132133 FinitenessRelation (m.Iterator σ n α) n where
Original file line number Diff line number Diff line change @@ -36,9 +36,6 @@ theorem get_push_lt (a : ByteArray) (x : UInt8) (i : Nat) (h : i < a.size) :
3636
3737/-! ### set -/
3838
39- @[simp] theorem data_set (a : ByteArray) (i : Fin a.size) (v : UInt8) :
40- (a.set i v).data = a.data.set i v i.isLt := rfl
41-
4239@[simp] theorem size_set (a : ByteArray) (i : Fin a.size) (v : UInt8) :
4340 (a.set i v).size = a.size :=
4441 Array.size_set ..
Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ def toAsciiByteArray (s : String) : ByteArray :=
2626 `loop p out = out ++ toAsciiByteArray ({ s with startPos := p } : Substring)`
2727 -/
2828 loop (p : Pos.Raw) (out : ByteArray) : ByteArray :=
29- if h : s .atEnd p then out else
30- let c := s .get p
31- have : utf8ByteSize s - (next s p).byteIdx < utf8ByteSize s - p.byteIdx :=
29+ if h : p .atEnd s then out else
30+ let c := p .get s
31+ have : utf8ByteSize s - (Pos.Raw. next s p).byteIdx < utf8ByteSize s - p.byteIdx :=
3232 Nat.sub_lt_sub_left (Nat.lt_of_not_le <| mt decide_eq_true h)
3333 (Nat.lt_add_of_pos_right (Char.utf8Size_pos _))
34- loop (s .next p ) (out.push c.toUInt8)
34+ loop (p .next s ) (out.push c.toUInt8)
3535 termination_by utf8ByteSize s - p.byteIdx
3636 loop 0 ByteArray.empty
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def toStringFull (f : Float) : String :=
6868 else
6969 let rem := Nat.repr ((2 ^e + v' % 2 ^e) * 5 ^e)
7070 let rem := rem.dropRightWhile (· == '0' )
71- s!" {intPart}.{rem. extract ⟨1⟩ rem.endPos}"
71+ s!" {intPart}.{String.Pos.Raw. extract rem ⟨1⟩ rem.endPos}"
7272 if v < 0 then s!" -{s}" else s
7373 else f.toString -- inf, -inf, nan
7474
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Batteries.Tactic.Lemma
33-- lemma disabled by default
44/--
55info: Try this:
6- theorem
6+ [ apply ] theorem
77---
88error: `lemma` is not supported by default, please use `theorem` instead.
99Use `set_option lang.lemmaCmd true` to enable the use of the `lemma` command in a file.
@@ -19,7 +19,7 @@ lemma test2 : 3 < 7 := by decide
1919-- lemma disabled again
2020/--
2121info: Try this:
22- theorem
22+ [ apply ] theorem
2323---
2424error: `lemma` is not supported by default, please use `theorem` instead.
2525Use `set_option lang.lemmaCmd true` to enable the use of the `lemma` command in a file.
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Authors: Kim Morrison
66
77/--
88info: Try this:
9- exact (n, 37)
9+ [ apply ] exact (n, 37)
1010-/
1111#guard_msgs in example (n : Nat) : Nat × Nat := by
1212 show_term
@@ -16,15 +16,15 @@ info: Try this:
1616
1717/--
1818info: Try this:
19- refine (?_, ?_ )
19+ [ apply ] refine (?_, ?_ )
2020-/
2121#guard_msgs in example : Nat × Nat := by
2222 show_term constructor
2323 repeat exact 42
2424
2525/--
2626info: Try this:
27- fun {X} => X
27+ [ apply ] fun {X} => X
2828-/
2929#guard_msgs in example : {_a : Nat} → Nat :=
3030 show_term by
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ set_option linter.missingDocs false
77
88/--
99info: Try this:
10- simp only [ Nat.add_comm ]
10+ [ apply ] simp only [ Nat.add_comm ]
1111-/
1212#guard_msgs in
1313example : x + 1 = 1 + x := by simp? [Nat.add_comm, Nat.mul_comm]
1414/--
1515info: Try this:
16- dsimp only [ Nat.reduceAdd ]
16+ [ apply ] dsimp only [ Nat.reduceAdd ]
1717-/
1818#guard_msgs in
1919example : 1 + 1 = 2 := by dsimp?
@@ -27,10 +27,10 @@ example : 1 + 1 = 2 := by dsimp?
2727
2828/--
2929info: Try this:
30- simp only [foo, bar]
30+ [ apply ] simp only [foo, bar]
3131---
3232info: Try this:
33- simp only [foo, baz]
33+ [ apply ] simp only [foo, baz]
3434-/
3535#guard_msgs in
3636example : foo x y = 1 + y := by
@@ -40,7 +40,7 @@ example : foo x y = 1 + y := by
4040
4141/--
4242info: Try this:
43- simp only [foo, bar, baz]
43+ [ apply ] simp only [foo, bar, baz]
4444-/
4545#guard_msgs in
4646example : foo x y = 1 + y := by
Original file line number Diff line number Diff line change @@ -96,14 +96,14 @@ example (P : Bool) (h : ¬ ¬ P) : P := by
9696
9797/--
9898info: Try this:
99- simpa only using h
99+ [ apply ] simpa only using h
100100-/
101101#guard_msgs in
102102example (p : Prop ) (h : p) : p := by simpa? using h
103103
104104/--
105105info: Try this:
106- simpa only [ and_true ] using h
106+ [ apply ] simpa only [ and_true ] using h
107107-/
108108#guard_msgs in
109109example (p : Prop ) (h : p ∧ True) : p := by simpa? using h
You can’t perform that action at this time.
0 commit comments