package datalog

  1. Overview
  2. Docs

Parameters

module C : PARSABLE_CONST
module TD : S with type Const.t = C.t

Signature

type term = TD.T.t
type lit = TD.Lit.t
type clause = TD.C.t
type name_ctx = (string, term) Hashtbl.t
val create_ctx : unit -> name_ctx
val term_of_ast : ctx:name_ctx -> AST.term -> term
val lit_of_ast : ctx:name_ctx -> AST.literal -> lit
val clause_of_ast : ?ctx:name_ctx -> AST.clause -> clause
val clauses_of_ast : ?ctx:name_ctx -> AST.clause list -> clause list
val parse_chan : in_channel -> [ `Ok of clause list | `Error of string ]
val parse_file : string -> [ `Ok of clause list | `Error of string ]
val parse_string : string -> [ `Ok of clause list | `Error of string ]
val 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

val term_of_string : string -> term
  • raises Failure

    if the string is not a valid term

OCaml

Innovation. Community. Security.