     which is the entry point of the prorgam. It is with respect to this
     function that all other defs will be considered for elimination."
   [{:keys [modules] :as ast} {:keys [entry] :as options}]
-  (let [;; First find and annotate all the defs in the program
-        ast (-> ast (defs/locate-defs options))
-
-        ;; Then compute the {Var → #{Var}} form of the whole program
-        symbol-sets (->> (for [m   modules
-                               sym (keys (get ast m))
-                               :let [form (get-in ast [m sym])]]
-                           [(:var form) (reach-set form)])
-                         (into {})
-                         global-reach-set)
+  (let [;; Compute the {Var → #{Var}} form of the whole program
+        symbol-sets (->>  (for [m     modules
+                                form  (:forms (get ast m))
+                                :when (pattern/def? form)]
+                            [(:var form) (reach-set form)])
+                          (into {})
+                          global-reach-set)
 
         ;; The emit set is now trivially
         emit-set (get symbol-sets (resolve entry))]
+    (info emit-set)
     (trim-with-emit-set ast emit-set)))



(defn -step-reach-set
  [ast]
  (util/map-vals
   (fn [v]
     (->> v
          (map (partial get ast))
          (reduce set/union v)))))


(defn global-reach-set
  "λ {Symbol → #{Symbol}} → {Symbol → #{Symbol}}

  Computes the reach set for an entire program"
  [whole-program-ast]
  (util/fix -step-reach-set
            (-> whole-program-ast
                (util/map-vals reach-set))))


(defn trim-with-emit-set

            [oxcart.passes.defs :as defs]
            [clojure.set :as set]
            [clojure.tools.analyzer.ast :as ast]
            [taoensso.timbre :refer [info warn error debug]]))


(defn reach-set
