Definition term_from_active_term (t: active_term) : term :=
let (f, lv) := t in
fapply f (map (@term_from_value _ _ _) lv).
Definition value_list_order (lv lv' : list value) : Prop :=
suml (map (@value_size _) lv) < suml (map (@value_size _) lv').

Lemma unify_list_unify_unify_list :
forall s s' v lv p lp,
unify_list_aux s (v :: lv) (p :: lp) = Some s' ->
exists s'', unify s v p = Some s'' /\ unify_list_aux s'' lv lp = Some s'.