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

Lemma CMinSel_at_external_halted_excl : forall q, CMinSel_at_external q = None \/ CMinSel_halted q = None.