Library mcertikos.mm.ContainerGenLink

Require Import LinkTemplate.
Require Import MContainer.
Require Import ContainerGen.
Require Import ContainerGenLinkSource.
Require Import MContainerIntro.
Require Import MContainerIntroCSource.
Require Import MContainerIntroCode.

Section WITHCOMPCERTIKOS.
  Context `{compcertikos_prf: CompCertiKOS} `{real_params_prf: RealParams}.
  Context `{multi_oracle_prop: MultiOracleProp}.

  Lemma init_correct:
    init_correct_type MContainer_module mcontainerintro mcontainer.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type MContainer_module mcontainerintro mcontainer.
  Proof.
    link_correct_aux.
    - link_cfunction container_init_spec_ref MCONTAINERINTROCODE.container_init_code_correct.
    - link_cfunction container_split_spec_ref MCONTAINERINTROCODE.container_split_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type MContainer_module mcontainerintro mcontainer.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type MContainer_module mcontainerintro mcontainer.
  Proof.
    make_program_exists link_correct_aux.
  Qed.

End WITHCOMPCERTIKOS.