consolidated unify.scm and constraints.scm