fact: Fixpoint index (n : nat) (s1 s2 : string) : option nat := match s2, n with | EmptyString, O => match s1 with | EmptyString => Some O | String a s1' => None end | EmptyString, S n' => None | String b s2', O => if prefix s1 s2 then Some O else match index O s1 s2' with | Some n => Some (S n) | None => None end | String b s2', S n' => match index n' s1 s2' with | Some n => Some (S n) | None => None end end.
imports: Arith Ascii Bool Coq.Strings.Byte