 
 (defn make-wrapped-subproblem [nm inp-set prefix-set inner-sp output-wrap child-watch ri-fn]
   (util/assert-is (contains? prefix-set (first (sp-name inner-sp))))
-  (let [ret (traits/reify-traits
-             [summaries/or-summarizable
-              (simple-subproblem nm inp-set (sp-ts inner-sp) noeval ri-fn)])]
+  (let [ret (make-subproblem nm inp-set (sp-ts inner-sp) noeval ri-fn summaries/or-summary)]
     (connect-and-watch! ret inner-sp
       (fn [o] (set-output-set! ret (output-wrap o)))
       (fn [inner-child] (child-watch ret inner-child)))
     ret))
 
-
 ;; Note: summary-fn should take subsuming-bound into account.
 (defn- make-simple-subproblem [nm inp-set ri-fn eval-fn summary-fn]
-  (traits/reify-traits
-   [(simple-subproblem
-     nm inp-set nil eval-fn
-     (fn [s ni] ;; Note ni may have different context.
-       (if (= ni inp-set) s
-         (let [subsumed-sp (ri-fn s ni)]
-           (add-subsuming-sp! subsumed-sp s)
-           subsumed-sp))))]
-   summaries/Summarizable (summarize [s] (summary-fn s))))
+  (make-subproblem nm inp-set nil eval-fn (fn [s ni] (if (= ni inp-set) s (ri-fn s ni))) summary-fn))
 
 ;; Get a fresh subproblem with the given name and input.
 (defmulti get-subproblem (fn get-subproblem-dispatch [nm inp] (first nm)))

              (add-all-child-watcher! subsuming-sp
                (fn [subsuming-child]
                  (let [can-subsuming-child (canonicalize subsuming-child)]
                    (when (and (not (identical? can-child can-subsuming-child))
                               (= (sp-name can-child) (sp-name can-subsuming-child)))
                      #_(print ".")
                      #_ (println [s subsuming-sp] "==>" [child subsuming-child])
                      (when (add-subsuming-sp! can-child can-subsuming-child)
                        #_ (println [s subsuming-sp] "==>" [child subsuming-child])
                        )))))))))
      true))
  
  (refine-input    [s ni] (let [ret (ri-fn s ni)] (util/assert-is (= nm (sp-name ret))) ret)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  Utils  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;; Pessimistic
;; TODO: add pessimistic variants (shared primitives)
;; TODO: bounding pressimistic descritpions (assume consistency for now)
;; TODO: hook up pess/opt with same input set?
;; TODO: pruning. 

;;;;; Tree construction
;; TODO: smarter output-collector (semantic) -- problems here though.
