 ;; and output of right-sp as output of the pair.
 
 ;; The slightly tricky part is generating children.  Both left-sp and right-sp
-;; may have childen, but to search systematically we should branch on only one at a time.
+;; may have childen, but to search systematically we branch on only one at a time.
 ;; This means that our summary should consist of the sum of summaries of
 ;;   - The subproblem whose children we branch on, and
 ;;   - The tree summarizer of the other subproblem.


(defn- do-changes! [^ArrayList a f] (doseq [sp a] (f sp)) (.clear a))

(declare evaluate!)

(defn- evaluate-and-update! [s]
  (evaluate! s)
  (do-changes! *increases* sg/summary-increased!) 
  (do-changes! *subsumes* (fn [[ts subsumed-ts]] (sg/connect-subsumed! ts subsumed-ts)))
  (do-changes! *decreases* sg/summary-changed!))

;; Note: subsumed subproblems can have different irrelevant vars
;; Also note: new input can have subset of variables of old. (=-state-sets does ntthis now).
(defn- make-state-abstracted-subproblem [fs inner-sp inp-set]
  (when inner-sp
   (make-wrapped-subproblem
    (sa-name (sp-name inner-sp)) inp-set (fs/transfer-effects inp-set (output-set inner-sp)) #{:OC} inner-sp
    (fn [sp child-sp] (publish-child! sp (make-state-abstracted-subproblem fs child-sp inp-set))) 
    (fn [sp ni] (if (fs/=-state-sets ni inp-set) sp (make-state-abstracted-subproblem fs (refine-input inner-sp ni) ni))))))

(defmethod get-subproblem :SA [[_ inner-n :as n] inp-set]
  (let [fs (atomic-name-fs (second inner-n))] 
