       (fetch-pred :=> parent-type)))
 
 (defn all-types [parent-type]
-  (let [res (map last (*schema-rules* [:-- parent-type]))]
+  (let [res (map last (schema-rules [:-- parent-type]))]
     (distinct (cons parent-type (concat res (mapcat all-types res))))))
 
 (defn all-predicates [parent-type]

  (if (sequence-like? parent-value) 0 k))

(defn find-keyword-predicate [parent-type]
  (when-let [[pred-id _ [pt _ kt]] (first (*schema-rules* [:parent :?- parent-type]))]
    (when-let [pred-func (last (first (*schema-rules* [:= pred-id])))]
      [pred-func kt])))

;; this is what implements or


(defn get-types-from-key-parent [parent-type ky]
  (map (comp last last)
       (filter #(= parent-type (-> % last first)) (schema-rules [:- ky]))))

(declare type-checker)

