anchor.diff:  ;;; Returns next possible state
   ;;; given current state and one of the
   ;;; possible moves.
  -(defun get-next-state (m c state-stack move-idx)
  +(defun get-next-state (state-stack move-idx)
     (let* ((current-state (first state-stack))
            (move (nth move-idx
                       (if (getf current-state :has-boat)
  
positive.code: ;;; and second is the index of the move taken.
  ;;; If not found, returns 2 values, first nil, second is the size
  ;;; of the moves list.
  (defun find-next-state (m c states-stack)
    (unless (or (null states-stack) (winning-state-p (first states-stack)))
      (let ((current-state (first states-stack)))
        (when current-state
          (loop
             for move-idx from (getf current-state :branch-idx) to (1- (length (getf *valid-moves* :with-boat)))
             for next-state = (get-next-state m c states-stack move-idx) then (get-next-state m c states-stack move-idx)
             when next-state return (values next-state move-idx))))))
  
  ;;; This returns a new states stack given current one
  ;;; First 2 parameters are initial number of missionaries and cannibals
  ;;; on the left side of the river.
  (defun solve-next-move (m c states-stack)
    (multiple-value-bind (next-state idx)
        (find-next-state m c states-stack)
      (cond
        ;; No next state
        ;; In that case, return a state stack with last state removed
  
negative.code:   (states-equal-p *winning-state* a-state))
  
  (defmacro new-state (&rest rest)
    `(list ,@rest :branch-idx 0))
  
  (declaim (inline visited-state-p))
  (declaim (inline valid-state-p))
  