Datalogl.SOutput signature of the functor Make.
Constant type see Datalogl.CONSTANT.
module Variable : sig ... endA Datalog variable is a placeholder for arbirtary constants.
module Term : sig ... endA Datalog term is either a Variable.t or a constant.
module Clause : sig ... endA clause are expressions that allow us to deduce facts from other facts.
module Tuple : sig ... endmodule Database : sig ... endtype query = Atom.tval query :
database:Database.t ->
program:Program.t ->
query ->
Tuple.Set.t Lwt.tThe state of a Datalog evaluation can be reused for multiple queries or for re-querying the database after new tuples have been added. When reusing the state a considerably smaller amount of work is necessary.
init program Returns the initial state for evaluations with the Datalog program program.
val query_with_state :
database:Database.t ->
state:state ->
query ->
(state * Tuple.Set.t) Lwt.tquery_with_state ~database ~state query returns the set of answer tuples for query (see also query) as well as the updated state.
The set of answer tuples for a query is monotonically increasing with the updated state.
The database must also be monotonically increasing (tuples can not be deleted from the database). When new tuples are added to the database, they will be considered for answers to the query. But if tuples are removed from the databse the returned answer might contain tuples that are no longer valid with respect to the program and database.