(** A variant of [transl_expr_charact], for use when the destination register is the one associated with a variable. *)

(* Specifications: *)
Lemma transl_expr_assign_charact:
forall id a map rd nd s ns s' INCR
(TR: transl_expr map a rd nd s = OK ns s' INCR)
(WF: map_valid map s)
(OK: reg_map_ok map rd (Some id)),
tr_expr s'.(st_code) map nil a ns nd rd (Some id).
Lemma alloc_optreg_map_ok:
forall map optid s1 r s2 i,
map_valid map s1 ->
alloc_optreg map optid s1 = OK r s2 i ->
reg_map_ok map r optid.
Lemma tr_exitexpr_incr:
forall s1 s2, state_incr s1 s2 ->
forall map a ns nexits,
tr_exitexpr s1.(st_code) map a ns nexits ->
tr_exitexpr s2.(st_code) map a ns nexits.
Lemma tr_stmt_incr:
forall s1 s2, state_incr s1 s2 ->
forall map s ns nd nexits ngoto nret rret,
tr_stmt s1.(st_code) map s ns nd nexits ngoto nret rret ->
tr_stmt s2.(st_code) map s ns nd nexits ngoto nret rret.
Lemma transl_exit_charact:
forall nexits n s ne s' incr,
transl_exit nexits n s = OK ne s' incr ->
nth_error nexits n = Some ne /\ s' = s.
Lemma transl_jumptable_charact:
forall nexits tbl s nl s' incr,
transl_jumptable nexits tbl s = OK nl s' incr ->
tr_jumptable nexits tbl nl /\ s' = s.
Lemma transl_exitexpr_charact:
forall nexits a map s ns s' INCR
(TR: transl_exitexpr map a nexits s = OK ns s' INCR)
(WF: map_valid map s),
tr_exitexpr s'.(st_code) map a ns nexits.
Lemma convert_builtin_res_charact:
forall map oty res s res' s' INCR
(TR: convert_builtin_res map oty res s = OK res' s' INCR)
(WF: map_valid map s),
tr_builtin_res map res res'.
Lemma transl_stmt_charact:
forall map stmt nd nexits ngoto nret rret s ns s' INCR
(TR: transl_stmt map stmt nd nexits ngoto nret rret s = OK ns s' INCR)
(WF: map_valid map s)
(OK: return_reg_ok s map rret),
tr_stmt s'.(st_code) map stmt ns nd nexits ngoto nret rret.
Lemma transl_function_charact:
forall f tf,
transl_function f = Errors.OK tf ->
tr_function f tf.