         (if (=-state-sets (output-set inner-sp) (output-set o))
           (do (connect-and-watch! ret o child-watch)
               (summaries/summary-changed! ret))
-          (if (#{:SA :OC} (first (sp-name o))) 
-            (add-sp-child! ret o)
-            (add-sp-child-stub! ret (make-output-collecting-stub (stub o)))))))
+          (let [c (if (#{:SA :OC} (first (sp-name o))) (stub o) (make-output-collecting-stub (stub o)))]
+            (add-sp-child-stub! ret c false)))))
     ret))
 
 

  (if-let [left-sp (get-stub-output left-stub)]
    (make-pair-stub2 left-sp (right-stub-fn (output-set left-sp)))
    (let [ret (traits/reify-traits [summaries/or-summarizable (simple-stub nm (input-set left-stub))])]
      (connect-and-watch-stub! ret left-stub 
        (fn [lo]
          (connect-and-watch-stub-up! ret
            (make-pair-stub2 lo (right-stub-fn (output-set lo)))
            #(set-stub-output! ret %))))
      ret)))


(defmethod print-method angelic.search.implicit.dash_astar.Subproblem [sp o]
 (print-method (format "#<SP$%8h %s>" (System/identityHashCode (stub sp)) (sp-name sp)) o))

(defn direct-sp? [sp] )

(defn- add-sp-child-stub! [sp child-stub up?]
  (when (= (ts-stub (sp-ts sp)) (stub sp)) ;; not a wrapper; don't double-copy!
    ;; TODO
    )
  (connect-and-watch-stub! sp child-stub up?
    (fn [child-sp]
      (assert (not (terminal? sp)))
      (summaries/summary-changed-local! sp)
      (add-output! sp child-sp))))


(traits/deftrait simple-subproblem [stb out-set term? ri-fn] [] [watched-node]
