 
 (defn iyye_is_type_predicate_function [params]
     (let [[p1-type p2-type] params
-          p2-name (:Name (:name (first p2-type)))
-          rels1 (:Relations (first p1-type))
+          p2-name (:Name (:name  p2-type))
+          rels1 (:Relations p1-type)
           rels2 (for [rel rels1]
                   [rel (and p2-name (= (:super (:Data rel)) p2-name))])
           rels3 (filter #(second %) rels2)]

    (dosync (alter words/builtin-words conj (create-entry t_is)))))

(defn- init-builtin-verbs []
  (let [t_is (create-iyye-builtin-verb "is" ["relation" "type" "*"] "relation" iyye_is_type_function)
        t_is? (create-iyye-builtin-query "is?" ["relation" "type" "*"] iyye_is_predicate_function)
        ;t_is2 (create-iyye-builtin-relation "is" [:UNKNOWN "type"] iyye_is_type_create_function iyye_is_type_predicate_function)
        consistsof (create-iyye-builtin-verb "has" ["type" "*"] "relation" iyye_consists_function)
        ;instof (create-iyye-builtin-relation "instance" ["type"] iyye_instance_function iyye_is_type_predicate_function)

        f (get-function @iyye_is_type)]
        (when f
          (do
            (f [(get-type @iyye_is_type_rel) [(get-type @iyye_ai)] [(get-type @iyye_actor)]
                [(words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/local-time-to-string) :ALWAYS)]])
            (f [(get-type @iyye_is_type_rel) [(get-type @iyye_human)] [(get-type @iyye_actor)]
                [(words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/local-time-to-string) :ALWAYS)]])
            (f [(get-type @iyye_is_type_rel) [(get-type @iyye_iyye)] [(get-type @iyye_ai)]
                [(words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/local-time-to-string) :ALWAYS)]])
            (f [(get-type @iyye_is_type_rel) [(get-type @iyye_yumzya)] [(get-type @iyye_human)]
                [(words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/local-time-to-string) :ALWAYS)]])))))

(defn- init-builtins-kb []
  (init-builtin-words)
