chickadee » tree-rewrite » unify-trees

unify-trees TREE1 TREE2 ENVprocedure

A match/unification of two ordered trees, both of which may contain variables. The unifier is capable of finding cyclic substitutions. The trees may contain several occurrences of the same variable. All these occurrences must match the same value. A variable match is entered into the environment. A variable _ is an exception: its match is never entered into the environment. unify-trees returns the resulting environment or #f if the unification fails.