not (is_in_subst m subst))
varlist
;;
+
+ let rec apply_subst subst = function
+ | (Terms.Leaf _) as t -> t
+ | Terms.Var i ->
+ (match lookup_subst i subst with
+ | Terms.Node _ as t -> apply_subst subst t
+ | t -> t)
+ | (Terms.Node l) ->
+ Terms.Node (List.map (fun t -> apply_subst subst t) l)
+;;
+
+ let concat x y = x @ y;;
end