Direct use of this namespace is deprecated. Users can now simply use the defrule, defquery, and defsession macros in the clara.rules namespace. Users can simply pull those macros in like any other, for instance:
(:require [clara.rules :refer [insert fire-rules query insert!] :refer-macros [defrule defsession defquery]])
Direct use of this namespace is deprecated. Users can now simply use the defrule, defquery, and defsession macros in the clara.rules namespace. Users can simply pull those macros in like any other, for instance: (:require [clara.rules :refer [insert fire-rules query insert!] :refer-macros [defrule defsession defquery]])
(compile-alpha-nodes alpha-nodes)
Inputs: [alpha-nodes :- [schema/AlphaNode]]
Inputs: [alpha-nodes :- [schema/AlphaNode]]
(defsession name & sources-and-options)
Creates a session given a list of sources and keyword-style options, which are typically ClojureScript namespaces.
Each source is eval'ed at compile time, in Clojure (not ClojureScript.)
If the eval result is a symbol, it is presumed to be a ClojureScript namespace, and all rules and queries defined in that namespace will be found and used.
If the eval result is a collection, it is presumed to be a collection of productions. Note that although the collection must exist in the compiling Clojure runtime (since the eval happens at macro-expansion time), any expressions in the rule or query definitions will be executed in ClojureScript.
Typical usage would be like this, with a session defined as a var:
(defsession my-session 'example.namespace)
That var contains an immutable session that then can be used as a starting point to create sessions with caller-provided data. Since the session itself is immutable, it can be safely used from multiple threads and will not be modified by callers. So a user might grab it, insert facts, and otherwise use it as follows:
(-> my-session (insert (->Temperature 23)) (fire-rules))
Creates a session given a list of sources and keyword-style options, which are typically ClojureScript namespaces. Each source is eval'ed at compile time, in Clojure (not ClojureScript.) If the eval result is a symbol, it is presumed to be a ClojureScript namespace, and all rules and queries defined in that namespace will be found and used. If the eval result is a collection, it is presumed to be a collection of productions. Note that although the collection must exist in the compiling Clojure runtime (since the eval happens at macro-expansion time), any expressions in the rule or query definitions will be executed in ClojureScript. Typical usage would be like this, with a session defined as a var: (defsession my-session 'example.namespace) That var contains an immutable session that then can be used as a starting point to create sessions with caller-provided data. Since the session itself is immutable, it can be safely used from multiple threads and will not be modified by callers. So a user might grab it, insert facts, and otherwise use it as follows: (-> my-session (insert (->Temperature 23)) (fire-rules))
(gen-beta-network node-ids
{:keys [id-to-production-node id-to-condition-node
id-to-new-bindings forward-edges]
:as beta-graph}
parent-bindings)
Inputs: [node-ids :- #{sc/Int} {:keys [id-to-production-node id-to-condition-node id-to-new-bindings forward-edges], :as beta-graph} :- schema/BetaGraph parent-bindings :- #{sc/Keyword}] Returns: [sc/Any]
Generates the beta network from the beta tree.
Inputs: [node-ids :- #{sc/Int} {:keys [id-to-production-node id-to-condition-node id-to-new-bindings forward-edges], :as beta-graph} :- schema/BetaGraph parent-bindings :- #{sc/Keyword}] Returns: [sc/Any] Generates the beta network from the beta tree.
(sources-and-options->session-assembly-form sources-and-options)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close