Section MAKE_BIN.
Variable sem_int: signedness -> int -> int -> option val.
Variable sem_long: signedness -> int64 -> int64 -> option val.
Variable sem_float: float -> float -> option val.
Variables iop iopu fop lop lopu: binary_operation.
Hypothesis iop_ok:
forall x y m, eval_binop iop (Vint x) (Vint y) m = sem_int Signed x y.
Hypothesis iopu_ok:
forall x y m, eval_binop iopu (Vint x) (Vint y) m = sem_int Unsigned x y.
Hypothesis lop_ok:
forall x y m, eval_binop lop (Vlong x) (Vlong y) m = sem_long Signed x y.
Hypothesis lopu_ok:
forall x y m, eval_binop lopu (Vlong x) (Vlong y) m = sem_long Unsigned x y.
Hypothesis fop_ok:
forall x y m, eval_binop fop (Vfloat x) (Vfloat y) m = sem_float x y.
End MAKE_BIN.
Hint Extern 2 (@eq (option val) _ _) => (simpl; reflexivity) : cshm.
Ltac comput val :=
let x := fresh in set val as x in *; vm_compute in x; subst x.
Remark small_shift_amount_1:
forall i,
Int64.ltu i Int64.iwordsize = true ->
Int.ltu (Int64.loword i) Int64.iwordsize' = true
/\ Int64.unsigned i = Int.unsigned (Int64.loword i).
Remark small_shift_amount_2:
forall i,
Int64.ltu i (Int64.repr 32) = true ->
Int.ltu (Int64.loword i) Int.iwordsize = true.

Lemma make_cmp_correct:
forall cmp a tya b tyb c va vb v e le m,
sem_cmp cmp va tya vb tyb m = Some v ->
make_cmp cmp a tya b tyb = OK c ->
eval_expr ge e le m a va ->
eval_expr ge e le m b vb ->
eval_expr ge e le m c v.