Update of /project/cl-unification/cvsroot/cl-unification In directory clnet:/tmp/cvs-serv31810
Added Files: apply-substitution.lisp Log Message: See previous message.
--- /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2007/05/21 12:33:05 NONE +++ /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2007/05/21 12:33:05 1.1 ;;; -*- Mode: Lisp -*-
;;; substitutions.lisp ;;; General CL structures unifier. ;;; Substitution definitions.
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
;;;--------------------------------------------------------------------------- ;;; Substitution application.
(defgeneric apply-substitution (substitution item))
(defmethod apply-substitution ((substitution environment) (s symbol)) (cond ((variable-any-p s) s) ((variablep s) (multiple-value-bind (val foundp) (find-variable-value s substitution) (cond (foundp val) (t (warn "~S is a free variable in the current environment." s) s)))) (t s)))
(defmethod apply-substitution ((substitution environment) (l cons)) (cons (apply-substitution substitution (first l)) (apply-substitution substitution (rest l))))
(defmethod apply-substitution ((substitution environment) (l null)) '())
(export '(apply-substitution))
(defun ground-term (term &optional (substitution (make-empty-environment))) (apply-substitution substitution term))
;;; end of file -- apply-substitutions.lisp --
cl-unification-cvs@common-lisp.net