Represents a list of subslices of a slice s, the first of which starts at the given
position startPos. This is a natural type for a split routine to return.
- any_head? : Option.any (fun (x : s.Subslice) => decide (x.startInclusive = startPos)) self.l.head? = true
Instances For
theorem
String.Slice.Pattern.Model.SlicesFrom.ext
{s : Slice}
{startPos : s.Pos}
{x y : SlicesFrom startPos}
(l : x.l = y.l)
:
theorem
String.Slice.Pattern.Model.SlicesFrom.ext_iff
{s : Slice}
{startPos : s.Pos}
{x y : SlicesFrom startPos}
:
def
String.Slice.Pattern.Model.SlicesFrom.append
{s : Slice}
{p₁ p₂ : s.Pos}
(l₁ : SlicesFrom p₁)
(l₂ : SlicesFrom p₂)
:
SlicesFrom p₁
Concatenating two SlicesFrom yields a SlicesFrom from the first position.
Instances For
@[simp]
theorem
String.Slice.Pattern.Model.SlicesFrom.l_append
{s : Slice}
{p₁ p₂ : s.Pos}
{l₁ : SlicesFrom p₁}
{l₂ : SlicesFrom p₂}
:
def
String.Slice.Pattern.Model.SlicesFrom.extend
{s : Slice}
(p₁ : s.Pos)
{p₂ : s.Pos}
(h : p₁ ≤ p₂)
(l : SlicesFrom p₂)
:
SlicesFrom p₁
Given a SlicesFrom p₂ and a position p₁ such that p₁ ≤ p₂, obtain a
SlicesFrom p₁ by extending the left end of the first subslice to from p₂ to
p₁.
Equations
- String.Slice.Pattern.Model.SlicesFrom.extend p₁ h l = { l := match l.l, ⋯ with | st :: sts, h_1 => st.extendLeft p₁ ⋯ :: sts, any_head? := ⋯ }
Instances For
@[simp]
theorem
String.Slice.Pattern.Model.SlicesFrom.l_extend
{s : Slice}
{p₁ p₂ : s.Pos}
(h : p₁ ≤ p₂)
{l : SlicesFrom p₂}
:
@[simp]
theorem
String.Slice.Pattern.Model.SlicesFrom.extend_self
{s : Slice}
{p₁ : s.Pos}
(l : SlicesFrom p₁)
:
@[irreducible]
noncomputable def
String.Slice.Pattern.Model.split
{ρ : Type}
(pat : ρ)
[ForwardPatternModel pat]
{s : Slice}
(start : s.Pos)
:
SlicesFrom start
Noncomputable model implementation of String.Slice.splitToSubslice based on
ForwardPatternModel. This is supposed to be simple enough to allow deriving higher-level
API lemmas about the public splitting functions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
String.Slice.Pattern.Model.split_endPos
{ρ : Type}
{pat : ρ}
[ForwardPatternModel pat]
{s : Slice}
:
theorem
String.Slice.Pattern.Model.split_eq_of_isLongestMatchAt
{ρ : Type}
{pat : ρ}
[ForwardPatternModel pat]
{s : Slice}
{start stop : s.Pos}
(h : IsLongestMatchAt pat start stop)
:
theorem
String.Slice.Pattern.toList_splitToSubslice_eq_modelSplit
{ρ : Type}
(pat : ρ)
[Model.ForwardPatternModel pat]
{σ : Slice → Type}
[ToForwardSearcher pat σ]
[(s : Slice) → Std.Iterator (σ s) Id (SearchStep s)]
[∀ (s : Slice), Std.Iterators.Finite (σ s) Id]
[Model.LawfulToForwardSearcherModel pat]
(s : Slice)
: