intuition.
unfold RepeatCore_G, DM_RC_G1.
comp_skip.
comp_simp.
assert (evalDist (b0 <-$ Repeat (c a) P; A2 a0 b0) x
==
evalDist (p <-$ (b0 <-$ Repeat (c a) P; b <-$ A2 a0 b0; ret (b0, b)); ret (snd p)) x).
inline_first.
comp_skip.
inline_first.
rewrite <- evalDist_right_ident.
comp_skip.
comp_simp.
simpl.
reflexivity.
rewrite H2.
comp_skip.
eapply repeat_fission; intuition.
eauto.
eauto.
Qed.
Definition DM_RC_G2(c : A -> Comp B) :=
[a, s_A] <-$2 A1;
p <-$ Repeat (b <-$ (c a); g <-$ (A2 s_A b); ret (b, g)) (fun p => P (fst p));
ret (Some (snd p)).

(* Specifications: *)
Theorem DM_RC_G2_equiv :
forall c x,
evalDist (DM_RC_G1 c) x == evalDist (DM_RC_G2 c) (Some x).