refactor: move Std.Range to Std.Legacy.Range (#11438)
This PR renames the namespace `Std.Range` to `Std.Legacy.Range`. Instead of using `Std.Range` and `[a:b]` notation, the new range type `Std.Rco` and its corresponding `a...b` notation should be used. There are also other ranges with open/closed/infinite boundary shapes in `Std.Data.Range.Polymorphic` and the new range notation also works for `Int`, `Int8`, `UInt8`, `Fin` etc.
This commit is contained in:
parent
aa9f7ab14b
commit
4e656ea8e9
9 changed files with 65 additions and 63 deletions
|
|
@ -10,7 +10,7 @@ public import Init.Omega
|
|||
|
||||
public section
|
||||
|
||||
namespace Std
|
||||
namespace Std.Legacy
|
||||
-- We put `Range` in `Init` because we want the notation `[i:j]` without importing `Std`
|
||||
-- We don't put `Range` in the top-level namespace to avoid collisions with user defined types
|
||||
structure Range where
|
||||
|
|
@ -74,15 +74,15 @@ macro_rules
|
|||
| `([ : $stop : $step ]) => `({ stop := $stop, step := $step, step_pos := by decide : Range })
|
||||
|
||||
end Range
|
||||
end Std
|
||||
end Std.Legacy
|
||||
|
||||
theorem Membership.mem.upper {i : Nat} {r : Std.Range} (h : i ∈ r) : i < r.stop := h.2.1
|
||||
theorem Membership.mem.upper {i : Nat} {r : Std.Legacy.Range} (h : i ∈ r) : i < r.stop := h.2.1
|
||||
|
||||
theorem Membership.mem.lower {i : Nat} {r : Std.Range} (h : i ∈ r) : r.start ≤ i := h.1
|
||||
theorem Membership.mem.lower {i : Nat} {r : Std.Legacy.Range} (h : i ∈ r) : r.start ≤ i := h.1
|
||||
|
||||
theorem Membership.mem.step {i : Nat} {r : Std.Range} (h : i ∈ r) : (i - r.start) % r.step = 0 := h.2.2
|
||||
theorem Membership.mem.step {i : Nat} {r : Std.Legacy.Range} (h : i ∈ r) : (i - r.start) % r.step = 0 := h.2.2
|
||||
|
||||
theorem Membership.get_elem_helper {i n : Nat} {r : Std.Range} (h₁ : i ∈ r) (h₂ : r.stop = n) :
|
||||
theorem Membership.get_elem_helper {i n : Nat} {r : Std.Legacy.Range} (h₁ : i ∈ r) (h₂ : r.stop = n) :
|
||||
i < n := h₂ ▸ h₁.2.1
|
||||
|
||||
macro_rules
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ public import Init.Data.Nat.Div.Lemmas
|
|||
public section
|
||||
|
||||
/-!
|
||||
# Lemmas about `Std.Range`
|
||||
# Lemmas about `Std.Legacy.Range`
|
||||
|
||||
We provide lemmas rewriting for loops over `Std.Range` in terms of `List.range'`.
|
||||
We provide lemmas rewriting for loops over `Std.Legacy.Range` in terms of `List.range'`.
|
||||
-/
|
||||
|
||||
namespace Std.Range
|
||||
namespace Std.Legacy.Range
|
||||
|
||||
/-- Generalization of `mem_of_mem_range'` used in `forIn'_loop_eq_forIn'_range'` below. -/
|
||||
private theorem mem_of_mem_range'_aux {r : Range} {a : Nat} (w₁ : (i - r.start) % r.step = 0)
|
||||
|
|
@ -37,7 +37,7 @@ theorem mem_of_mem_range' {r : Range} (h : x ∈ List.range' r.start r.size r.st
|
|||
unfold size at h
|
||||
apply mem_of_mem_range'_aux (by simp) (by simp) h
|
||||
|
||||
private theorem size_eq (r : Std.Range) (h : i < r.stop) :
|
||||
private theorem size_eq (r : Range) (h : i < r.stop) :
|
||||
(r.stop - i + r.step - 1) / r.step =
|
||||
(r.stop - (i + r.step) + r.step - 1) / r.step + 1 := by
|
||||
have w := r.step_pos
|
||||
|
|
@ -57,7 +57,7 @@ private theorem size_eq (r : Std.Range) (h : i < r.stop) :
|
|||
rw [Nat.div_eq_iff] <;> omega
|
||||
omega
|
||||
|
||||
private theorem forIn'_loop_eq_forIn'_range' [Monad m] (r : Std.Range)
|
||||
private theorem forIn'_loop_eq_forIn'_range' [Monad m] (r : Range)
|
||||
(init : β) (f : (a : Nat) → a ∈ r → β → m (ForInStep β)) (i) (w₁) (w₂) :
|
||||
forIn'.loop r f init i w₁ w₂ =
|
||||
forIn' (List.range' i ((r.stop - i + r.step - 1) / r.step) r.step) init
|
||||
|
|
@ -75,7 +75,7 @@ private theorem forIn'_loop_eq_forIn'_range' [Monad m] (r : Std.Range)
|
|||
rw [Nat.div_eq_iff] <;> omega
|
||||
simp [this]
|
||||
|
||||
@[simp] theorem forIn'_eq_forIn'_range' [Monad m] (r : Std.Range)
|
||||
@[simp] theorem forIn'_eq_forIn'_range' [Monad m] (r : Range)
|
||||
(init : β) (f : (a : Nat) → a ∈ r → β → m (ForInStep β)) :
|
||||
forIn' r init f =
|
||||
forIn' (List.range' r.start r.size r.step) init (fun a h => f a (mem_of_mem_range' h)) := by
|
||||
|
|
@ -83,12 +83,12 @@ private theorem forIn'_loop_eq_forIn'_range' [Monad m] (r : Std.Range)
|
|||
simp only [size]
|
||||
rw [forIn'_loop_eq_forIn'_range']
|
||||
|
||||
@[simp] theorem forIn_eq_forIn_range' [Monad m] (r : Std.Range)
|
||||
@[simp] theorem forIn_eq_forIn_range' [Monad m] (r : Range)
|
||||
(init : β) (f : Nat → β → m (ForInStep β)) :
|
||||
forIn r init f = forIn (List.range' r.start r.size r.step) init f := by
|
||||
simp only [forIn, forIn'_eq_forIn'_range']
|
||||
|
||||
private theorem forM_loop_eq_forM_range' [Monad m] (r : Std.Range) (f : Nat → m PUnit) :
|
||||
private theorem forM_loop_eq_forM_range' [Monad m] (r : Range) (f : Nat → m PUnit) :
|
||||
forM.loop r f i = forM (List.range' i ((r.stop - i + r.step - 1) / r.step) r.step) f := by
|
||||
have w := r.step_pos
|
||||
rw [forM.loop]
|
||||
|
|
@ -101,8 +101,8 @@ private theorem forM_loop_eq_forM_range' [Monad m] (r : Std.Range) (f : Nat →
|
|||
rw [Nat.div_eq_iff] <;> omega
|
||||
simp [this]
|
||||
|
||||
@[simp] theorem forM_eq_forM_range' [Monad m] (r : Std.Range) (f : Nat → m PUnit) :
|
||||
@[simp] theorem forM_eq_forM_range' [Monad m] (r : Range) (f : Nat → m PUnit) :
|
||||
forM r f = forM (List.range' r.start r.size r.step) f := by
|
||||
simp only [forM, Range.forM, forM_loop_eq_forM_range', size]
|
||||
|
||||
end Std.Range
|
||||
end Std.Legacy.Range
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ instance : ToStream (Subarray α) (Subarray α) where
|
|||
instance : ToStream String Substring.Raw where
|
||||
toStream s := s.toRawSubstring
|
||||
|
||||
instance : ToStream Std.Range Std.Range where
|
||||
instance : ToStream Std.Legacy.Range Std.Legacy.Range where
|
||||
toStream r := r
|
||||
|
||||
instance [Stream ρ α] [Stream γ β] : Stream (ρ × γ) (α × β) where
|
||||
|
|
@ -108,7 +108,7 @@ instance : Stream (Subarray α) α where
|
|||
else
|
||||
none
|
||||
|
||||
instance : Stream Std.Range Nat where
|
||||
instance : Stream Std.Legacy.Range Nat where
|
||||
next? r :=
|
||||
if r.start < r.stop then
|
||||
some (r.start, { r with start := r.start + r.step })
|
||||
|
|
|
|||
|
|
@ -1291,9 +1291,9 @@ def delabPProdMk : Delab := delabPProdMkCore ``PProd.mk
|
|||
@[builtin_delab app.MProd.mk]
|
||||
def delabMProdMk : Delab := delabPProdMkCore ``MProd.mk
|
||||
|
||||
@[builtin_delab app.Std.Range.mk]
|
||||
@[builtin_delab app.Std.Legacy.Range.mk]
|
||||
def delabRange : Delab := whenPPOption getPPNotation do
|
||||
-- Std.Range.mk : (start : Nat) → (stop : Nat) → (step : Nat) → 0 < step → Std.Range
|
||||
-- Std.Legacy.Range.mk : (start : Nat) → (stop : Nat) → (step : Nat) → 0 < step → Std.Legacy.Range
|
||||
guard <| (← getExpr).getAppNumArgs == 4
|
||||
-- `none` if the start is `0`
|
||||
let start? ← withNaryArg 0 do
|
||||
|
|
|
|||
|
|
@ -26,15 +26,15 @@ set_option linter.missingDocs true
|
|||
This module contains Hoare triple specifications for some functions in Core.
|
||||
-/
|
||||
|
||||
namespace Std.Range
|
||||
namespace Std.Legacy.Range
|
||||
|
||||
/--
|
||||
Converts a range to the list of all numbers in the range.
|
||||
-/
|
||||
abbrev toList (r : Std.Range) : List Nat :=
|
||||
abbrev toList (r : Std.Legacy.Range) : List Nat :=
|
||||
List.range' r.start ((r.stop - r.start + r.step - 1) / r.step) r.step
|
||||
|
||||
end Std.Range
|
||||
end Std.Legacy.Range
|
||||
|
||||
namespace List
|
||||
|
||||
|
|
@ -765,23 +765,23 @@ theorem Spec.foldlM_list_const_inv
|
|||
@[spec]
|
||||
theorem Spec.forIn'_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
|
||||
[Monad m] [WPMonad m ps]
|
||||
{xs : Std.Range} {init : β} {f : (a : Nat) → a ∈ xs → β → m (ForInStep β)}
|
||||
{xs : Std.Legacy.Range} {init : β} {f : (a : Nat) → a ∈ xs → β → m (ForInStep β)}
|
||||
(inv : Invariant xs.toList β ps)
|
||||
(step : ∀ pref cur suff (h : xs.toList = pref ++ cur :: suff) b,
|
||||
Triple
|
||||
(f cur (by simp [Std.Range.mem_of_mem_range', h]) b)
|
||||
(f cur (by simp [Std.Legacy.Range.mem_of_mem_range', h]) b)
|
||||
(inv.1 (⟨pref, cur::suff, h.symm⟩, b))
|
||||
(fun r => match r with
|
||||
| .yield b' => inv.1 (⟨pref ++ [cur], suff, by simp [h]⟩, b')
|
||||
| .done b' => inv.1 (⟨xs.toList, [], by simp⟩, b'), inv.2)) :
|
||||
Triple (forIn' xs init f) (inv.1 (⟨[], xs.toList, rfl⟩, init)) (fun b => inv.1 (⟨xs.toList, [], by simp⟩, b), inv.2) := by
|
||||
simp only [Std.Range.forIn'_eq_forIn'_range', Std.Range.size, Std.Range.size.eq_1]
|
||||
simp only [Std.Legacy.Range.forIn'_eq_forIn'_range', Std.Legacy.Range.size, Std.Legacy.Range.size.eq_1]
|
||||
apply Spec.forIn'_list inv (fun c hcur b => step c hcur b)
|
||||
|
||||
@[spec]
|
||||
theorem Spec.forIn_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
|
||||
[Monad m] [WPMonad m ps]
|
||||
{xs : Std.Range} {init : β} {f : Nat → β → m (ForInStep β)}
|
||||
{xs : Std.Legacy.Range} {init : β} {f : Nat → β → m (ForInStep β)}
|
||||
(inv : Invariant xs.toList β ps)
|
||||
(step : ∀ pref cur suff (h : xs.toList = pref ++ cur :: suff) b,
|
||||
Triple
|
||||
|
|
@ -791,7 +791,7 @@ theorem Spec.forIn_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
|
|||
| .yield b' => inv.1 (⟨pref ++ [cur], suff, by simp [h]⟩, b')
|
||||
| .done b' => inv.1 (⟨xs.toList, [], by simp⟩, b'), inv.2)) :
|
||||
Triple (forIn xs init f) (inv.1 (⟨[], xs.toList, rfl⟩, init)) (fun b => inv.1 (⟨xs.toList, [], by simp⟩, b), inv.2) := by
|
||||
simp only [Std.Range.forIn_eq_forIn_range', Std.Range.size]
|
||||
simp only [Std.Legacy.Range.forIn_eq_forIn_range', Std.Legacy.Range.size]
|
||||
apply Spec.forIn_list inv step
|
||||
|
||||
open Std.PRange in
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Regression test for #6332
|
|||
-/
|
||||
|
||||
open Function (uncurry)
|
||||
open Std (Range)
|
||||
open Std.Legacy (Range)
|
||||
|
||||
section Matrix
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,40 @@
|
|||
/-!
|
||||
# Tests for delaborators for Std.Range and Std.PRange
|
||||
# Tests for delaborators for Std.Legacy.Range and Std.PRange
|
||||
-/
|
||||
|
||||
/-!
|
||||
## Tests for `Std.Range`
|
||||
## Tests for `Std.Legacy.Range`
|
||||
-/
|
||||
|
||||
/-!
|
||||
Default lower bound and step
|
||||
-/
|
||||
/-- info: [:10] : Std.Range -/
|
||||
#guard_msgs in #check Std.Range.mk 0 10 1 (by grind)
|
||||
/-- info: [:10] : Std.Legacy.Range -/
|
||||
#guard_msgs in #check Std.Legacy.Range.mk 0 10 1 (by grind)
|
||||
|
||||
/-!
|
||||
Default step
|
||||
-/
|
||||
/-- info: [5:10] : Std.Range -/
|
||||
#guard_msgs in #check Std.Range.mk 5 10 1 (by grind)
|
||||
/-- info: [5:10] : Std.Legacy.Range -/
|
||||
#guard_msgs in #check Std.Legacy.Range.mk 5 10 1 (by grind)
|
||||
|
||||
/-!
|
||||
Default lower bound
|
||||
-/
|
||||
/-- info: [:10:2] : Std.Range -/
|
||||
#guard_msgs in #check Std.Range.mk 0 10 2 (by grind)
|
||||
/-- info: [:10:2] : Std.Legacy.Range -/
|
||||
#guard_msgs in #check Std.Legacy.Range.mk 0 10 2 (by grind)
|
||||
|
||||
/-!
|
||||
No defaults
|
||||
-/
|
||||
/-- info: [5:10:2] : Std.Range -/
|
||||
#guard_msgs in #check Std.Range.mk 5 10 2 (by grind)
|
||||
/-- info: [5:10:2] : Std.Legacy.Range -/
|
||||
#guard_msgs in #check Std.Legacy.Range.mk 5 10 2 (by grind)
|
||||
|
||||
/-!
|
||||
Disable notation
|
||||
-/
|
||||
/-- info: { stop := 10, step_pos := _check._proof_1 } : Std.Range -/
|
||||
#guard_msgs in set_option pp.notation false in #check Std.Range.mk 0 10 1 (by grind)
|
||||
/-- info: { stop := 10, step_pos := _check._proof_1 } : Std.Legacy.Range -/
|
||||
#guard_msgs in set_option pp.notation false in #check Std.Legacy.Range.mk 0 10 1 (by grind)
|
||||
|
||||
/-!
|
||||
## Tests for `Std.PRange`
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
knil s
|
||||
loop 0 s
|
||||
|
||||
@[inline] protected def Std.Range.forInNew' {m : Type u → Type v} {σ β} (range : Range) (init : σ)
|
||||
@[inline] protected def Std.Legacy.Range.forInNew' {m : Type u → Type v} {σ β} (range : Range) (init : σ)
|
||||
(kcons : (i : Nat) → i ∈ range → (σ → m β) → σ → m β) (knil : σ → m β) : m β :=
|
||||
have := range.step_pos
|
||||
let rec @[specialize] loop (i : Nat)
|
||||
|
|
@ -22,18 +22,19 @@
|
|||
|
||||
/--
|
||||
trace: [Compiler.saveMono] size: 1
|
||||
def Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4 s' _x.1 _x.2 as sz _x.3 range this i hs hl a.4 : Array
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4 s' _x.1 _x.2 as sz _x.3 range this i hs hl a.4 : Array
|
||||
String :=
|
||||
let _x.5 := Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range i a.4;
|
||||
let _x.5 := Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range i a.4;
|
||||
return _x.5
|
||||
[Compiler.saveMono] size: 1
|
||||
def Std.Range.forInNew'.loop._at_.deletions.spec_1 s' _x.1 _x.2 kcontinue range this i hs hl a.3 : Array String :=
|
||||
let _x.4 := Std.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range i a.3;
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1 s' _x.1 _x.2 kcontinue range this i hs hl a.3 : Array
|
||||
String :=
|
||||
let _x.4 := Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range i a.3;
|
||||
return _x.4
|
||||
[Compiler.saveMono] size: 1
|
||||
def Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4 as sz _x.1 s' _x.2 _x.3 range this i hs hl a.4 : Array
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4 as sz _x.1 s' _x.2 _x.3 range this i hs hl a.4 : Array
|
||||
String :=
|
||||
let _x.5 := Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.1 s' _x.2 _x.3 range i a.4;
|
||||
let _x.5 := Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.1 s' _x.2 _x.3 range i a.4;
|
||||
return _x.5
|
||||
[Compiler.saveMono] size: 12
|
||||
def Array.contains._at_.deletions.spec_0 as a : Bool :=
|
||||
|
|
@ -107,17 +108,17 @@ trace: [Compiler.saveMono] size: 1
|
|||
let _x.7 := USize.add i _x.6;
|
||||
let _x.8 := String.length a;
|
||||
let _x.9 := 1;
|
||||
let _x.10 := Std.Range.mk _x.4 _x.8 _x.9 ◾;
|
||||
let _x.11 := Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.7 a _x.9 _x.5 _x.10 _x.4 s;
|
||||
let _x.10 := Std.Legacy.Range.mk _x.4 _x.8 _x.9 ◾;
|
||||
let _x.11 := Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.7 a _x.9 _x.5 _x.10 _x.4 s;
|
||||
return _x.11
|
||||
| Bool.true =>
|
||||
let _x.12 := Array.reverse._redArg s;
|
||||
return _x.12
|
||||
[Compiler.saveMono] size: 29
|
||||
def Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range i a.4 : Array
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range i a.4 : Array
|
||||
String :=
|
||||
cases range : Array String
|
||||
| Std.Range.mk start stop step step_pos =>
|
||||
| Std.Legacy.Range.mk start stop step step_pos =>
|
||||
let _x.5 := Nat.decLt i stop;
|
||||
cases _x.5 : Array String
|
||||
| Bool.false =>
|
||||
|
|
@ -136,7 +137,7 @@ trace: [Compiler.saveMono] size: 1
|
|||
let d := String.append _x.12 _x.15;
|
||||
jp _jp.16 : Array String :=
|
||||
let out := Array.push ◾ a.4 d;
|
||||
let _x.17 := Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range _x.7 out;
|
||||
let _x.17 := Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range _x.7 out;
|
||||
return _x.17;
|
||||
let _x.18 := Array.contains._at_.deletions.spec_0 a.4 d;
|
||||
cases _x.18 : Array String
|
||||
|
|
@ -145,15 +146,15 @@ trace: [Compiler.saveMono] size: 1
|
|||
| Bool.true =>
|
||||
cases _x.2 : Array String
|
||||
| Bool.false =>
|
||||
let _x.19 := Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range _x.7 a.4;
|
||||
let _x.19 := Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.1 _x.2 as sz _x.3 range _x.7 a.4;
|
||||
return _x.19
|
||||
| Bool.true =>
|
||||
goto _jp.16
|
||||
[Compiler.saveMono] size: 29
|
||||
def Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.1 s' _x.2 _x.3 range i a.4 : Array
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4._redArg as sz _x.1 s' _x.2 _x.3 range i a.4 : Array
|
||||
String :=
|
||||
cases range : Array String
|
||||
| Std.Range.mk start stop step step_pos =>
|
||||
| Std.Legacy.Range.mk start stop step step_pos =>
|
||||
let _x.5 := Nat.decLt i stop;
|
||||
cases _x.5 : Array String
|
||||
| Bool.false =>
|
||||
|
|
@ -172,7 +173,7 @@ trace: [Compiler.saveMono] size: 1
|
|||
let d := String.append _x.12 _x.15;
|
||||
jp _jp.16 : Array String :=
|
||||
let out := Array.push ◾ a.4 d;
|
||||
let _x.17 := Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.2 _x.3 as sz _x.1 range _x.7 out;
|
||||
let _x.17 := Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.2 _x.3 as sz _x.1 range _x.7 out;
|
||||
return _x.17;
|
||||
let _x.18 := Array.contains._at_.deletions.spec_0 a.4 d;
|
||||
cases _x.18 : Array String
|
||||
|
|
@ -181,14 +182,15 @@ trace: [Compiler.saveMono] size: 1
|
|||
| Bool.true =>
|
||||
cases _x.3 : Array String
|
||||
| Bool.false =>
|
||||
let _x.19 := Std.Range.forInNew'.loop._at_.Std.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.2 _x.3 as sz _x.1 range _x.7 a.4;
|
||||
let _x.19 := Std.Legacy.Range.forInNew'.loop._at_.Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._at_.Array.forInNew'Unsafe.loop._at_.deletions.spec_2.spec_4.spec_4._redArg s' _x.2 _x.3 as sz _x.1 range _x.7 a.4;
|
||||
return _x.19
|
||||
| Bool.true =>
|
||||
goto _jp.16
|
||||
[Compiler.saveMono] size: 29
|
||||
def Std.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range i a.3 : Array String :=
|
||||
def Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range i a.3 : Array
|
||||
String :=
|
||||
cases range : Array String
|
||||
| Std.Range.mk start stop step step_pos =>
|
||||
| Std.Legacy.Range.mk start stop step step_pos =>
|
||||
let _x.4 := Nat.decLt i stop;
|
||||
cases _x.4 : Array String
|
||||
| Bool.false =>
|
||||
|
|
@ -207,7 +209,7 @@ trace: [Compiler.saveMono] size: 1
|
|||
let d := String.append _x.11 _x.14;
|
||||
jp _jp.15 : Array String :=
|
||||
let out := Array.push ◾ a.3 d;
|
||||
let _x.16 := Std.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range _x.6 out;
|
||||
let _x.16 := Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range _x.6 out;
|
||||
return _x.16;
|
||||
let _x.17 := Array.contains._at_.deletions.spec_0 a.3 d;
|
||||
cases _x.17 : Array String
|
||||
|
|
@ -216,7 +218,7 @@ trace: [Compiler.saveMono] size: 1
|
|||
| Bool.true =>
|
||||
cases _x.2 : Array String
|
||||
| Bool.false =>
|
||||
let _x.18 := Std.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range _x.6 a.3;
|
||||
let _x.18 := Std.Legacy.Range.forInNew'.loop._at_.deletions.spec_1._redArg s' _x.1 _x.2 kcontinue range _x.6 a.3;
|
||||
return _x.18
|
||||
| Bool.true =>
|
||||
goto _jp.15
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ import Lean.Elab.Tactic.Grind.LintExceptions
|
|||
/-! Check remaining Std sub-namespaces: -/
|
||||
|
||||
#guard_msgs in
|
||||
#grind_lint check (min := 20) in Std.Do Std.Range Std.Tactic
|
||||
#grind_lint check (min := 20) in Std.Do Std.Legacy.Range Std.Tactic
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue