Library mcertikos.ticketlog.QTicketLockOpGenLink

Require Import LinkTemplate.
Require Import MQTicketLockOp.
Require Import QTicketLockOpGen.
Require Import QTicketLockOpGenLinkSource.
Require Import MTicketLockOp.

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

  Lemma init_correct:
    init_correct_type MQTicketLockOp_module mticketlockop mqticketlockop.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type MQTicketLockOp_module mticketlockop mqticketlockop.
  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 MQTicketLockOp_module mticketlockop mqticketlockop.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type MQTicketLockOp_module mticketlockop mqticketlockop.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.