     (do (summaries/connect! p c false)
         (add-watcher! c f))))
 
+(defn make-wrapping-stub [[name in-set] inner-stub sp-fn]
+  (let [ret (traits/reify-traits [summaries/or-summarizable (simple-stub name in-set)])]
+    (connect-and-watch-stub! ret inner-stub #(set-stub-output! ret (sp-fn ret %)))
+    ret))
+
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





;; TODO: collect children too ?
(declare make-output-collecting-subproblem)
(defn make-output-collecting-stub [inner-stub]
  (assert (not (= (first (stub-name inner-stub)) :OS)))
  (assert (not (= (first (stub-name inner-stub)) :SA)))  
  (let [in-set (input-set inner-stub)
        ret (traits/reify-traits [summaries/or-summarizable (simple-stub [:OS (stub-name inner-stub) in-set] in-set)])]
    (connect-and-watch-stub! ret inner-stub #(set-stub-output! ret (make-output-collecting-subproblem ret %)))
    ret))


(defn =-state-sets [s1 s2]


(declare make-state-abstracted-subproblem)
(defn make-eager-state-abstracted-stub [inner-stub in-set]
  (make-wrapping-stub [[:SA (stub-name inner-stub)] in-set] inner-stub make-state-abstracted-subproblem))


;; DOTO: reduce overhead with deliberate?
