Instance CompSpecs : compspecs.Definition Vprog : varspecs.Definition tqueue := Tstruct _queue noattr.Definition tqueue_t := Tstruct _queue_t noattr.Definition MAX := 10.(* Ghost histories in the style of
   History-based Verification of Functional Behaviour of Concurrent Programs,
   Blom, Huisman, and Zharieva-Stojanovski (VerCors)
   Twente tech report, 2015 *)

Inductive hist_el {A} := QAdd (p : val) (v : A) | QRem (p : val) (v : A).(* Ghost histories in the style of
   History-based Verification of Functional Behaviour of Concurrent Programs,
   Blom, Huisman, and Zharieva-Stojanovski (VerCors)
   Twente tech report, 2015 *)

Inductive hist_el {A} := QAdd (p : val) (v : A) | QRem (p : val) (v : A).(* Ghost histories in the style of
   History-based Verification of Functional Behaviour of Concurrent Programs,
   Blom, Huisman, and Zharieva-Stojanovski (VerCors)
   Twente tech report, 2015 *)

Inductive hist_el {A} := QAdd (p : val) (v : A) | QRem (p : val) (v : A).Notation hist A := (list (@hist_el A)).Parameter ghost : forall (sh : share) {t} (f : share * hist t) (p : val), mpred.Axiom ghost_share_join : forall sh1 sh2 sh t (h1 h2 : hist t) p, sepalg.join sh1 sh2 Tsh -> list_incl h1 h2 ->
  ghost sh1 (sh, h1) p * ghost sh2 (Tsh, h2) p = ghost Tsh (Tsh, h2) p.Definition surely_malloc_spec prog := DECLARE (ext_link_prog prog "surely_malloc") surely_malloc_spec'.Definition q_new_spec prog := DECLARE (ext_link_prog prog "q_new") q_new_spec'.Notation q_new_args t P := (existT (fun t => @reptype CompSpecs t -> Prop) t P).Definition q_del_spec prog := DECLARE (ext_link_prog prog "q_del") q_del_spec'.Notation q_rem_args t P h := (existT (fun t => ((@reptype CompSpecs t -> Prop) * hist (@reptype CompSpecs t))%type) t (P, h)).Definition q_add_spec prog := DECLARE (ext_link_prog prog "q_add") q_add_spec'.Notation q_add_args t P h v := (existT (fun t =>
  ((@reptype CompSpecs t -> Prop) * hist (@reptype CompSpecs t) * @reptype CompSpecs t)%type) t (P, h, v)).Definition q_remove_spec prog := DECLARE (ext_link_prog prog "q_remove") q_remove_spec'.Definition q_tryremove_spec prog := DECLARE (ext_link_prog prog "q_tryremove") q_tryremove_spec'.

Lemma interleave_trans : forall {A} ls1 ls2 (l' l'' : list A) (Hl' : interleave ls1 l') (Hl'' : interleave (l' :: ls2) l''), interleave (ls1 ++ ls2) l''.