anchor.diff:  ;;; We represent the automaton as nested lists.  We deliberately avoid
   ;;; using classes so as to avoid circular dependencies.
   
  -;;; A STATE of the automaton is either a FINAL STATE or an INTERNAL
  +;;; A STATE of the automaton is either a FINAL state or an INTERNAL
   ;;; state.  A final state has no transitions associated with it, and
  -;;; instead it has a TAG which is a non-NIL atom.  Final states with
  -;;; identical (EQ) tags are considered equivalent.  An internal state
  -;;; has a list of transitions associated with it.  During construction
  -;;; of the automaton, some internal states may have an empty list of
  +;;; instead it has a ACTION.  Final states with identical (EQ) actions
  +;;; are considered equivalent.  An internal state has a list of
  +;;; transitions associated with it.  During construction of the
  +;;; automaton, some internal states may have an empty list of
   ;;; transitions, but in the final automaton, every internal state has
   ;;; a non-empty list of transitions associated with it.  There can
   ;;; never be two transitions in a state with the same label (see
   ;;; below).  Two internal states with the same set of transitions
   ;;; (same number of transitions, same labels, leading to equivalent
  -;;; states) are considered equivalent.  A state is represented as a
  -;;; CONS cell.  The CAR of the cell is initially NIL and will later be
  -;;; used to hold a GENSYMed NAME of the state.  If the state is a
  -;;; final state, then the CDR of the CONS cell contains the tag.  If
  -;;; the state is an internal state, the CDR of the CONS cell contains
  -;;; the list of transitions.
  +;;; states) are considered equivalent.  A state is represented as two
  +;;; CONS cells.  The CAR of the first cell contains either :INTERNAL
  +;;; or :FINAL according to whether the state is an internal or a final
  +;;; state.  The CAR of the second cell is initially NIL and will later
  +;;; be used to hold a GENSYMed NAME of the state.  If the state is a
  +;;; final state, then the CDR of the second CONS cell contains the
  +;;; action.  If the state is an internal state, the CDR of the second
  +;;; CONS cell contains the list of transitions.
   
   ;;; FIXME: We are using the following standard Common Lisp functions
   ;;; that are defined to work on sequences, rather than just lists:
  
positive.code:     result))
  
  ;;; Given an automaton, a list of transition labels (of length N) and
  ;;; a tag of a final state, add states and transitions to the
  ;;; automaton, so that there exists a path from the initial state to a
  ;;; final state with the given tag.
  ;;;
  ;;; The automaton must not already contain a path from the initial
  ;;; state to a final state with the labels given, not even to a final
  ;;; state with the same tag as the one given. 
  (defun add-path (automaton labels tag)
    (let ((state (car (layer-states (car automaton)))))
      (pop automaton)
      ;; Follow transitions in the automaton until we find a state where
  
negative.code:   (assert (internal-state-p state))
    (setf (cddr state) new-transitions))
  
  (defun make-final-state (action)
    (list* :final nil action))
  
  (defun final-state-p (state)
    (eq (car state) :final))
  
  (defun state-action (state)
    (assert (final-state-p state))
    (cddr state))
  
  