Library mcertikos.mcslock.QMCSLockOpGenLink

Require Import LinkTemplate.
Require Import MQMCSLockOp.
Require Import QMCSLockOpGen.
Require Import QMCSLockOpGenLinkSource.
Require Import MMCSLockOp.

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

  Lemma init_correct:
    init_correct_type MQMCSLockOp_module mmcslockop mqmcslockop.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type MQMCSLockOp_module mmcslockop mqmcslockop.
  Proof.
    link_correct_aux.
    - match goal with |- _ _ _ ?R ?x ?ychange (sim R x y) end.
      apply lower_bound.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type MQMCSLockOp_module mmcslockop mqmcslockop.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type MQMCSLockOp_module mmcslockop mqmcslockop.
  Proof.
    make_program_exists link_correct_aux.
  Qed.

End WITHCOMPCERTIKOS.