From Stdlib Require Export PrimString.
From Stdlib Require Export PrimStringAxioms.
From Stdlib.micromega Require Import Lia.
From Stdlib.micromega Require Import ZifyUint63.
From Stdlib.micromega Require Import Zify.
#[local] Open Scope Z_scope.
#[local] Open Scope list_scope.
#[local] Arguments to_Z _/ : simpl nomatch.
#[local] Instance Op_max_length : ZifyClasses.CstOp max_length :=
{ TCst := 16777211%Z ; TCstInj := eq_refl }.
Add Zify CstOp Op_max_length.
#[local] Ltac case_if :=
lazymatch goal with
| |- context C [if ?b then _ else _] => destruct b eqn:?
| H : context C [if ?b then _ else _] |- _ => destruct b eqn:?
end.
(** Derived properties of to_list and of_list. *)

(* Specifications: *)
Lemma to_list_inj (s1 s2 : string) :
to_list s1 = to_list s2 -> s1 = s2.
Lemma to_of_list (l : list char63) :
List.Forall char63_valid l ->
Z.of_nat (List.length l) <= to_Z max_length ->
to_list (of_list l) = l.