(** * Properties of operations over types *)

Remark transl_params_types:
  forall params,
  map typ_of_type (map snd params) = typlist_of_typelist (type_of_params params).

(* Specifications: *)
Lemma transl_fundef_sig1: forall ce f tf args res cc, match_fundef ce f tf -> classify_fun (type_of_fundef f) = fun_case_f args res cc -> funsig tf = signature_of_type args res cc.
Lemma transl_fundef_sig2: forall ce f tf args res cc, match_fundef ce f tf -> type_of_fundef f = Tfunction args res cc -> funsig tf = signature_of_type args res cc.
Lemma transl_sizeof: forall (cunit prog: Clight.program) t sz, linkorder cunit prog -> sizeof cunit.(prog_comp_env) t = OK sz -> sz = Ctypes.sizeof prog.(prog_comp_env) t.
Lemma transl_alignof: forall (cunit prog: Clight.program) t al, linkorder cunit prog -> alignof cunit.(prog_comp_env) t = OK al -> al = Ctypes.alignof prog.(prog_comp_env) t.
Lemma transl_alignof_blockcopy: forall (cunit prog: Clight.program) t sz, linkorder cunit prog -> sizeof cunit.(prog_comp_env) t = OK sz -> sz = Ctypes.sizeof prog.(prog_comp_env) t /\ alignof_blockcopy cunit.(prog_comp_env) t = alignof_blockcopy prog.(prog_comp_env) t.
Lemma transl_expr_lvalue: forall ge e le m a loc ofs ce ta, Clight.eval_lvalue ge e le m a loc ofs -> transl_expr ce a = OK ta -> (exists tb, transl_lvalue ce a = OK tb /\ make_load tb (typeof a) = OK ta).
Lemma transl_lbl_stmt_1: forall ce tyret nbrk ncnt n sl tsl, transl_lbl_stmt ce tyret nbrk ncnt sl = OK tsl -> transl_lbl_stmt ce tyret nbrk ncnt (Clight.select_switch n sl) = OK (select_switch n tsl).
Lemma transl_lbl_stmt_2: forall ce tyret nbrk ncnt sl tsl, transl_lbl_stmt ce tyret nbrk ncnt sl = OK tsl -> transl_statement ce tyret nbrk ncnt (seq_of_labeled_statement sl) = OK (seq_of_lbl_stmt tsl).
Lemma make_intconst_correct: forall n e le m, eval_expr ge e le m (make_intconst n) (Vint n).
Lemma make_floatconst_correct: forall n e le m, eval_expr ge e le m (make_floatconst n) (Vfloat n).
Lemma make_singleconst_correct: forall n e le m, eval_expr ge e le m (make_singleconst n) (Vsingle n).
Lemma make_longconst_correct: forall n e le m, eval_expr ge e le m (make_longconst n) (Vlong n).
Lemma make_ptrofsconst_correct: forall n e le m, eval_expr ge e le m (make_ptrofsconst n) (Vptrofs (Ptrofs.repr n)).
Lemma make_singleoffloat_correct: forall a n e le m, eval_expr ge e le m a (Vfloat n) -> eval_expr ge e le m (make_singleoffloat a) (Vsingle (Float.to_single n)).
Lemma make_floatofsingle_correct: forall a n e le m, eval_expr ge e le m a (Vsingle n) -> eval_expr ge e le m (make_floatofsingle a) (Vfloat (Float.of_single n)).
Lemma make_floatofint_correct: forall a n sg e le m, eval_expr ge e le m a (Vint n) -> eval_expr ge e le m (make_floatofint a sg) (Vfloat(cast_int_float sg n)).
Lemma make_cmpu_ne_zero_correct: forall e le m a n, eval_expr ge e le m a (Vint n) -> eval_expr ge e le m (make_cmpu_ne_zero a) (Vint (if Int.eq n Int.zero then Int.zero else Int.one)).
Lemma make_cmpu_ne_zero_correct_ptr: forall e le m a b i, eval_expr ge e le m a (Vptr b i) -> Archi.ptr64 = false -> Mem.weak_valid_pointer m b (Ptrofs.unsigned i) = true -> eval_expr ge e le m (make_cmpu_ne_zero a) Vone.
Lemma make_cast_int_correct: forall e le m a n sz si, eval_expr ge e le m a (Vint n) -> eval_expr ge e le m (make_cast_int a sz si) (Vint (cast_int_int sz si n)).
Lemma make_longofint_correct: forall e le m a n si, eval_expr ge e le m a (Vint n) -> eval_expr ge e le m (make_longofint a si) (Vlong (cast_int_long si n)).