 
 ; Ideally, should prefer top-most top-down, bottom-most bottom-up, or something...
 
-(deftype GASPlanEnv [init actions-fn g-map]
+(defrecord GASPlanEnv [init actions-fn g-map]
   env/Env 
-    (initial-state [_] init)
-    (actions-fn    [] actions-fn)
-    (goal-fn       [] #(when (state/state-matches-map? % g-map) (env/solution-and-reward %)))
+    (initial-state [this] init)
+    (actions-fn    [this] actions-fn)
+    (goal-fn       [this] #(when (state/state-matches-map? % g-map) (env/solution-and-reward %)))
   env/FactoredEnv
-    (goal-map      [] g-map))
+    (goal-map      [this] g-map))
 
 (defn make-gasplan-env [sas-problem] 
   (def *add-count* (util/sref 0))

               (every? #(state/get-var s (parent-var % effect-var)) unfree-pv))
        (util/assert-is (every? #(nil? (state/get-var s (action-var %))) precond-vars) ); "%s" [name effect-var (println s)])
        (util/assert-is (every? #(nil? (state/get-var s (action-var %))) effect-vars))        
        (env/env-util/make-factored-primitive
         [::GreedyFire name]
         (into precond-map 
               (concat [[(action-var effect-var) factored-primitive]]

  (assert (contains? effect-map target-var))
  (let [eval (effect-map target-var)
        pval? (contains? precond-map target-var)]
    (env-util/make-factored-primitive
     [::AddAction name]
     (if pval? {(action-var target-var) nil, target-var (get precond-map target-var), (free-var target-var) false}
         {(action-var target-var) nil, (free-var target-var) false})
