@[implicit_reducible]
instance
String.Slice.Pattern.Model.ForwardSliceSearcher.instPatternModel
{pat : Slice}
:
PatternModel pat
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.isLongestRevMatchAt_iff_extract
{pat s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat.isEmpty = false)
:
IsLongestRevMatchAt 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.offset_of_isLongestRevMatchAt
{pat s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat.isEmpty = false)
(h' : IsLongestRevMatchAt 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)
theorem
String.Slice.Pattern.Model.ForwardSliceSearcher.revMatchesAt_iff_isLongestRevMatchAt
{pat s : Slice}
{pos : s.Pos}
(h : pat.isEmpty = false)
:
RevMatchesAt pat pos ↔ ∃ (h : Pos.Raw.IsValidForSlice s (pos.offset.decreaseBy pat.utf8ByteSize)), IsLongestRevMatchAt pat (s.pos (pos.offset.decreaseBy pat.utf8ByteSize) h) pos
@[implicit_reducible]
instance
String.Slice.Pattern.Model.ForwardStringSearcher.instPatternModel
{pat : String}
:
PatternModel pat
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isRevMatch_iff_slice
{pat : String}
{s : Slice}
{pos : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestMatch_iff_isLongestMatch_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestRevMatch_iff_isLongestRevMatch_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestMatchAt_iff_isLongestMatchAt_toSlice
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestRevMatchAt_iff_isLongestRevMatchAt_toSlice
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.revMatchesAt_iff_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestMatchAt_iff_extract
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat ≠ "")
:
IsLongestMatchAt pat pos₁ pos₂ ↔ s.copy.toByteArray.extract pos₁.offset.byteIdx pos₂.offset.byteIdx = pat.toByteArray
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isLongestRevMatchAt_iff_extract
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat ≠ "")
:
IsLongestRevMatchAt pat pos₁ pos₂ ↔ s.copy.toByteArray.extract pos₁.offset.byteIdx pos₂.offset.byteIdx = pat.toByteArray
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.offset_of_isLongestMatchAt
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat ≠ "")
(h' : IsLongestMatchAt pat pos₁ pos₂)
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.offset_of_isLongestRevMatchAt
{pat : String}
{s : Slice}
{pos₁ pos₂ : s.Pos}
(h : pat ≠ "")
(h' : IsLongestRevMatchAt pat pos₁ pos₂)
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.matchesAt_iff_isLongestMatchAt
{pat : String}
{s : Slice}
{pos : s.Pos}
(h : pat ≠ "")
:
MatchesAt pat pos ↔ ∃ (h : Pos.Raw.IsValidForSlice s (pos.offset.increaseBy pat.utf8ByteSize)), IsLongestMatchAt pat pos (s.pos (pos.offset.increaseBy pat.utf8ByteSize) h)
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.revMatchesAt_iff_isLongestRevMatchAt
{pat : String}
{s : Slice}
{pos : s.Pos}
(h : pat ≠ "")
:
RevMatchesAt pat pos ↔ ∃ (h : Pos.Raw.IsValidForSlice s (pos.offset.decreaseBy pat.utf8ByteSize)), IsLongestRevMatchAt pat (s.pos (pos.offset.decreaseBy pat.utf8ByteSize) h) pos
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.matchesAt_iff_getElem
{pat : String}
{s : Slice}
{pos : s.Pos}
(h : pat ≠ "")
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.revMatchesAt_iff_revMatchesAt_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isValidSearchFrom_iff_isValidSearchFrom_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
{l : List (SearchStep s)}
:
theorem
String.Slice.Pattern.Model.ForwardStringSearcher.isValidRevSearchFrom_iff_isValidRevSearchFrom_toSlice
{pat : String}
{s : Slice}
{pos : s.Pos}
{l : List (SearchStep s)}
: