@[implicit_reducible]
theorem
String.Slice.Pattern.Model.ForwardSliceSearcher.isLongestMatchAt_iff_extract
{pat s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat.isEmpty = false)
:
IsLongestMatchAt pat pos₁ pos₂ ↔ s.copy.toByteArray.extract pos₁.offset.byteIdx pos₂.offset.byteIdx = pat.copy.toByteArray
theorem
String.Slice.Pattern.Model.ForwardSliceSearcher.offset_of_isLongestMatchAt
{pat s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat.isEmpty = false)
(h' : IsLongestMatchAt pat pos₁ pos₂)
:
theorem
String.Slice.Pattern.Model.ForwardSliceSearcher.matchesAt_iff_isLongestMatchAt
{pat s : Slice}
{pos : s.Pos}
(h : pat.isEmpty = false)
:
MatchesAt pat pos ↔ ∃ (h : Pos.Raw.IsValidForSlice s (pos.offset.increaseBy pat.utf8ByteSize)), IsLongestMatchAt pat pos (s.pos (pos.offset.increaseBy pat.utf8ByteSize) h)