         [t f]
         [f t]))))
 
+;; TODO: fix auxiliary var mapping.
+
+;; TODO: improve
+(defn get-auxiliary-map [sas-problem]
+  (let [auxiliary-map (util/map-vals first (sas-analysis/auxiliary-vars sas-problem))]
+    (assert (graphs/dag? auxiliary-map))
+    auxiliary-map))
+
+
+
 
 ;; TODO: add assertions on precond var = effect var
 ;; Recall: greedy helps the most when, e.g., lots of passengers and not much room.

           possible-next-actions (possible-actions-fn s v (util/safe-get (:effect-map a) v) (target-value s v))]
       (make-greedy-fire-action s a v possible-next-actions)))))

(comment      (when (var-at-target? s v)
       [(make-set-actions-action v #{})]))

;; TODO: auxiliary vars.


           tsi           (graphs/df-topological-sort-indices (rejigger-prevail-cg prevail-cg)) ;; way worse.
           prevail-cvm   (util/map-vals #(util/intersection (set %) vars)
                                        (graphs/edge-list->outgoing-map prevail-cg))

           dtgs          (sas-analysis/domain-transition-graphs sas-problem)
           effect-cluster-map (into {} (for [cluster (sas-analysis/effect-clusters sas-problem), v cluster] [v cluster]))
           possible-actions-fn (make-possible-actions-fn dtgs effect-cluster-map part?)

           auxiliary-map (if aux? (get-auxiliary-map sas-problem) {})
           canonicalize  (fn [bu-map]
                           (reduce (fn [bum k]
                                     (if-let [nk (auxiliary-map k)]
                                       (assoc (dissoc bum k) nk (util/union (get bum k) (get bum nk #{})))
                                       bum))
                                   (util/map-vals set bu-map) (keys bu-map)))] 
;       (assert (graphs/dag? causal-graph))    
                                        ;       (assert (sas-analysis/unary? sas-problem))
       (println tsi "\n" auxiliary-map)
       (doseq [a (:actions sas-problem)]
         (when-not (every? (partial contains? (:precond-map a)) (keys (:effect-map a)))
           (println (:name a) (apply dissoc (:effect-map a) (keys (:precond-map a))))))       
