Update of /project/cl-unification/cvsroot/cl-unification In directory common-lisp.net:/tmp/cvs-serv20210
Modified Files: unifier.lisp Log Message: Fixed two major bugs reported by Norman Werver. Unification of strings and symbols and of numers and symbols was not recurring on VAR-UNIFY, as required; thus
(unify '(?x ?x) '("asd" "qweert")) and (unify '(foo ?x baz) '(foo 42 ?x))
would succed. The two cases are now fixed.
Date: Fri May 20 17:19:53 2005 Author: mantoniotti
Index: cl-unification/unifier.lisp diff -u cl-unification/unifier.lisp:1.2 cl-unification/unifier.lisp:1.3 --- cl-unification/unifier.lisp:1.2 Fri Jan 28 20:30:35 2005 +++ cl-unification/unifier.lisp Fri May 20 17:19:53 2005 @@ -94,15 +94,15 @@
(defmethod unify ((a symbol) (b string) &optional (env (make-empty-environment))) (cond ((variable-any-p a) env) - ((variablep a) (extend-environment a b env)) + ((variablep a) (var-unify a b env)) (t (error 'unification-failure - :format-control "Cannot unify a symbol with a string: ~S ~S." - :format-arguments (list a b))))) + :format-control "Cannot unify a symbol with a string: ~S ~S." + :format-arguments (list a b)))))
(defmethod unify ((b string) (a symbol) &optional (env (make-empty-environment))) (cond ((variable-any-p a) env) - ((variablep a) (extend-environment a b env)) + ((variablep a) (var-unify a b env)) (t (error 'unification-failure :format-control "Cannot unify a string with a symbol: ~S ~S." :format-arguments (list b a))))) @@ -121,13 +121,13 @@
(defmethod unify ((a symbol) (b t) &optional (env (make-empty-environment))) (cond ((variable-any-p a) env) - ((variablep a) (extend-environment a b env)) + ((variablep a) (var-unify a b env)) (t (call-next-method))))
(defmethod unify ((b t) (a symbol) &optional (env (make-empty-environment))) (cond ((variable-any-p a) env) - ((variablep a) (extend-environment a b env)) + ((variablep a) (var-unify a b env)) (t (call-next-method))))
cl-unification-cvs@common-lisp.net