Basic Depth-first Search Algorithm


(defun search (state)
  (let (op oplist newstate)
    (if (terminalp state)
        (if (goalp state) '() 'failure)
        (progn
          (setq op (choose-op state))
          (setq newstate
                (funcall op state))
          (setq oplist (search newstate))
          (if (eq oplist 'failure)
              'failure
              (cons op oplist)) ) ) ))

Complications:

Contents    Page-10    Prev    Next    Page+10    Index