fact: Definition rr_match {E} (rr : list (itree ((spawnE E) +' E) unit) -> itree E unit) (q:list (itree ((spawnE E) +' E) unit)) : itree E unit := match q with | [] => Ret tt | t::ts => match observe t with | RetF _ => Tau (rr ts) | TauF u => Tau (rr (ts ++ [u])) | @VisF _ _ _ X o k => match o with | inl1 s => match s in spawnE _ Y return X = Y -> itree E unit with | (Spawn u) => fun pf => Tau (rr (ts ++ [u] ++ [k (eq_rect_r (fun T => T) tt pf)])) end eq_refl | inr1 o => Vis o (fun x => rr (ts ++ [k x])) end end end.
imports: Coq(List) ITree(Core.ITreeDefinition Indexed.Sum Subevent)