Library mcertikos.mcslock.MCSLockAbsIntroGenLink

Require Import LinkTemplate.
Require Import MMCSLockAbsIntro.
Require Import MCSLockAbsIntroGen.
Require Import MCSLockAbsIntroGenLinkSource.
Require Import MMCSLockIntro.
Require Import MMCSLockIntroCSource.
Require Import MMCSLockIntroCode.
Require Import MMCSLockIntroCodeMCSLockInit.

Section WITHCOMPCERTIKOS.
  Context `{compcertikos_prf: CompCertiKOS} `{real_params_prf: RealParams}.
  Context `{mcs_oracle_prop: MCSOracleProp}.

  Lemma init_correct:
    init_correct_type MMCSLockAbsIntro_module mmcslockintro mmcslockabsintro.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type MMCSLockAbsIntro_module mmcslockintro mmcslockabsintro.
  Proof.
    link_correct_aux.
    - link_cfunction ticket_lock_init_spec_ref MMCSLOCKINTROCODEMCSLOCKINIT.mcs_lock_init_code_correct.
    - link_cfunction mcs_get_next_spec_ref MMCSLOCKINTROCODE.mcs_get_next_code_correct.
    - link_cfunction mcs_set_next_spec_ref MMCSLOCKINTROCODE.mcs_set_next_code_correct.
    - link_cfunction mcs_get_busy_spec_ref MMCSLOCKINTROCODE.mcs_get_busy_code_correct.
    - link_cfunction mcs_set_busy_spec_ref MMCSLOCKINTROCODE.mcs_set_busy_code_correct.
    - link_cfunction mcs_swap_tail_spec_ref MMCSLOCKINTROCODE.mcs_swap_tail_code_correct.
    - link_cfunction mcs_cas_tail_spec_ref MMCSLOCKINTROCODE.mcs_cas_tail_code_correct.
    - link_cfunction mcs_lock_get_index_spec_ref MMCSLOCKINTROCODE.mcs_lock_get_index_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type MMCSLockAbsIntro_module mmcslockintro mmcslockabsintro.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type MMCSLockAbsIntro_module mmcslockintro mmcslockabsintro.
  Proof.
    make_program_exists link_correct_aux.
  Qed.

End WITHCOMPCERTIKOS.