 
 (errors (datalog/knowledge (clojure.set/union stdlib example-b) rules))
 
-(q* (datalog/knowledge (clojure.set/union stdlib example-b) rules) [?id :match true] :return id)
+(q* (datalog/knowledge (clojure.set/union stdlib example-b) rules) [:vec :notebook/page ?id] :return id)


(def rules
  ;; NOTE this is hand-stratified
  [[(required :page :page/args :page/steps)
    (required :match :match/arg :match/branches)
    (required :branch :branch/pattern :branch/guards :branch/action)
    (required :call :call/fun :call/args)

    (exclusive :pattern :data :pattern/any :pattern/bind :pattern/vector :pattern/map)]

   [(exclusive :step? :data :call :match)]

   [(rule [?notebook :notebook/pages ?pages] (:in ?page ?pages) :return [page :notebook/page notebook])]

   [(rule [?page :page/args ?args] (:in ?arg ?args) :return [arg :arg page])
    (rule [?page :page/steps ?steps] (:in ?step ?steps) :return [step :step page])]
