Definition CSharpMin_halted (q : CSharpMin_core): option val :=
    match q with
       CSharpMin_Returnstate v Kstop => Some v
     | _ => None
    end.

Lemma CSharpMin_after_at_external_excl : forall retv q q', CSharpMin_after_external retv q = Some q' -> CSharpMin_at_external q' = None.