type var = int type t = | Var of var | Const of string | Free of string | Function of string * t list type match_result = All of t | Some of t | None | MatchErr val merge_result : match_result -> match_result -> match_result val match_term : t -> t -> t -> match_result val inc_var : t -> t val occurs : t -> t -> bool val to_string : string list -> t -> string