   hierarchy/HighLevelAction
     (immediate-refinements- [s]
       (let [[stalled-refs rest-refs] (split-with #(= (hla-type (first %)) ::SAS-Precond-Set-HLA) refinements)]
+;        (println "\n\n" s "\n" (map (comp env/action-name first) refinements))
 ;        (println (map count [stalled-refs rest-refs]))
 ;        (println (map #(map type %) rest-refs))
         (if-let [[target-ref & more-refs] (seq rest-refs)]

(def *simple-dtgs* nil)   ; Map from var to edge list.
(def #^HashMap *hla-cache* nil) ; a map from [action-name] to map from init-sets to action.
(def #^IdentityHashMap *compile-cache* nil) ; a map from [action-name] to map from init-sets to action.

;; Memoized partial computations to speed up acylic edge generation.
(def #^HashMap *forward-reachability-cache* nil)

             (make-interleaving-hla (map (comp vector first) chunk) bad-vars))))))))

(defn make-precond-set-hla [precond-map] 
  (SAS-Precond-Set-HLA 
   precond-map
   (doall (map (partial apply make-precond-hla) (sort-by (comp - *var-levels* key) precond-map)))
   (atom :dummy)))

(defn trivially-satisfied-precond-set? [a s]
  (if (= (type a) ::SAS-Compiled-HLA) (recur (:orig-hla a) s)
      (and (= (type a) ::SAS-Precond-Set-HLA)
           (every? (fn [p] (= (env/get-var s (:var p)) (:dst-val p)))
                   (:ordered-preconds a)))))

; (loop [init-sets init-sets, ordered-preconds ordered-preconds, used-vars #{}]
;        (when-let [[f & r] (seq ordered-preconds)]        
