(** 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_switch_incr:
forall s1 s2, state_incr s1 s2 ->
forall map r nexits t ns,
tr_switch s1.(st_code) map r nexits t ns ->
tr_switch s2.(st_code) map r nexits t ns.
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_switch_charact:
forall map r nexits t s ns s' incr,
map_valid map s -> reg_valid r s ->
transl_switch r nexits t s = OK ns s' incr ->
tr_switch s'.(st_code) map r nexits t ns.
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.