Skip to main content

🇿 Zk_rollup_apply.v

Proofs

See code, Gitlab , OCaml

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

Require Import TezosOfOCaml.Environment.V8.

Require TezosOfOCaml.Proto_alpha.Proofs.Raw_context.
Require TezosOfOCaml.Proto_alpha.Proofs.Zk_rollup_storage.
Require TezosOfOCaml.Proto_alpha.Zk_rollup_apply.

The function [assert_feature_enabled] is valid.
Lemma assert_feature_enabled_is_valid ctxt :
  Raw_context.Valid.t ctxt
  letP? _ := Zk_rollup_apply.assert_feature_enabled ctxt in
  True.
Proof.
  intro H; Raw_context.Valid.destruct_rewrite H.
  unfold Zk_rollup_apply.assert_feature_enabled, error_unless.
  destruct (Alpha_context.Constants.zk_rollup_enable);
    [scongruence | hauto lq: on].
Qed.

The function [originate] is valid.
The function [publish] is valid
@TODO finish proof.
  intros H_bef_op H.
  unfold Zk_rollup_apply.publish.
  eapply Error.split_letP ; [
    apply Zk_rollup_apply.assert_feature_enabled_is_valid ; assumption |].
  intros _ _.
  eapply Error.split_letP with (fun _True). {
    destruct error_unless eqn:eq_error_unless ; [constructor |].
    rewrite <- eq_error_unless.
    destruct (for_all) ; constructor.
  }
  intros _ _.
Admitted.