Section EXTEN.
Variable valu1: valuation.
Variable upto: valnum.
Variable valu2: valuation.
Hypothesis AGREE: valu_agree valu1 valu2 upto.
Variable ge: genv.
Variable sp: val.
Variable rs: regset.
Variable m: mem.
End EXTEN.
Ltac splitall := repeat (match goal with |- _ /\ _ => split end).
Remark in_remove:
forall (A: Type) (eq: forall (x y: A), {x=y}+{x<>y}) x y l,
In y (List.remove eq x l) <-> x <> y /\ In y l.

Lemma add_rhs_holds:
forall valu1 ge sp rs m n rd rh rs',
numbering_holds valu1 ge sp rs m n ->
rhs_eval_to valu1 ge sp m rh (rs'#rd) ->
wf_rhs n.(num_next) rh ->
(forall r, r <> rd -> rs'#r = rs#r) ->
exists valu2, numbering_holds valu2 ge sp rs' m (add_rhs n rd rh).