package acgtk

  1. Overview
  2. Docs
type program = {
  1. rules : Rule.Rules.t Predicate.PredMap.t;
  2. edb : ASPred.pred_id list;
  3. edb_facts : Predicate.FactSet.t Predicate.PredMap.t;
  4. idb : ASPred.pred_id list;
  5. pred_table : ASPred.PredIdTable.table;
  6. const_table : Datalog_AbstractSyntax.ConstGen.Table.table;
  7. rule_id_gen : UtilsLib.IdGenerator.IntIdGen.t;
}
val empty : program
val make_program : ASProg.program -> program
val temp_facts : Rule.rule -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> ((ASPred.predicate * Predicate.FactSet.elt list) -> Rule.rule -> 'a -> 'a) -> 'a -> ASPred.PredIdTable.table -> Datalog_AbstractSyntax.ConstGen.Table.table -> 'a
val p_semantics_for_predicate : Predicate.PredMap.key -> program -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> Rule.FactArray.row Predicate.PredMap.t -> Predicate.PremiseSet.t Predicate.PredicateMap.t -> Predicate.FactSet.t * Predicate.PremiseSet.t Predicate.PredicateMap.t
val seminaive : program -> Rule.FactArray.row Predicate.PredMap.t * Predicate.PremiseSet.t Predicate.PredicateMap.t
val to_abstract : program -> ASProg.program
val extend : program -> ASProg.modifier -> program

add_rule i r p adds a ASRule.rule to a Datalog.Program with the assumption that it will not change the m nature of any predicate (that is making it change from extensional to intensional). If i is set to true, then the rule concerns an intensional predicate. If it is set to false then it concerns an extensional predicate and the rhs of the rule should be empty.

val add_rule : intensional:bool -> ASRule.rule -> program -> program
val remove_rule : int -> ASPred.pred_id -> program -> program

remove_rule id p returns the program p from which the rule with id id has been removed.

IMPORTANT: This function only deals with rules introducing intensional predicate, because it is used when a constant is given several interpretations in a lexicon.

val get_fresh_rule_id : program -> int * program
val get_fresh_cst_id : string -> program -> Datalog_AbstractSyntax.ConstGen.id * program
val add_pred_sym : string -> program -> ASPred.pred_id * program
val build_forest : ?query:Datalog_AbstractSyntax.AbstractSyntax.Predicate.predicate -> Predicate.PremiseSet.t Predicate.PredicateMap.t -> program -> int UtilsLib.SharedForest.SharedForest.tree list list
val edb_to_buffer : program -> Stdlib.Buffer.t
val edb_to_log : Logs.src -> Logs.level -> program -> unit
OCaml

Innovation. Community. Security.