 
 ;; FLOWS
 
-(deftype Flow [solver output-kinds output-names output-fields]
+(deftype SolverFlow [solver output-kinds output-names output-fields]
   Object
   (run [this kn rule->dirty? kind->name->rules]
        (.reset solver)

(ns aurora.language
  (:require [aurora.btree :as btree])
  (:require-macros [aurora.macros :refer [apush set!!]]))

;; KNOWLEDGE


                                                                                             #js ["some-interval" "variable" "in" "zz"]
                                                                                             #js ["rem-bar" "variable" "z" "zz"]])

(.add-facts kn "know" "clauses" #js ["rule-id" "when|know|remember|forget" "clause-id" "name"] #js [#js ["count-overlap" "when" "get-more-foos" "foo"]
                                                                                                    #js ["count-overlap" "when" "some-more-interval" "interval"]
                                                                                                    #js ["count-overlap" "remember" "rem-quux" "quux"]])

(.add-facts kn "know" "clause-fields" #js ["clause-id" "constant|variable" "key" "val"] #js [#js ["get-more-foos" "variable" "x" "xx"]
                                                                                             #js ["get-more-foos" "variable" "y" "yy"]
                                                                                             #js ["some-more-interval" "variable" "lo" "xx"]
                                                                                             #js ["some-more-interval" "variable" "hi" "yy"]
                                                                                             #js ["some-more-interval" "variable" "in" "zz"]
                                                                                             #js ["rem-quux" "variable" "x" "xx"]
                                                                                             #js ["rem-quux" "variable" "y" "yy"]
                                                                                             #js ["rem-quux" "variable" "z" "zz"]
                                                                                             #js ["rem-quux" "constant" "aggregate-variable" "z"]
                                                                                             #js ["rem-quux" "constant" "aggregate-function" "count"]])

(def flows (compile kn))

(enable-console-print!)

