Program Fixpoint nat2string (n:nat) {measure n}: string :=
    match NPeano.Nat.ltb n modulus as x return NPeano.Nat.ltb n modulus = x -> string with
      | true => fun _ => String (digit2ascii n) EmptyString
      | false => fun pf =>
        let m := NPeano.Nat.div n modulus in
        append (nat2string m) (String (digit2ascii (n - modulus * m)) EmptyString)
    end (@Logic.eq_refl _ (NPeano.Nat.ltb n modulus)).Definition nat2string10 : nat -> string.Definition nat2string2 : nat -> string.Definition nat2string8 : nat -> string.Definition nat2string16 : nat -> string.Global Instance Foldable_string : Foldable string ascii :=
  fun _ f base =>
    fix go ls :=
    match ls with
    | EmptyString => base
    | String l ls =>
      f l (go ls)
    end.Inductive R_string_len : string -> string -> Prop :=
  | R_s_len : forall n m, length n < length m -> R_string_len n m.Inductive R_string_len : string -> string -> Prop :=
  | R_s_len : forall n m, length n < length m -> R_string_len n m.

(* Specifications: *)
Theorem wf_R_string_len : well_founded R_string_len.