              [constraint :as constraint]
              [estimation :as estimation]
              [lookup :as lookup]]
-            [taoensso.tufte :as profiler :refer [defnp fnp]])
+            [taoensso.tufte :as profiler :refer [defnp]])
   (:import [java.io BufferedReader StringReader]
+           sre.plan.compiler.BindingBranchNode
            sre.plan.config.IConfig
            [sre.plan.estimation Cost Weight]
            sre.plan.lookup.ConstraintLookup))

    (if (= cost-cmp 0)
      (not= a b)
      cost-cmp)))

(defn create-search-plan-cell [index cost-calculator weight-calculator bound cell constr-lkp]
  (map->SearchPlanCell {:cost-calculator      cost-calculator

                                                       :constr-lkp             constr-lkp
                                                       :free-count             n
                                                       :non-past-op-bindings           (bind-postcond n-ops constr-lkp)
                                                       :non-past-op-bindings! (bind-postcond i-ops constr-lkp)})] ; 3:1 set n
    (loop [i     0
           plans (sorted-map-by > n (map->SearchPlanColumn {:ordered-cells (sorted-set-by compare-search-plan-cell-by-cost cell)
                                                            :cells-by-free {(lookup/lookup constr-lkp :free) cell}}))]
      (if-let [keys (keys plans)]
        (if (= [0] keys)
          (exc/success (-> plans (get 0) :ordered-cells first)) ; 3:18 - ready. return best plan
          (let [j (first keys)]
            (let [column (get plans j)
                  plans  (as-> plans x
