   (print-method (format "#<SP$%8h %s>" (System/identityHashCode (stub sp)) (subproblem-name sp)) o))
 
 
+(defn connect-subsuming! [child subsuming-sp]
+  (when subsuming-sp (summaries/connect! child (tree-summarizer subsuming-sp) true)))
+
+(defn add-sp-child! [sp child-sp]
+  (assert (not (terminal? sp)))
+  (summaries/summary-changed-local! sp)
+  (add-output! sp child-sp))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  Tree Summarizer  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;; Expects to be a parent of inside, but not have inside as a child.
-;; All children are tree summarizers.
-;; Non-subsuming children must be added by calling connect-child-sp!
+
+
+;; TODO: propagate top-down-bounds downward in smarter way using existing IS?
+;; TODO: we need to make sure tree sums get called on add-output! first to ensure
+;;       consistency with top-down-bounds ? 
+;; TODO: top-down bound business does not actually help at all
+;;  (except ensuring consistency if we're asserting it...)
+
 (defprotocol TreeSummarizer
   (top-down-bound    [s])
   (add-top-down-bound! [s b]))
-
-;; TODO: propagate top-down-bounds downward in smarter way using existing IS?
-;; TODO: we need to make sure tree sums get called on add-output! first to ensure
-;;       consistency with top-down-bounds ? 
 
 (defn tree-summarizer? [s] (instance? angelic.search.implicit.fah_astar_eval2.TreeSummarizer s))
 

                (connect-and-watch! ret (make-output-collecting-stub (stub o)) #(add-sp-child! ret %)))))))    
    ret))




(declare make-state-abstracted-subproblem)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   Sequences    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(declare make-pair-stub1 make-pair-stub2)

;; TODO: fix up subsuming, parent, etc.
;; nils at bottom should chase subsuming-sp.
