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

(* Specifications: *)
Lemma CSharpMin_corestep_not_halted : forall ge m q m' q', CSharpMin_corestep ge q m q' m' -> CSharpMin_halted q = None.
Lemma CSharpMin_at_external_halted_excl : forall q, CSharpMin_at_external q = None \/ CSharpMin_halted q = None.
Lemma CSharpMin_after_at_external_excl : forall retv q q', CSharpMin_after_external retv q = Some q' -> CSharpMin_at_external q' = None.
Lemma CSharpMin_corestep_not_halted : forall ge m q m' q', CSharpMin_corestep ge q m q' m' -> CSharpMin_halted q = None.
Lemma CSharpMin_at_external_halted_excl : forall q, CSharpMin_at_external q = None \/ CSharpMin_halted q = None.
Lemma CSharpMin_after_at_external_excl : forall retv q q', CSharpMin_after_external retv q = Some q' -> CSharpMin_at_external q' = None.