             (make-recursive-expander 
              (delay (make-exhaustive-search 
                      (make-abstracted-incremental-dijkstra-sa-search state reward f))) r)))
-     (make-goal-node state))
+     (GoalNode state))
    reward])
 
 

(defn make-inverted-root-node [state action]
  (connect-downward-cache state action 
    [(reify InvertedItem 
      (notify-upward [outcome-pair] [(update-in outcome-pair 0 make-goal-node)])) 
     0]))

(defn make-inverted-sa-search [state action]

  (expand-node        [se new-threshold]
    "Returns PartialResult of SearchNodes."))

(deftype GoalNode [goal-state]
  SearchNode
   (extract-goal-state [] goal-state)
   (expand-node        [min-reward] (throw (UnsupportedOperationException.))))

;; Named node is simple non-terminal node whose equality semantics are given by name.
(deftype NamedNode [name root-sa expand-fn] :as this
