package datalog

  1. Overview
  2. Docs

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.