anchor.diff:                       (return node))))))))
   
   (defun wait-for-compute (ptree)
  -  (with-%ptree-slots (queue pending) ptree
  +  (with-%ptree-slots (lock queue pending) ptree
       (while (plusp pending)
         (pop-queue queue)
         (decf pending))))
  
positive.code: (defun check-ptree (ptree)
    "Verify that all nodes have been defined with an associated
  function. If not, `ptree-undefined-function-error' is signaled."
    (each-node ptree #'check-node))
  
  (defun clear-ptree (ptree)
    "Clear all node results in `ptree', restoring the tree to its
  uncomputed state."
    (wait-for-compute ptree)
    (each-node ptree #'clear-node))
  
  (defun clear-ptree-errors (ptree)
    "Clear all error results in `ptree', allowing the computation to
  resume from its latest pre-error state."
    (wait-for-compute ptree)
    (each-node ptree #'clear-node-error))
  
  (defun ptree-fn (id args function ptree)
    "Define a ptree node with identifier `id', which is some unique
  
negative.code: computations.
  
  `ptree' is the ptree instance in which the node is being defined."
    (with-%ptree-slots (lock nodes) ptree
      (with-lock-held (lock)
        (flet ((fetch-node (id) (or (gethash id nodes)
                                    (setf (gethash id nodes)
                                          (make-node-instance :id id)))))
          (let ((node (fetch-node id)))
            (with-node-slots ((node-function function)
                              (node-children children)) node
              (when node-function
                (error 'ptree-redefinition-error :id id))
              (setf node-function function)
              (let ((children (mapcar #'fetch-node args)))
                (dolist (child children)
                  (with-node-slots (parents) child
                    (push node parents)))
                (setf node-children children)))))))
    id)
  
  (defun call-ptree (id ptree)
  