anchor.diff:  
   (defun A*-search (action heuristic goalp initial-state)
     (labels ((expand (node fringe)
  -             (mapcar (lambda (direction-state-cost)
  -                       (let ((direction (aref direction-state-cost 0))
  -                             (state (aref direction-state-cost 1))
  -                             (cost (aref direction-state-cost 2))
  -                             (depth (node-depth node)))
  -                         (make-node :state state
  -                                    :parent node
  -                                    :direction direction
  -                                    :path-cost (+ depth cost)
  -                                    :depth (1+ depth))))
  -                     (remove-if (lambda (temp-triple)
  -                                  (let ((heap-pos (fringe-find fringe (aref temp-triple 2))))
  -                                    (and heap-pos
  -                                         (equal (node-state heap-pos) (aref temp-triple 2)))))
  -                                (mapcar (lambda (state-direction)
  -                                          (let ((state (car state-direction))
  -                                                (direction (cdr state-direction)))
  -                                            (vector direction state (funcall heuristic state))))
  -                                        (funcall action (node-state node) (node-direction node))))))
  +             (remove-if (lambda (new-node)
  +                          (fringe-existp fringe new-node))
  +                        (mapcar (lambda (state-direction)
  +                                  (let* ((state (car state-direction))
  +                                         (direction (cdr state-direction))
  +                                         (cost (funcall heuristic state))
  +                                         (depth (1+ (node-depth node))))
  +                                    (make-node :state state
  +                                               :parent node
  +                                               :direction direction
  +                                               :path-cost (+ depth cost)
  +                                               :depth depth)))
  +                                (funcall action (node-state node) (node-direction node)))))
              (search-iter (fringe)
                (let ((node (fringe-remove fringe)))
                  (if (funcall goalp (node-state node))
                      (list (direction-sequence node) (node-depth node))
                    (search-iter (fringe-insert fringe (expand node fringe)))))))
       (search-iter (fringe-insert (make-fringe :key #'node-path-cost)
  -                                (list (make-node :state initial-state))))))
  +                                (list (make-node :state initial-state
  +                                                 :path-cost (funcall heuristic initial-state)))))))
   
   (defun IDA*-search (action heuristic goalp initial-state)
     (let ((max-cost-limit 105)
  
positive.code:                (mapcar (lambda (state-direction)
                           (let ((state (car state-direction))
                                 (direction (cdr state-direction))
                                 (depth (node-depth node)))
                             (make-node :state state
                                        :parent node
                                        :direction direction
                                        :depth (1+ depth))))
                         (funcall action (node-state node) (node-direction node))))
               (search-iter (fringe cost-limit next-cost-limit)
                 (if (null fringe)
  
negative.code:                    (safety 0)
                     (debug 0)))
  
  (defstruct fringe
    (minimum 0)
    (key #'identity)
    (elements (make-array 1024 :fill-pointer 0 :adjustable t)))
  
  (defun fringe-existp (f item)
    (let ((elements (fringe-elements f))
          (key (funcall (fringe-key f) item)))
      ;; No need to consider case `key<minimum`
      (if (<= (fill-pointer elements) key)
          nil
        (member item (aref elements key)))))
  
  (defun fringe-remove (f)
    (let ((elements (fringe-elements f)))
      (loop while (null (aref elements (fringe-minimum f))) do
            (incf (fringe-minimum f) 1))
      (let* ((min-item (car (aref elements (fringe-minimum f)))))
        (setf (aref elements (fringe-minimum f)) (cdr (aref elements (fringe-minimum f))))
        min-item)))
  
  (defun fringe-insert (f items)
    (mapc (lambda (item)
            (let ((elements (fringe-elements f))
                  (key (funcall (fringe-key f) item)))
              (loop while (<= (fill-pointer elements) key) do
                    (vector-push-extend nil elements))
              (setf (aref elements key) (cons item (aref elements key)))))
          items)
    f)
  
  (defstruct node
    state
  