Section EXPAND_INSTR.
Variable fe: funenv.
Hypothesis FE: fenv_agree fe.
Variable rec: forall fe', (size_fenv fe' < size_fenv fe)%nat -> context -> function -> mon unit.
Hypothesis rec_unchanged:
forall fe' (L: (size_fenv fe' < size_fenv fe)%nat) ctx f s x s' i pc,
rec fe' L ctx f s = R x s' i ->
Ple ctx.(dpc) s.(st_nextnode) ->
Plt pc ctx.(dpc) ->
s'.(st_code)!pc = s.(st_code)!pc.
Remark set_instr_other:
forall pc instr s x s' i pc',
set_instr pc instr s = R x s' i ->
pc' <> pc ->
s'.(st_code)!pc' = s.(st_code)!pc'.
Remark set_instr_same:
forall pc instr s x s' i c,
set_instr pc instr s = R x s' i ->
c!(pc) = s'.(st_code)!pc ->
c!(pc) = Some instr.
Hypothesis rec_spec:
forall fe' (L: (size_fenv fe' < size_fenv fe)%nat) ctx f s x s' i c,
rec fe' L ctx f s = R x s' i ->
fenv_agree fe' ->
Ple (ctx.(dpc) + max_pc_function f) s.(st_nextnode) ->
ctx.(mreg) = max_reg_function f ->
Ple (Pos.add ctx.(dreg) ctx.(mreg)) s.(st_nextreg) ->
ctx.(mstk) >= 0 ->
ctx.(mstk) = Z.max (fn_stacksize f) 0 ->
(min_alignment (fn_stacksize f) | ctx.(dstk)) ->
ctx.(dstk) >= 0 ->
s'.(st_stksize) <= stacksize ->
(forall pc, Ple ctx.(dpc) pc -> Plt pc s'.(st_nextnode) -> c!pc = s'.(st_code)!pc) ->
tr_funbody ctx f c.
Remark min_alignment_pos:
forall sz, min_alignment sz > 0.
Ltac inv_incr :=
match goal with
| [ H: sincr _ _ |- _ ] => destruct H; inv_incr
| _ => idtac
end.

Lemma iter_expand_instr_spec:
forall ctx l s x s' i c,
mlist_iter2 (expand_instr fe rec ctx) l s = R x s' i ->
list_norepet (List.map (@fst _ _) l) ->
(forall pc instr r, In (pc, instr) l -> instr_defs instr = Some r -> Ple r ctx.(mreg)) ->
(forall pc instr, In (pc, instr) l -> Plt (spc ctx pc) s.(st_nextnode)) ->
Ple (ctx.(dreg) + ctx.(mreg)) s.(st_nextreg) ->
ctx.(mstk) >= 0 -> ctx.(dstk) >= 0 ->
s'.(st_stksize) <= stacksize ->
(forall pc', Ple s.(st_nextnode) pc' -> Plt pc' s'.(st_nextnode) -> c!pc' = s'.(st_code)!pc') ->
(forall pc instr, In (pc, instr) l -> c!(spc ctx pc) = s'.(st_code)!(spc ctx pc)) ->
forall pc instr, In (pc, instr) l -> tr_instr ctx pc instr c.