The built-in functions are symbols that have a special meaning. The meaning is given by a set of OCaml functions that can evaluate applications of the function symbol to arguments.
For instance, sum is a special built-in function that tries to add its arguments if those are constants.
An index is a specialized data structured that is used to efficiently store and retrieve data by a key, where the key is a term. Retrieval involves finding all data associated with terms that match, or unify with, a given term.
Rewriting consists in having a set of rules, oriented from left to right, that we will write l -> r (say "l rewrites to r"). Any term t that l matches is rewritten into r by replacing it by sigma(r), where sigma(l) = t.
val ask :
?oc:bool ->?with_rules:C.t list->?with_facts:T.t list->DB.t->T.t->T.t list
Returns the answers to a query in a given DB. Additional facts and rules can be added in a local scope.
parameteroc
enable occur-check in unification (default false)
val ask_lits :
?oc:bool ->?with_rules:C.t list->?with_facts:T.t list->DB.t->T.t list->Lit.t list->T.t list
Extension of ask, where the query ranges over the list of variables (the term list), all of which must be bound in the list of literals that form a constraint.
ask_lits db vars lits queries over variables vars with the constraints given by lits.
Conceptually, the query adds a clause (v1, ..., vn) :- lits, which should respect the same safety constraint as other clauses.
returns
a list of answers, each of which is a list of terms that map to the given list of variables.