Module Predicate


module Predicate: sig .. end
Information associated with predicates. This includes:




Predicate Objects

type predicate 
The type of predicate objects.
val get_symbol : predicate -> Term.symbol
Get the symbol associated with the given predicate.
val get_declarations : predicate -> Opt.declaration list
Get the declarations associated with the given predicate.
val get_discrimination_hints : predicate -> Opt.discrimination_values
val get_delta_predicate : predicate -> predicate
val get_main_predicate : predicate -> predicate
val get_is_builtin : predicate -> bool
val get_all_bound_reader : predicate -> Access.Reader.reader
val get_writers : predicate -> Access.Writer.writer list
val has_delta_predicate : predicate -> bool
Note: predicate is assumed to be not a delta predicate.
val assert_unit_clause : predicate -> Term.term -> unit
Add a unit clause to the given predicate's extent. The predicate's status must at least be ready_to_assert.
val add_declaration : predicate -> Opt.declaration -> unit
Associate the given declaration object with the given predicate.
val extent_size : predicate -> int
Return the size of the given predicate's extent in the current model.
val default_reader : predicate -> Access.Reader.reader
Return some reader for the predicate, e.g. for unindexed iteration. Raises Not_found if there is no reader associated with the predicate.
val applicability : predicate -> Opt.binding_pattern -> Opt.applicability_value
val choose_best_reader : predicate -> Opt.binding_pattern -> Access.Reader.reader

Processing Status

val ensure_ready_to_assert : predicate -> unit
val ensure_ready_to_run : predicate -> unit
val ensure_delta_ready_to_run : predicate -> unit

Predicate Table

A predicate table maintains an association between predicate symbols and predicate objects.

type predicate_table 
module PredicateTable: sig .. end
val make_predicate_table : unit -> predicate_table
val find_predicate : predicate_table -> Term.symbol -> predicate
val abolish : predicate_table -> Term.symbol -> unit

Modifying Access

val insert : predicate -> Term.term -> Fact.entry -> unit
val remove_variant : predicate -> Term.term -> unit
val clear_delta_predicate : predicate -> unit