Definition unify_list
  (s : list (variable * value)) (lv : list value) (lp : list pattern) :
  option (variable -> value) :=
  option_map (assoc_default (variable_beq variable_eq_dec) value_default) (unify_list_aux s lv lp).

Lemma unify_all_vars_defined : forall (s s': list (variable * value)) (v: value) (p: pattern), unify s v p = Some s' -> forall x, In x (vars_of_pattern p) -> assoc (variable_beq variable_eq_dec) x s' <> None.