      (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]
-  (if-let [res (not-empty (map last (schema-rules [pred-type parent-type])))]
-    [pred-type (first res) parent-type] ))
+  (first (not-empty (schema-rules [pred-type parent-type])))
+)
 
 (defn leaf-pred? [parent-type]
   (or (fetch-pred :=  parent-type)

      [typ simple-exp])))
  ([simple-exp]
   (pred-type-help simple-exp nil)))







#_(with-schema
  (index-spec

    (throw (Exception. (str "parent-type " parent-type "has no predicate.")))))

(defn compound-type? [parent-type]
  (#{:SEQQ :MAPP} (last (fetch-pred :=> parent-type))))

(defn get-types-from-key-parent [parent-type ky]
  (map (comp last last)
