Module Make.Atom

A Datalog atom is a predicate symbol with a list of terms of type Term.t.

In Prolog syntax the atom

make "p" [(Term.make_constant 1) (Term.make_variable @@ Variable.make "x")]

is written as

p(1, 2, ?x)
type t

The type of an atom.

type predicate_symbol = string

Type of a predicate symbol.

Constructors

val make : predicate_symbol -> Term.t list -> t

make predicate terms returns a new atom with predicate symbol predicate and terms terms.

Predicates and Comparison

val predicate : t -> predicate_symbol
val terms : t -> Term.t list
val equal : t -> t -> bool
val equal_predicate : t -> t -> bool
val compare : t -> t -> int
val is_ground : t -> bool

is_ground atom returns true if all terms appearing in the atom are constants.

IO

val parser : t Angstrom.t
val pp : t Fmt.t