Skip to main content

🦏 Sc_rollup_commitment_repr.v

Proofs

See code, Gitlab , OCaml

Require Import CoqOfOCaml.CoqOfOCaml.
Require Import CoqOfOCaml.Settings.

Require Import TezosOfOCaml.Environment.V7.
Require TezosOfOCaml.Proto_alpha.Sc_rollup_commitment_repr.

Require TezosOfOCaml.Environment.V7.Proofs.Data_encoding.
Require TezosOfOCaml.Proto_alpha.Proofs.Sc_rollup_repr.

Module Hash.
  Lemma encoding_is_valid :
    Data_encoding.Valid.t (fun _True)
      Sc_rollup_commitment_repr.Hash.encoding.
  Proof.
    apply Blake2B.Make_is_valid.
  Qed.
  #[global] Hint Resolve encoding_is_valid : Data_encoding_db.

[compare] function is valid
  Lemma compare_is_valid :
    Compare.Valid.t (fun _True) id Sc_rollup_commitment_repr.Hash.compare.
  Proof. apply Blake2B.Make_is_valid. Qed.
  #[global] Hint Resolve compare_is_valid : Compare_db.
End Hash.

Module V1.
  Module Valid.
    Import Sc_rollup_commitment_repr.V1.t.

    Record t (x : Sc_rollup_commitment_repr.V1.t) : Prop := {
      inbox_level : Raw_level_repr.Valid.t x.(inbox_level);
    }.
  End Valid.

The encoding [V1.encoding] is valid.
  Lemma encoding_is_valid :
    Data_encoding.Valid.t Valid.t Sc_rollup_commitment_repr.V1.encoding.
  Proof.
    Data_encoding.Valid.data_encoding_auto.
  Qed.
  #[global] Hint Resolve encoding_is_valid : Data_encoding_db.

  Module genesis_info.
    Module Valid.
      Import Proto_alpha.Sc_rollup_commitment_repr.V1.genesis_info.

Validity predicate for [genesis_info].
      Record t (x : Sc_rollup_commitment_repr.V1.genesis_info) : Prop := {
        level : Raw_level_repr.Valid.t x.(level);
      }.
    End Valid.
  End genesis_info.

The encoding [V1.genesis_info_encoding] is valid.
  Lemma genesis_info_encoding_is_valid :
    Data_encoding.Valid.t genesis_info.Valid.t
      Sc_rollup_commitment_repr.V1.genesis_info_encoding.
  Proof.
    Data_encoding.Valid.data_encoding_auto.
  Qed.
  #[global] Hint Resolve genesis_info_encoding_is_valid : Data_encoding_db.
End V1.