package datalog

  1. Overview
  2. Docs
An in-memory datalog implementation for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

datalog-0.7.tbz
sha256=13ca520bddf4f0c44d1468bc89347be72ec543be58fff29469a0da24956be541
sha512=25d6e9cb5abe8aa1110730d884abb9e51ae78bf681b3f21709efa32359b9cbdd97d9076761c91562580c090cbce12ce159c97533ae5d9d427c24cb329e950793

doc/datalog.caml_interface/Datalog_caml_interface/Parse/index.html

Module Datalog_caml_interface.ParseSource

include TopDown.PARSE with type term = Logic.T.t and type lit = Logic.Lit.t and type clause = Logic.C.t
Sourcetype term = Logic.T.t
Sourcetype clause = Logic.C.t
Sourcetype name_ctx = (string, term) Hashtbl.t
Sourceval create_ctx : unit -> name_ctx
Sourceval term_of_ast : ctx:name_ctx -> Datalog_top_down.AST.term -> term
Sourceval clause_of_ast : ?ctx:name_ctx -> Datalog_top_down.AST.clause -> clause
Sourceval clauses_of_ast : ?ctx:name_ctx -> Datalog_top_down.AST.clause list -> clause list
Sourceval parse_chan : in_channel -> [ `Ok of clause list | `Error of string ]
Sourceval parse_file : string -> [ `Ok of clause list | `Error of string ]
Sourceval parse_string : string -> [ `Ok of clause list | `Error of string ]
Sourceval clause_of_string : string -> clause

Parse a clause from a string, or fail. Useful shortcut to define properties of relations without building terms by hand.

  • raises Failure

    if the string is not a valid clause

Sourceval term_of_string : string -> term
  • raises Failure

    if the string is not a valid term

Additional functions, to load clauses directly into the DB

Sourceval load_chan : Logic.DB.t -> in_channel -> bool
Sourceval load_file : Logic.DB.t -> string -> bool
Sourceval load_string : Logic.DB.t -> string -> bool
OCaml

Innovation. Community. Security.