[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error with LET:

I'm sorry that I don't have the exact error message, as I'm currently
posting from my unix account on campus, but I couldn't get CLISP 
to accept the following code that akcl seems OK with.

(defun get-mgu (p1 p2 o)
  "This function takes as input a pair of terms p1 p2 and a substitution 
set o and returns a Most General Unifier (MGU) of the pair IF they are 
unifiable.  Otherwise, it returns nil."
  (let ((po1 nil)             ; Apply substitution o
	(po2 nil)             ; Apply substitution o
	(Diff nil)
	(vterm nil))          ; unifier for Diff
    (setq po1 (apply-sub o p1))
    (setq po2 (apply-sub o p2))
    (setq Diff (get-disagreement-set po1 po2))
    (setq vterm (set-vterm Diff))
    (if (equal po1 po2)
	o ; Return MGU
      (if (null vterm)               ; So is not unifiable
	  nil                     ; repeat with composition of vt and o
	(get-mgu po1 po2 (composition (list vterm) o))))

The error message had something to do with a bad variable assignment in my
LET statement.  This code includes a number of functions that I have defined
elsewhere, so those aren't important, but is there a problem with my
LET structure?  Am I using a system variable or something, or is this just
a case where CLISP is not 100% compatible with Common Lisp (or is akcl not

If this isn't enough to go on, I will post the exact error message later.

Any help appreciated.