Proof with (try discriminate).
unfold comparison_type, sem_cmp; intros.
assert (X: forall b, wt_val (Val.of_bool b) (Tint I32 Signed noattr)).
{
intros b; destruct b; constructor; exact I.
}
assert (Y: forall ob, option_map Val.of_bool ob = Some v -> wt_val v (Tint I32 Signed noattr)).
{
intros ob EQ. destruct ob as [b|]; inv EQ. eauto.
}
destruct (classify_cmp ty1 ty2).
- inv H; eauto.
- DestructCases; eauto.
- DestructCases; eauto.
- DestructCases; eauto.
- DestructCases; eauto.
- unfold sem_binarith in H0.
set (ty' := Cop.binarith_type (classify_binarith ty1 ty2)) in *.
destruct (sem_cast v1 ty1 ty') as [v1'|]...
destruct (sem_cast v2 ty2 ty') as [v2'|]...
DestructCases; auto.
Qed.

Lemma rred_same_type:
forall ge a m t a' m',
rred ge a m t a' m' -> typeof a' = typeof a.