Section CategoryTheory.
Context
{obj : Type} {C : obj -> obj -> Type}
{bif : obj -> obj -> obj}
{Eq2_C : Eq2 C}
`{forall a b, Equivalence (eq2 (a := a) (b := b))}
`{Category obj C (Eq2C := _)}
`{Coproduct obj C (Eq2_C := _) (Cat_C := _) bif}.
Local Lemma aux_app_asm_correct1 (I J A B : obj) :
(assoc_r >>>
bimap (id_ I) (assoc_l >>> bimap swap (id_ B) >>> assoc_r) >>>
assoc_l)
⩯ bimap swap (id_ (bif A B)) >>>
(assoc_r >>>
(bimap (id_ J) assoc_l >>>
(assoc_l >>> (bimap swap (id_ B) >>> assoc_r)))).
(** Denotes a list of instruction by binding the resulting trees. *)
Definition denote_list: list instr -> itree E unit :=
traverse_ denote_instr.

(** Correctness of the [raw_asm] operator. Its denotation is the same as the denotation of the block. Since it is hybrid between the level of [ktree]s (asm) and [itree]s (block), the correctness is established at both level for convenience. Note that the ⩯ notation in the scope of [ktree] desugars to [eutt_ktree], i.e. pointwise [eutt eq]. *)
Lemma raw_asm_block_correct_lifted {A} (b : block (fin A)) :
denote_asm (raw_asm_block b) ⩯
((fun _  => denote_bk b) : sub (ktree _) fin _ _).