Definition CMinSel_halted (q : CMinSel_core): option val :=
    match q with
       CMinSel_Returnstate v Kstop => Some v
     | _ => None
    end.

Lemma CMinSel_after_at_external_excl : forall retv q q', CMinSel_after_external retv q = Some q' -> CMinSel_at_external q' = None.