 
 ;;;;;;;;;;;;;;;;;;;;;;; Making and Splitting Subproblems ;;;;;;;;;;;;;;;;;;;;;;;
 
-;; TODO: terminal (solution) if concrete & primitive,
+;; TODO: nothing is ever live ? everything is eager ? 
+
+;;       terminal (solution) if concrete & primitive,
 ;;       termianl (blocked) if primitive or cannot refine from current set.
 (defn make-subproblem [logged-input-set state-context action reward-bound-fn]
   (let [prim?        (env/primitive? action)]



(defn refine-pn [pn input-summary min-reward]
  (let [{:keys [sub-output-set-pointer excluded-child-set summary-bound]} pn]
    (refine-osp! sub-output-set-pointer min-reward excluded-child-set)
    (assoc pn :output-summary (compute-plan-node-output-summary input-summary sub-output-set-pointer excluded-child-set summary-bound))))


(defn split-pn-output [pn input-set input-summary min-step-reward]

;; TODO: summaries making it into child-pointers


(defn osn-plan-summary 
  "Summary of the plans stored directly at this osn"
  [osn] (apply max-summary (map :summary (:plans osn))))

(defn osn-child-summary
  "Summary of non-excluded descendents of this osn"
  [osn ecs] (apply max-summary (map full-osp-summary (remove ecs (:child-pointers osn)))))

(defn osn-summary [osn ecs]
  "Summary of direct plans plus non-excluded descendents."
  (max-summary (osn-plan-summary osn) (osn-child-summary osn ecs)))


(defn osn-add-plans [osn plans]
  "Return a new OSN with the new plans added.  Presumed mutex output sets."
  (update-in osn [:plans] concat plans))

;; osn/osp
(defn merge-children
