      (group-by (fn [x] [:parent (second x) (first (nth x 2))]) (filter #(#{:?- :-} (second %)) spc))
      (group-by (juxt second first) spc))))
 
-
-
 (defn fetch-pred [pred-type parent-type]
-  (first (not-empty (schema-rules [pred-type parent-type])))
-)
+  (schema-rules [pred-type parent-type]))
 
 (defn leaf-pred? [parent-type]
-  (or (fetch-pred :=  parent-type)
-      (fetch-pred :== parent-type)
-      (fetch-pred :=> parent-type)))
+  (concat (fetch-pred :=  parent-type)
+          (fetch-pred :== parent-type)
+          (fetch-pred :=> parent-type)))
 
 (defn descendent-typs [t]
   (distinct

  (doall (descendent-typs 'B)))

(defn all-predicates [parent-type]
  (keep leaf-pred? (cons parent-type (descendent-typs parent-type))))

#_(with-schema (index-spec (spec 'Integer integer?)
                         (spec 'AnotherInt string?)

                   :value value
                   :type-sig (:type-sig state)
                   :path     (:path state)}]
        [(if (not= (-> state :type-sig first) typ)
           (assoc error :sub-type typ)
           error)])
      {:success-type typ})))

;; TODO this allows a OR reloationship??
