($->?src* $s)
Takes a sequence of $* symbols and returns a map from them to ?src__ symbols.
Takes a sequence of $* symbols and returns a map from them to ?src__ symbols.
(->where-rule query)
Given a :find clause and :where clause, this generates a new rule by embedding all the expressions as the antecedents of a new rule, with a new rule consequent defined containing the variables designated of interest by the :find clause.
Given a :find clause and :where clause, this generates a new rule by embedding all the expressions as the antecedents of a new rule, with a new rule consequent defined containing the variables designated of interest by the :find clause.
(->where-rule-vars find-lvars input-lvars)
Produce a datastructure of spec-conformant rule-vars given the find-lvars and input-lvars of a where clause.
Produce a datastructure of spec-conformant rule-vars given the find-lvars and input-lvars of a where clause.
(lvar-is-src-var? lvar)
Is it a ?src__ lvar?
Is it a ?src__ lvar?
(pred-info->pred-gens sym->pred-info)
Pass in the map of predicate symbols to predicate information maps, and get out a map of predicate symbols to functions that generate the appropriate Predicate objects for the datalog engine.
Pass in the map of predicate symbols to predicate information maps, and get out a map of predicate symbols to functions that generate the appropriate Predicate objects for the datalog engine.
(pred-merge map-1 map-2)
As we process the query, we build up maps containing information about the predicates used in the query: which of its variables are required, how many arguments are given to the predicate, and whether the predicate is extensional, evaluable, or a rule reference. When distinct instances of the predicate are encountered, the maps are merged: the resulting map should be the same, but with the union of the required-args data from the original two. In addition, equality is insisted for the types in the two maps and the argument counts in the two maps.
As we process the query, we build up maps containing information about the predicates used in the query: which of its variables are required, how many arguments are given to the predicate, and whether the predicate is extensional, evaluable, or a rule reference. When distinct instances of the predicate are encountered, the maps are merged: the resulting map should be the same, but with the union of the required-args data from the original two. In addition, equality is insisted for the types in the two maps and the argument counts in the two maps.
(preprocess-where-with-rules query)
Handles the implicit '$ by checking the entire query and body of rules for any data patterns. If an implicit '$ is required, this makes it explicit, handles defining (or not) default src-vars for the where body and for the individual rules. Returns a (possibly modified) query-ast, a rule derived from the where body, and a map containing (possibly) default src vars; one for the where, one for the rules: {:keys [where rules]}.
Handles the implicit '$ by checking the entire query and body of rules for any data patterns. If an implicit '$ is required, this makes it explicit, handles defining (or not) default src-vars for the where body and for the individual rules. Returns a (possibly modified) query-ast, a rule derived from the where body, and a map containing (possibly) default src vars; one for the where, one for the rules: {:keys [where rules]}.
(process-clauses clauses default-src-var datom-pred-sym)
Recursive depth-first pass of ast, generating a map with the keys :clauses, :rules, :sym->pred-info, and :sym->evals. :sym->pred-info is a map from predicate symbols to consistency-verified information maps (see pred-merge) for each predicate. :sym->evals is a map from predicate symbols to appropriate Evaluable objects. :rules is just a collection of expressions encoding all rule declarations created while traversing (for example, by processing an orjoin): [(rule-pred & args) [& clauses]].
Recursive depth-first pass of ast, generating a map with the keys :clauses, :rules, :sym->pred-info, and :sym->evals. :sym->pred-info is a map from predicate symbols to consistency-verified information maps (see pred-merge) for each predicate. :sym->evals is a map from predicate symbols to appropriate Evaluable objects. :rules is just a collection of expressions encoding all rule declarations created while traversing (for example, by processing an orjoin): [(rule-pred & args) [& clauses]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close