anchor.diff:    "Assuming that a MEASURE form has just been removed from the given
   program, returns the remainder of the program without the ELSE (measure-0)
   branch."
  -  (let* ((distance-to-first-unmatched-end 
  +  (let* ((distance-to-first-unmatched-end
             (distance-to-next-unmatched-end program))
            (distance-from-first-to-second-unmatched-end
             (distance-to-next-unmatched-end
  
positive.code: 
  ;; Internal utilities for measurement and branching
  
  (defun end (qsys) 
    "Marks the end of a measurement branch; has no effect when used
  in a quantum program in any other context." 
    qsys)
  
  (defun distance-to-next-unmatched-end (list &optional 
                                              (num-measures 0) (num-ends 0) 
                                              (distance-so-far 0))
    "Returns 0 if there is no unmatched (end) in list; otherwise returns
  the number of instructions to the next unmatched (end) (counting the (end))."
    (if (null list) 
      0
      (if (eq (caar list) 'end)
        (if (zerop num-measures)
  
negative.code:                                           (- num-measures 1) (- num-ends 1)
                                            (+ 1 distance-so-far))
            (distance-to-next-unmatched-end (cdr list)
                                            num-measures (+ num-ends 1)
                                            (+ 1 distance-so-far))))
        (if (eq (caar list) 'measure)
          (distance-to-next-unmatched-end (cdr list)
  