 ;; (or takes input-set as arg, e.g.)
 (declare make-state-abstracted-subproblem)
 (defn make-state-abstracted-stub [inner-stub in-set]
-;  (println "MSAS" inner-stub in-set)
-  (if false #_(= in-set (input-set inner-stub)) ;; TODO
-    inner-stub
-    (let [inner-stub (get-base-stub inner-stub)
-          ret (traits/reify-traits
-               [simple-cached-node simple-watched or-summarizable
-                (simple-stub [:SA (stub-name inner-stub) in-set] in-set)])]
-      (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-state-abstracted-subproblem ret %)))
-      ret)))
+ ; (println "MSAS" inner-stub in-set)
+  (let [ret (traits/reify-traits
+             [simple-cached-node simple-watched or-summarizable
+              (simple-stub [:SA (stub-name inner-stub) in-set] in-set)])]
+    (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-state-abstracted-subproblem ret %)))
+    ret))
 
 ;; Note: subsumed subproblems can have different irrelevant vars
 (defn make-state-abstracted-subproblem [stb inner-sp]

    (connect-subsuming! ret subsuming-sp)
    (output-wrap ret)))

;; TODO: do something more with subsuming?
(defn- get-atomic-stub [subsuming-sp inp-set function-set]
  (let [full-name [:Atomic (fs/fs-name function-set)
                   (if *state-abstraction* (fs/extract-context function-set inp-set) inp-set)]
        name [:Atomic (fs/fs-name function-set)]]
    (if-let [^HashMap dc *decompose-cache*]
      (if-let [cache-val (.get dc full-name)]
        (if *state-abstraction* 
          (make-state-abstracted-stub cache-val inp-set)
          cache-val)
        (let [in (if *state-abstraction* (fs/get-logger function-set inp-set) inp-set)
              stub (make-atomic-stub name subsuming-sp in function-set)]
          (.put dc full-name stub)
          (if *state-abstraction* 
          (make-state-abstracted-stub stub inp-set) ;; TODO: needed?
          stub)))
     (make-atomic-stub name subsuming-sp inp-set function-set))))



              (simple-stub [:OS (stub-name inner-stub) in-set] in-set)])]
    (connect-and-watch! ret inner-stub #(set-stub-output! ret (make-output-collecting-subproblem ret %)))
    ret))


(defn =-state-sets [s1 s2]
  (util/assert-is (= (state/current-context s1)
                     (state/current-context s2)) "%s" [s1 s2])
  (= s1 s2))

;; TODO: check out set equality issues...
;; TODO: remove extra layers here ?  Don't actually seem to help.
