Library mcertikos.proc.EPTOpGenLink

Require Import LinkTemplate.
Require Import VEPTOp.
Require Import EPTOpGen.
Require Import EPTOpGenLinkSource.
Require Import VEPTIntro.
Require Import VEPTIntroCSource.
Require Import VEPTIntroCode.
Require Import VEPTIntroCodeEPTInit.

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

  Lemma init_correct:
    init_correct_type VEPTOp_module eptintro eptop.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type VEPTOp_module eptintro eptop.
  Proof.
    link_correct_aux.
    - link_cfunction
        ept_get_page_entry_spec_ref
        EPTINTROCODE.ept_get_page_entry_code_correct.
    - link_cfunction
        ept_set_page_entry_spec_ref
        EPTINTROCODE.ept_set_page_entry_code_correct.
    - link_cfunction
        ept_add_mapping_spec_ref
        EPTINTROCODE.ept_add_mapping_code_correct.
    - link_cfunction
        ept_init_spec_ref
        EPTINTROCODEEPTINIT.ept_init_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type VEPTOp_module eptintro eptop.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type VEPTOp_module eptintro eptop.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.