     plans-by-output-set))
 
 (defn split-osp
-  "Return new-child-osps.  Currently splits children < min-reward when parent >= min-reward."
+  "Return new-child-osps.  Currently splits children >= min-reward when parent < min-reward."
   [osp min-reward excluded-child-set]
-  (when (> (max-reward (osp-plan-summary osp)) min-reward)
-    (filter #(<= (max-reward (full-osp-summary %)))
-            (remove excluded-child-set
-                    (osn-child-pointers @(:node-atom osp))))))
+  (when (< (max-reward (max-summary (osp-plan-summary osp) (osp-ancestor-summary osp))) min-reward)
+    (filter #(>= (max-reward (full-osp-summary %)) min-reward)
+            (remove excluded-child-set (osn-child-pointers @(:node-atom osp))))))
+
+(defn can-split-osp? [osp excluded-child-set]
+  (> (apply max is/neg-inf (map (comp max-reward #(osp-descendent-summary % #{}))
+                                (remove excluded-child-set (osn-child-pointers @(:node-atom osp)))))
+     (max-reward (max-summary (osp-plan-summary osp) (osp-ancestor-summary osp)))))
+
 
 
 

          (patch-pn-summary-tuple- pn new-input-summary)
          (let [new-pn (make-plan-node new-input-set new-input-summary new-osp nil
                                (osp-output-set sub-output-set-pointer)
                                (make-blocked-summary (max-reward (full-osp-summary sub-output-set-pointer))))
                new-output-pair (plan-node-output-set-and-summary new-pn)]
            (when (viable-output-set-and-summary? new-output-pair)
              [(cons (not (= (:output-set new-pn) output-set)) new-output-pair) new-pn]))))      

(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]
