@@ -24,12 +24,12 @@ public import Init.Data.Iterators.Lemmas.Combinators.FilterMap
2424This module contains Hoare triple specifications for some functions in Core.
2525-/
2626
27- namespace Std.Range
27+ namespace Std.Legacy. Range
2828
29- abbrev toList (r : Std.Range) : List Nat :=
29+ abbrev toList (r : Std.Legacy. Range) : List Nat :=
3030 List.range' r.start ((r.stop - r.start + r.step - 1 ) / r.step) r.step
3131
32- end Std.Range
32+ end Std.Legacy. Range
3333
3434namespace List
3535
@@ -718,23 +718,23 @@ theorem Spec.foldlM_list_const_inv
718718@[spec]
719719theorem Spec.forIn'_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
720720 [Monad m] [WPMonad m ps]
721- {xs : Std.Range} {init : β} {f : (a : Nat) → a ∈ xs → β → m (ForInStep β)}
721+ {xs : Std.Legacy. Range} {init : β} {f : (a : Nat) → a ∈ xs → β → m (ForInStep β)}
722722 (inv : Invariant xs.toList β ps)
723723 (step : ∀ pref cur suff (h : xs.toList = pref ++ cur :: suff) b,
724724 Triple
725- (f cur (by simp [Std.Range.mem_of_mem_range', h]) b)
725+ (f cur (by simp [Std.Legacy. Range.mem_of_mem_range', h]) b)
726726 (inv.1 (⟨pref, cur::suff, h.symm⟩, b))
727727 (fun r => match r with
728728 | .yield b' => inv.1 (⟨pref ++ [cur], suff, by simp [h]⟩, b')
729729 | .done b' => inv.1 (⟨xs.toList, [], by simp⟩, b'), inv.2 )) :
730730 Triple (forIn' xs init f) (inv.1 (⟨[], xs.toList, rfl⟩, init)) (fun b => inv.1 (⟨xs.toList, [], by simp⟩, b), inv.2 ) := by
731- simp only [Std.Range.forIn'_eq_forIn'_range', Std.Range.size, Std.Range.size.eq_1]
731+ simp only [Std.Legacy. Range.forIn'_eq_forIn'_range', Std.Legacy. Range.size, Std.Legacy .Range.size.eq_1]
732732 apply Spec.forIn'_list inv (fun c hcur b => step c hcur b)
733733
734734@[spec]
735735theorem Spec.forIn_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
736736 [Monad m] [WPMonad m ps]
737- {xs : Std.Range} {init : β} {f : Nat → β → m (ForInStep β)}
737+ {xs : Std.Legacy. Range} {init : β} {f : Nat → β → m (ForInStep β)}
738738 (inv : Invariant xs.toList β ps)
739739 (step : ∀ pref cur suff (h : xs.toList = pref ++ cur :: suff) b,
740740 Triple
@@ -744,7 +744,7 @@ theorem Spec.forIn_range {β : Type u} {m : Type u → Type v} {ps : PostShape}
744744 | .yield b' => inv.1 (⟨pref ++ [cur], suff, by simp [h]⟩, b')
745745 | .done b' => inv.1 (⟨xs.toList, [], by simp⟩, b'), inv.2 )) :
746746 Triple (forIn xs init f) (inv.1 (⟨[], xs.toList, rfl⟩, init)) (fun b => inv.1 (⟨xs.toList, [], by simp⟩, b), inv.2 ) := by
747- simp only [Std.Range.forIn_eq_forIn_range', Std.Range.size]
747+ simp only [Std.Legacy. Range.forIn_eq_forIn_range', Std.Legacy .Range.size]
748748 apply Spec.forIn_list inv step
749749
750750open Std.PRange in
0 commit comments