Equations
- String.toNat! s = if String.isNat s = true then String.foldl (fun n c => n * 10 + (Char.toNat c - Char.toNat (Char.ofNat 48))) 0 s else panicWithPosWithDecl "Init.Data.String.Extra" "String.toNat!" 20 4 "Nat expected"
@[simp]
@[simp]
theorem
String.pos_add_char
(p : String.Pos)
(c : Char)
:
(p + c).byteIdx = p.byteIdx + String.csize c
theorem
String.eq_empty_of_bsize_eq_zero
{s : String}
(h : String.endPos s = { byteIdx := 0 })
:
s = ""
theorem
String.Iterator.sizeOf_next_lt_of_hasNext
(i : String.Iterator)
(h : String.Iterator.hasNext i = true)
:
sizeOf (String.Iterator.next i) < sizeOf i
theorem
String.Iterator.sizeOf_next_lt_of_atEnd
(i : String.Iterator)
(h : ¬String.Iterator.atEnd i = true)
:
sizeOf (String.Iterator.next i) < sizeOf i