package datalog
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4a2d12d630a5edd694968675a84a3ef5
sha512=685c0e186705837cb3ac66df6e8011d9f6a9629484b3a813b767df95348d5a41f37301f3e199ed6c91a42a87d1563e8355377269176785b123eb297a5ad022d7
doc/datalog.unix/Datalog_unix/Make/argument-1-TD/index.html
Parameter Make.TD
module Const : Datalog_top_down.CONSTtype const = Const.tTerms
module T : sig ... endLiterals
module Lit : sig ... endClauses
module C : sig ... endSubsts
This module is used for variable bindings.
module Subst : sig ... endUnification, matching...
type scope = Subst.scopeFor unify and match_, the optional parameter oc is used to enable or disable occur-check. It is disabled by default.
Unify the two terms.
match_ a sa b sb matches the pattern a in scope sa with term b in scope sb.
Test for alpha equivalence.
Special version of alpha_equiv, using distinct scopes for the two terms to test, and discarding the result
Special built-in functions
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.
Note that a constant will never be interpreted.
module BuiltinFun : sig ... endThe following hashtables use alpha-equivalence checking instead of regular, syntactic equality
module TVariantTbl : Hashtbl.S with type key = T.tmodule CVariantTbl : Hashtbl.S with type key = C.tIndex
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.
module Index (Data : Hashtbl.HashedType) : sig ... endRewriting
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.
module Rewriting : sig ... endDB
A DB stores facts and clauses, that constitute a logic program. Facts and clauses can only be added.
Non-stratified programs will be rejected with NonStratifiedProgram.
module DB : sig ... endQuery
Returns the answers to a query in a given DB. Additional facts and rules can be added in a local scope.
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 listExtension 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.