anchor.diff:                                            (kells-in process)
                                             substitutions)
                               (setf substitutions subst)
  -                            procs))
  -                  substitutions))))
  +                            procs)))
  +          substitutions)))
  +
  +(defun match-list (type-function patterns processes substitutions)
  +  "Finds one match in PROCESSES for each item in PATTERNS. Also ensures that the
  +   same process doesn’t match multiple patterns."
  +  (list (mapcar (lambda (pattern)
  +                  (block per-pattern
  +                    (mapc (lambda (process)
  +                            (let ((subst (funcall type-function
  +                                                  pattern
  +                                                  process
  +                                                  substitutions)))
  +                              (when subst
  +                                (setf substitutions subst)
  +                                (return-from per-pattern process))))
  +                          (gethash (name pattern) processes))
  +                    (error 'unification-failure)))
  +                patterns)
  +        substitutions))
   
   (defgeneric match-local (pattern process &optional substitutions)
  -  (:method ((patterns list) (processes hash-table)
  -            &optional (substitutions (make-empty-environment)))
  -    "Finds one match in PROCESSES for each item in PATTERNS. Also ensures that
  -     the same process doesn’t match multiple patterns."
  -    (list (mapcar (lambda (pattern)
  -                    (block per-pattern
  -                      (mapc (lambda (process)
  -                              (let ((subst (match-local pattern process
  -                                                        substitutions)))
  -                                (when subst
  -                                  (setf substitutions subst)
  -                                  (return-from per-pattern process))))
  -                            (gethash (name pattern) processes))
  -                      (error 'unification-failure)))
  -                  patterns)
  -          substitutions))
     (:method ((patterns list) (processes list)
               &optional (substitutions (make-empty-environment)))
       "Finds one match in PROCESSES for each item in PATTERNS. Also ensures that
  
positive.code: ;;; FIXME: somewhere around here we need to ensure only one kell is in the pattern
  
  (defgeneric convert-process-to-pattern (process &optional pattern)
    (:method ((process parallel-composition) &optional (pattern (make-instance 'pattern)))
      (mapc (lambda (sub-process)
              (convert-process-to-pattern sub-process pattern))
            (append (messages process) (kells process)))
  
negative.code: ;;;   We write θ ∈ match(ξ, M) for ⟨⟨ξ, M⟩, θ⟩ ∈ match.
  
  (defgeneric match (pattern process &optional substitutions)
    ;; NOTE: In theory I might have to worry about the same variable occuring
    ;;       multiple times in a pattern, but I have to read more to find out one
    ;;       way or the other. In any case, I'm currently disallowing it.
    (:method ((pattern pattern) (kell kell)
              &optional (substitutions (make-empty-environment)))
      (list (remove nil
                    (append (destructuring-bind (procs subst)
                                (match-list #'match-local
                                            (local-message-pattern pattern)
                                            (messages kell)
                                            substitutions)
                              (setf substitutions subst)
                              procs)
                            ;; FIXME: this requires that all matched messages are
                            ;;        within the same subkell. I don't think
                            ;;        that's the correct behavior.
                            (car (mapcar (lambda (subkell)
                                           (destructuring-bind (procs subst)
                                               (match-list #'match-down
                                                           (down-message-pattern
                                                            pattern)
                                                           (messages subkell)
                                                           substitutions)
  