(** * Soundness of operations over value numberings *)

Remark wf_equation_incr:
  forall next1 next2 e,
  wf_equation next1 e -> Ple next1 next2 -> wf_equation next2 e.(** Extensionality with respect to valuations. *)

Definition valu_agree (valu1 valu2: valuation) (upto: valnum) :=
  forall v, Plt v upto -> valu2 v = valu1 v.

(* Specifications: *)
Lemma valnums_val_exten: forall vl, (forall v, In v vl -> Plt v upto) -> map valu2 vl = map valu1 vl.
Lemma rhs_eval_to_exten: forall r v, rhs_eval_to valu1 ge sp m r v -> (forall v, In v (valnums_rhs r) -> Plt v upto) -> rhs_eval_to valu2 ge sp m r v.
Lemma equation_holds_exten: forall e, equation_holds valu1 ge sp m e -> wf_equation upto e -> equation_holds valu2 ge sp m e.
Lemma numbering_holds_exten: forall n, numbering_holds valu1 ge sp rs m n -> Ple n.(num_next) upto -> numbering_holds valu2 ge sp rs m n.