Builds a proof of String.ofList l₁ ≠ String.ofList l₂ for two distinct string literals.
The proof is String.Internal.ofList_ne_ofList l₁ l₂ i (Eq.refl false) where i is the first
position where the two strings differ. If one of them is a prefix of the other, i is the length
of the shorter one.
To check it, the kernel evaluates String.Internal.sameCharAt i l₁ l₂, which traverses the first
i elements of the two lists simultaneously without comparing them, and then compares the
characters at position i. It does not unfold String.decEq.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the code of the string s: the value of String.Internal.code s.
See String.Internal.codeOfList.
Equations
- Lean.Meta.stringLitCode s = List.foldr (fun (c : Char) (n : Nat) => c.toNat + 1 + 2097152 * n) 0 s.toList
Instances For
Builds a proof of String.Internal.code s = n for the string literal s, where n is the
numeral stringLitCode s. Returns n and the proof.
To check it, the kernel evaluates String.Internal.codeOfList on the list of characters of s.
Equations
- One or more equations did not get rendered due to their size.