object
datalog
Portable Datalog engine with stratified negation and incremental updates.
logtalk_load(datalog(loader))static, context_switching_callsPublic predicates
(no local declarations; see entity ancestors if any)
Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
rule_/3
Table of loaded rules represented as rule id, head, and body literals.
dynamicrule_(Id,Head,Body)rule_(?nonvar,?callable,?list) - zero_or_moreedb_fact_/1
Table of extensional database (EDB) facts.
dynamicedb_fact_(Fact)edb_fact_(?callable) - zero_or_moreidb_fact_/1
Table of intensional database (IDB) currently derived facts.
dynamicidb_fact_(Fact)idb_fact_(?callable) - zero_or_moresupport_count_/2
Table of derivation support counts for currently derived facts.
dynamicsupport_count_(Fact,Count)support_count_(?callable,?integer) - zero_or_moresupport_edge_/3
Table of concrete derivation edges as fact, rule id, and supporting literals.
dynamicsupport_edge_(Fact,RuleId,Supports)support_edge_(?callable,?nonvar,?list) - zero_or_morepredicate_stratum_/3
Table of computed predicate strata represented as name, arity, and stratum number.
dynamicpredicate_stratum_(Name,Arity,Stratum)predicate_stratum_(?atom,?integer,?integer) - zero_or_moresnapshot_/6
Transaction snapshot of rules, EDB facts, IDB facts, support counts, support edges, and predicate strata.
dynamicsnapshot_(Rules,EdbFacts,IdbFacts,SupportCounts,SupportEdges,PredicateStrata)snapshot_(?list,?list,?list,?list,?list,?list) - zero_or_onerestore_snapshot/6
Restores a saved transaction snapshot into the current engine state.
staticrestore_snapshot(Rules,EdbFacts,IdbFacts,SupportCounts,SupportEdges,PredicateStrata)restore_snapshot(+list,+list,+list,+list,+list,+list) - onerestore_edb_facts/1
Restores EDB facts from a saved list.
staticrestore_edb_facts(Facts)restore_edb_facts(+list(callable)) - onerestore_idb_facts/1
Restores IDB facts from a saved list.
staticrestore_idb_facts(Facts)restore_idb_facts(+list(callable)) - onerestore_support_counts/1
Restores support counts from a saved list.
staticrestore_support_counts(Supports)restore_support_counts(+list) - onerestore_support_edges/1
Restores support edges from a saved list.
staticrestore_support_edges(Edges)restore_support_edges(+list) - onerestore_predicate_strata/1
Restores predicate strata from a saved list.
staticrestore_predicate_strata(Strata)restore_predicate_strata(+list) - onestrata_from_numbers/2
Builds grouped strata terms from a sorted list of stratum numbers.
staticstrata_from_numbers(StratumNumbers,Strata)strata_from_numbers(+list(integer),-list) - onepredicates_in_stratum/2
Returns predicates in a given stratum as sorted predicate(Name, Arity) terms.
staticpredicates_in_stratum(Stratum,Predicates)predicates_in_stratum(+integer,-list) - onehas_aggregate_rules/0
True when at least one loaded rule body contains an aggregate literal.
statichas_aggregate_rules - zero_or_oneaggregate_body_predicate/2
Enumerates predicate indicators referenced in aggregate goals from a body literal list.
staticaggregate_body_predicate(Body,Predicate)aggregate_body_predicate(+list,-compound) - zero_or_morederive_aggregate_literal/2
Evaluates an aggregate literal and returns a normalized support term.
staticderive_aggregate_literal(AggregateLiteral,Support)derive_aggregate_literal(+compound,-nonvar) - zero_or_onederive_aggregate_goals/1
Succeeds when all aggregate goals are true for the current bindings.
staticderive_aggregate_goals(Goals)derive_aggregate_goals(+list(callable)) - zero_or_oneoptimize_rule_body/2
Normalizes a rule body by placing positive ground literals first, then positive non-ground literals, then aggregates, and finally negative literals.
staticoptimize_rule_body(Body,OptimizedBody)optimize_rule_body(+list,-list) - onepartition_body_literals/5
Partitions body literals into positive-ground, positive-non-ground, aggregate, and negative lists preserving relative order.
staticpartition_body_literals(Body,PositiveGround,PositiveNonGround,Aggregates,Negatives)partition_body_literals(+list,-list,-list,-list,-list) - oneliteral_bucket/2
Classifies a body literal into one of the normalization buckets.
staticliteral_bucket(Literal,Bucket)literal_bucket(+nonvar,-atom) - oneOperators
(none)