Library mcertikos.ticketlog.HTicketLockOpGenLink

Require Import LinkTemplate.
Require Import MHTicketLockOp.
Require Import HTicketLockOpGen.
Require Import HTicketLockOpGenLinkSource.
Require Import MQTicketLockOp.

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 MHTicketLockOp_module mqticketlockop mhticketlockop.
  Proof.
    init_correct.
    - eapply relateticket.
    - econstructor; eauto.
      intros.
      rewrite !Maps.ZMap.gi.
      constructor.
  Qed.

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

  Theorem make_program_exists:
    make_program_exist_type MHTicketLockOp_module mqticketlockop mhticketlockop.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.