Declare Module MEMAX : MemoryInterpolationAxioms.Definition entrypoints_compose
  (ep12 ep23 ep13 : list (val * val * signature)): Prop :=
  forall v1 v3 sig, In (v1,v3,sig) ep13 =
    exists v2, In (v1,v2,sig) ep12 /\ In (v2,v3,sig) ep23.Inductive sem_compose_ord_eq_eq {D12 D23:Type}
  (ord12: D12 -> D12 -> Prop) (ord23: D23 -> D23 -> Prop) (C2:Type):
  (D12 * option C2 * D23) ->  (D12 * option C2 * D23) ->  Prop :=
| sem_compose_ord1 :
  forall (d12 d12':D12) (c2:C2) (d23:D23),
    ord12 d12 d12' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2,d23)
| sem_compose_ord2 :
  forall (d12 d12':D12) (c2 c2':C2) (d23 d23':D23),
    ord23 d23 d23' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2',d23').Inductive sem_compose_ord_eq_eq {D12 D23:Type}
  (ord12: D12 -> D12 -> Prop) (ord23: D23 -> D23 -> Prop) (C2:Type):
  (D12 * option C2 * D23) ->  (D12 * option C2 * D23) ->  Prop :=
| sem_compose_ord1 :
  forall (d12 d12':D12) (c2:C2) (d23:D23),
    ord12 d12 d12' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2,d23)
| sem_compose_ord2 :
  forall (d12 d12':D12) (c2 c2':C2) (d23 d23':D23),
    ord23 d23 d23' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2',d23').Inductive sem_compose_ord_eq_eq {D12 D23:Type}
  (ord12: D12 -> D12 -> Prop) (ord23: D23 -> D23 -> Prop) (C2:Type):
  (D12 * option C2 * D23) ->  (D12 * option C2 * D23) ->  Prop :=
| sem_compose_ord1 :
  forall (d12 d12':D12) (c2:C2) (d23:D23),
    ord12 d12 d12' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2,d23)
| sem_compose_ord2 :
  forall (d12 d12':D12) (c2 c2':C2) (d23 d23':D23),
    ord23 d23 d23' -> sem_compose_ord_eq_eq ord12 ord23 C2 (d12,Some c2,d23) (d12',Some c2',d23').

Lemma diagram_eqeq: forall (core_data12 : Type) (match_core12 : core_data12 -> C1 -> C2 -> Prop) (core_ord12 : core_data12 -> core_data12 -> Prop) (core_diagram12 : forall (st1 : C1) (m : mem) (st1' : C1) (m' : mem), corestep Sem1 g1 st1 m st1' m' -> forall (d : core_data12) (st2 : C2), match_core12 d st1 st2 -> exists st2' : C2, exists d' : core_data12, match_core12 d' st1' st2' /\ (corestep_plus Sem2 g2 st2 m st2' m' \/ corestep_star Sem2 g2 st2 m st2' m' /\ core_ord12 d' d)) (core_data23 : Type) (match_core23 : core_data23 -> C2 -> C3 -> Prop) (core_ord23 : core_data23 -> core_data23 -> Prop) (core_diagram23 : forall (st1 : C2) (m : mem) (st1' : C2) (m' : mem), corestep Sem2 g2 st1 m st1' m' -> forall (d : core_data23) (st2 : C3), match_core23 d st1 st2 -> exists st2' : C3, exists d' : core_data23, match_core23 d' st1' st2' /\ (corestep_plus Sem3 g3 st2 m st2' m' \/ corestep_star Sem3 g3 st2 m st2' m' /\ core_ord23 d' d)) (c1 : C1) (m1 : mem) (c1' : C1) (m1' : mem) (CS1 : corestep Sem1 g1 c1 m1 c1' m1') (d12 : core_data12) (d23 : core_data23) (c3 : C3) (c2 : C2) (MC12 : match_core12 d12 c1 c2) (MC23 : match_core23 d23 c2 c3), exists st2' : C3, exists d' : core_data12 * option C2 * core_data23, (let (y, d2) := d' in let (d1, X) := y in exists c0 : C2, X = Some c0 /\ match_core12 d1 c1' c0 /\ match_core23 d2 c0 st2') /\ (corestep_plus Sem3 g3 c3 m1 st2' m1' \/ corestep_star Sem3 g3 c3 m1 st2' m1' /\ clos_trans (core_data12 * option C2 * core_data23) (sem_compose_ord_eq_eq core_ord12 core_ord23 C2) d' (d12, Some c2, d23)).