Module S.Term

A Datalog term is either a Variable.t or a constant.

type t

The type of a term.

Constructors

val make_variable : string -> t

make_variable id returns a new variable term with identifier id.

val make_constant : constant -> t

make_constant c returns a new constant term with value c.

Predicates and Comparison

val is_variable : t -> bool

is_variable term returns true if term is a variable.

val is_constant : t -> bool

is_constant term returns true if term is a constant.

val compare : t -> t -> int

compare a b performs a comparisson between terms a and b.

Mapping

val map : ( string -> 'a ) -> ( constant -> 'a ) -> t -> 'a

map f g term applies f on term if it is a variable or g if it is a constant.

IO

val parser : t Angstrom.t

parser reads a term.

val pp : t Fmt.t

pp term pretty printer.