 
 (defn parents-for-type [typ']
   (concat (not-empty
-           (for [[ky _ [parent-type _ typ]] (*schema-rules* :-)
+           (for [[ky _ [parent-type _ typ]] (schema-rules :-)
                  :when (= typ typ')]
              [ky parent-type]))
           (not-empty
            (apply concat
-                  (for [[up-type _ typ] (*schema-rules* :--)
+                  (for [[up-type _ typ] (schema-rules :--)
                         :when (= typ typ')]
                     (parents-for-type up-type))))))
 

     (group-by (juxt second first) spc))))

(defn fetch-pred [pred-type parent-type]
  (if-let [res (not-empty (map last (*schema-rules* [pred-type parent-type])))]
    [pred-type (first res) parent-type] ))

(defn leaf-pred? [parent-type]

          :path     (:path     state)}]))))

(defn required-keys-for-type [parent-type]
  (set (for [[t _ k]  (schema-rules [:requires-key parent-type])
                  :when (= t parent-type)]
              k)))

