             ((:Function action) params)
             (ioframes/process-output IO (str "failed to parse: types mismatch " cmd ": " action ":" params))))
       (ioframes/process-output IO (str "failed to parse: too many matched action to " cmd ": " actions)))))
-
-(defn- init-builtins-kb []
-  (let [t_is (create-iyye-relation "is" :IYE :AXIOM :ALWAYS [] iyye_is_type_function)
-        consistsof (create-iyye-relation "consists" :IYE :AXIOM :ALWAYS [] iyye_consists_function)
-        instof (create-iyye-relation "instance of" :IYE :AXIOM :ALWAYS [] iyye_instance_function)]
-    (dosync (ref-set iyye_is_type t_is))
-    (dosync (ref-set iyye_consists_type consistsof))
-    (dosync (ref-set iyye_create_instance instof))
-    ; (dosync (alter noun-words conj iyye_concept))
-    ;(dorun (map #(do ( persistence/write-fact-to-db (into {} %))) @action-words))
-    ))
-
-(defn- init-db-kb []
-  (let []
-    (dosync (alter relations-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "relations" {:When :ALWAYS})))
-    (dosync (alter types-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "types" {:When :ALWAYS})))
-    ))
-
-(defn load-init-kb []
-  (init-builtins-kb)
-  (init-db-kb)
-
-  )
-
-(defn init-kb []
-  (init-builtins-kb)
-  )
-
-; (apply str (rest (str (:When {:When :ALWAYS}))))

    ;[iyye.subcon.knowledge.relation :as relation]
    ))

(def relations-words (ref []))
(def types-words (ref []))
(def instances-words (ref []))
(def adjective-words (ref []))
(def action-words (ref []))

(defrecord Iyye_Predicate [AccordingTo When Time Prob])

(defrecord Iyye_Atom [Name Uname predicate])

(defn create-iyye-atom [name according when words-list]
  (let [Time (persistence/current-time-to-string)
        uname (str name (count words-list))
        atom (->Iyye_Atom name uname (->Iyye_Predicate according when Time 1.0))]
    atom))

(defrecord Iyye_Type [atom SubtypeOf Subtypes Predicates])

(defn create-iyye-type [Name AccordingTo When SubtypeOf Subtypes]
  (let [type-atom (create-iyye-atom Name AccordingTo When types-words)
        type (->Iyye_Type type-atom SubtypeOf Subtypes [])]
    type))

(defn load-iyye-atom-from-db [uname]
  )

;(dosync (alter types-words conj type))
;(persistence/write-noun-to-db (into {} type))


(defn create-iyye-instance [values])


(defn action [cmd params IO]
  (let [actions
