Documentation

Init.Data.String.Termination

Helpers for termination arguments about functions operating on strings #

The number of bytes between p and the end position. This number decreases as p advances.

Equations
Instances For
    theorem String.Slice.Pos.wellFounded_lt {s : Slice} :
    WellFounded fun (p q : s.Pos) => p < q
    theorem String.Slice.Pos.wellFounded_gt {s : Slice} :
    WellFounded fun (p q : s.Pos) => q < p

    Type alias for String.Slice.Pos representing that the given position is expected to decrease in recursive calls.

    Instances For
      def String.Slice.Pos.down {s : Slice} (p : s.Pos) :

      Use termination_by pos.down to signify that in a recursive call, the parameter pos is expected to decrease.

      Equations
      Instances For
        @[simp]
        theorem String.Slice.Pos.inner_down {s : Slice} {p : s.Pos} :
        theorem String.Slice.Pos.eq_next_of_next?_eq_some {s : Slice} {p q : s.Pos} (h : p.next? = some q) :
        q = p.next
        theorem String.Slice.Pos.eq_prev_of_prev?_eq_some {s : Slice} {p q : s.Pos} (h : p.prev? = some q) :
        q = p.prev
        @[simp]
        theorem String.Slice.Pos.le_refl {s : Slice} (p : s.Pos) :
        p p
        theorem String.Slice.Pos.lt_trans {s : Slice} {p q r : s.Pos} :
        p < qq < rp < r
        @[simp]
        theorem String.Slice.Pos.lt_next_next {s : Slice} {p : s.Pos} {h : p s.endPos} {h' : p.next h s.endPos} :
        p < (p.next h).next h'
        @[simp]
        theorem String.Slice.Pos.prev_prev_lt {s : Slice} {p : s.Pos} {h : p s.startPos} {h' : p.prev h s.startPos} :
        (p.prev h).prev h' < p

        The number of bytes between p and the end position. This number decreases as p advances.

        Equations
        Instances For

          Type alias for String.ValidPos representing that the given position is expected to decrease in recursive calls.

          Instances For

            Use termination_by pos.down to signify that in a recursive call, the parameter pos is expected to decrease.

            Equations
            Instances For
              @[simp]
              theorem String.ValidPos.eq_next_of_next?_eq_some {s : String} {p q : s.ValidPos} (h : p.next? = some q) :
              q = p.next
              theorem String.ValidPos.eq_prev_of_prev?_eq_some {s : String} {p q : s.ValidPos} (h : p.prev? = some q) :
              q = p.prev
              @[simp]
              theorem String.ValidPos.le_refl {s : String} (p : s.ValidPos) :
              p p
              theorem String.ValidPos.lt_trans {s : String} {p q r : s.ValidPos} :
              p < qq < rp < r
              theorem String.ValidPos.le_trans {s : String} {p q r : s.ValidPos} :
              p qq rp r
              theorem String.ValidPos.le_of_lt {s : String} {p q : s.ValidPos} :
              p < qp q
              @[simp]
              theorem String.ValidPos.lt_next_next {s : String} {p : s.ValidPos} {h : p s.endValidPos} {h' : p.next h s.endValidPos} :
              p < (p.next h).next h'
              @[simp]
              theorem String.ValidPos.prev_prev_lt {s : String} {p : s.ValidPos} {h : p s.startValidPos} {h' : p.prev h s.startValidPos} :
              (p.prev h).prev h' < p
              theorem String.ValidPos.Splits.remainingBytes_eq {s : String} {p : s.ValidPos} {t₁ t₂ : String} (h : p.Splits t₁ t₂) :
              theorem String.Slice.Pos.Splits.remainingBytes_eq {s : Slice} {p : s.Pos} {t₁ t₂ : String} (h : p.Splits t₁ t₂) :