Definition subst_fresh (vs: A -> val) (xs: list A) : subst :=
      fun x' => if (List.anyb (rel_dec x')) xs then V_expr (vs x') else stack_get x'.Fixpoint subst_fresh_l (vs: A -> val) (xs: list A) : list (@expr A val) :=
      match xs with
      | nil => nil
      | cons x xs' => cons (V_expr (vs x)) (subst_fresh_l vs xs')
      end.

(* Specifications: *)
Lemma subst_fresh_alt (vs: A -> val) (xs: list A) : subst_fresh vs xs = substl (combine xs (subst_fresh_l vs xs)).