        (stages-map :flatten-ast))
       p)))
 
+(defn trim-keys [x]
+  (walk/postwalk
+    (fn [x]
+      (if (map? x)
+        (dissoc x :env :shared)
+        x))
+    x))
 
 (comment
 

            [gamma.compiler.print :as prn]
            [clojure.walk :as walk])
  (:use
    [gamma.tools :only [stages-map print-dag compile-stages stages]]
    [gamma.compiler.flatten-ast :only [->tree]]))




  (require '[clojure.walk :as walk])


  (print-tree
    (trim-keys
     (->tree
       (get-in
         (compile-stages (g/+ 1 2))
         [:stages :move-assignments]) :root)))

  (print-tree
    (trim-keys
      (->tree
        (get-in
          (compile-stages (let [x (g/sin 1)]
                            (g/if true x 1)))
          [:stages :move-assignments]) :root)))






  ;; get compiler stages to work

