         ret (traits/reify-traits
              [summaries/or-summarizable (simple-subproblem stb out ts (terminal? inner-sp) ri-fn)])]
     (connect-and-watch! ret inner-sp
-      (fn [o] (connect-and-watch! ret (make-state-abstracted-stub (stub o) in) #(add-sp-child! ret %))
+      (fn [o] (connect-and-watch-stub! ret (make-state-abstracted-stub (stub o) in) #(add-sp-child! ret %))
         (when (= :deliberate *state-abstraction*) (summaries/summary-changed! ret))))
     ret))
 

(defn- get-root-subproblem [inp-set fs]
  (let [root-stub (make-atomic-stub nil nil inp-set fs)]
    (dotimes [_ 2] (evaluate! root-stub))
    (util/safe-singleton (get-outputs root-stub))))

(defn implicit-fah-a*-eval2 [henv]
  (binding [summaries/*cache-method* :eager

  (summaries/summary-changed-local! stub)
  (add-output! stub sp))


(defn get-stub-output  [s] (first (get-outputs s)))
(defn get-stub-output! [s] (util/safe-singleton (get-outputs s)))

;; Just give output directly if subproblem is ready
(defn connect-and-watch-stub! [p c f]
  (assert (instance? angelic.search.implicit.fah_astar_eval2.Stub c))
  (if-let [sp (get-stub-output c)]
    (f sp)
    (do (summaries/connect! p c false)
        (add-watcher! c f))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
