# ExDatalog v0.5.0 - Table of Contents

A production-grade pure Elixir Datalog engine with semi-naive fixpoint evaluation.

## Pages

- [ExDatalog](readme.md)
- [Changelog](changelog.md)
- [What is Datalog?](what-is-datalog.md)
- [Constraints](constraints.md)
- [Storage Backends](storage-backends.md)
- [Quickstart Tutorial](quickstart.md)
- [Examples](examples.md)
- [DSL Tutorial](dsl-tutorial.md)
- [Migration: Builder API → DSL](migration-dsl.md)
- [Why Datalog on the BEAM](why-datalog-on-the-beam.md)
- [Building an Elixir Datalog DSL](building-an-elixir-datalog-dsl.md)
- [Datalog Rules as Elixir Macros](datalog-rules-as-elixir-macros.md)
- [Querying Materialized Knowledge](querying-materialized-knowledge.md)
- [Negation, Constraints, and Safety](negation-constraints-and-safety.md)
- [Query Planning in Datalog](query-planning-in-datalog.md)
- [Aggregates in Datalog](aggregates-in-datalog.md)
- [Extending Datalog with BEAM Callbacks](extending-datalog-with-beam-callbacks.md)
- [Magic Sets and Demand-Driven Evaluation](magic-sets-and-demand-driven-evaluation.md)
- [Migration: v0.4 → v0.5](migration-v0-5.md)

## Modules

- [ExDatalog](ExDatalog.md): ExDatalog — a pure Elixir Datalog engine.
- [ExDatalog.Capabilities](ExDatalog.Capabilities.md): Capability metadata for storage backends and constraint sets.
- [ExDatalog.Constraint.Context](ExDatalog.Constraint.Context.md): Evaluation context passed to constraint implementations.
- [ExDatalog.Constraints.Aggregate](ExDatalog.Constraints.Aggregate.md): Aggregate constraint evaluation: `count`, `sum`, `min`, `max`.
- [ExDatalog.Constraints.Arithmetic](ExDatalog.Constraints.Arithmetic.md): Arithmetic constraint implementation for the Constraint behaviour.
- [ExDatalog.Constraints.BeamCallback](ExDatalog.Constraints.BeamCallback.md): Evaluation of BEAM callback predicates.
- [ExDatalog.Constraints.Comparison](ExDatalog.Constraints.Comparison.md): Comparison constraint implementation for the Constraint behaviour.
- [ExDatalog.Constraints.Membership](ExDatalog.Constraints.Membership.md): Membership constraint implementation for the Constraint behaviour.
- [ExDatalog.Constraints.StringPredicate](ExDatalog.Constraints.StringPredicate.md): String predicate constraint implementation for the Constraint behaviour.
- [ExDatalog.Constraints.Type](ExDatalog.Constraints.Type.md): Type predicate constraint implementation for the Constraint behaviour.
- [ExDatalog.Explain.Node](ExDatalog.Explain.Node.md): A node in a derivation tree representing a rule-derived fact.
- [ExDatalog.Schema.PredicateMeta](ExDatalog.Schema.PredicateMeta.md): Metadata for a callback predicate declared with the `predicate/5` macro.

- Program Builder
  - [ExDatalog.Atom](ExDatalog.Atom.md): A Datalog atom: a relation reference with a list of terms.
  - [ExDatalog.Constraint](ExDatalog.Constraint.md): Built-in predicates: comparisons, arithmetic, type checks, string
predicates, membership, and extensible constraint evaluation.
  - [ExDatalog.Program](ExDatalog.Program.md): Builder for constructing Datalog programs.
  - [ExDatalog.Rule](ExDatalog.Rule.md): A Datalog rule: `head :- body [, constraints]`.
  - [ExDatalog.Term](ExDatalog.Term.md): Term types used in Datalog atom arguments.

- Validation
  - [ExDatalog.Validator](ExDatalog.Validator.md): Validation pipeline for ExDatalog programs.
  - [ExDatalog.Validator.Error](ExDatalog.Validator.Error.md): Structured validation error types for ExDatalog programs.
  - [ExDatalog.Validator.Safety](ExDatalog.Validator.Safety.md): Variable safety and range restriction checks for ExDatalog programs.
  - [ExDatalog.Validator.Stratification](ExDatalog.Validator.Stratification.md): Stratification checks for ExDatalog programs.

- Compiler &amp; IR
  - [ExDatalog.Compiler](ExDatalog.Compiler.md): Compiles a validated `ExDatalog.Program` into an `ExDatalog.IR` program.
  - [ExDatalog.Compiler.Stratifier](ExDatalog.Compiler.Stratifier.md): Assigns strata to relations and rules in a validated Datalog program.
  - [ExDatalog.IR](ExDatalog.IR.md): Intermediate representation (IR) types for compiled Datalog programs.
  - [ExDatalog.IR.Atom](ExDatalog.IR.Atom.md): An IR atom: a relation reference with a list of IR terms.

  - [ExDatalog.IR.Callback](ExDatalog.IR.Callback.md): An IR callback predicate: an Elixir function invoked during evaluation.
  - [ExDatalog.IR.Constraint](ExDatalog.IR.Constraint.md): An IR constraint: a comparison or arithmetic predicate.
  - [ExDatalog.IR.Fact](ExDatalog.IR.Fact.md): An IR fact: a ground tuple asserted as true for a given relation.

  - [ExDatalog.IR.Relation](ExDatalog.IR.Relation.md): An IR relation: a named schema with arity and type information.

  - [ExDatalog.IR.Rule](ExDatalog.IR.Rule.md): An IR rule: a head atom, a body of literals, an assigned stratum, and
optional metadata.

  - [ExDatalog.IR.Stratum](ExDatalog.IR.Stratum.md): An IR stratum: a group of rules and relations that must be evaluated
together, ordered by stratum index.

- Planner
  - [ExDatalog.Planner](ExDatalog.Planner.md): Query/evaluation planner for ExDatalog.
  - [ExDatalog.Planner.Join](ExDatalog.Planner.Join.md): A planned join: one positive body atom position within a rule.
  - [ExDatalog.Planner.Plan](ExDatalog.Planner.Plan.md): An execution plan for a compiled IR program.
  - [ExDatalog.Planner.Predicate](ExDatalog.Planner.Predicate.md): A planned predicate: a non-relational body element (constraint, aggregate,
or callback) classified by kind.
  - [ExDatalog.Planner.Stratum](ExDatalog.Planner.Stratum.md): A planned stratum: the rules and relations evaluated together at one
stratum index.

- Engine
  - [ExDatalog.Engine](ExDatalog.Engine.md): Behaviour for pluggable Datalog evaluation backends.
  - [ExDatalog.Engine.Binding](ExDatalog.Engine.Binding.md): Binding environment for Datalog rule evaluation.
  - [ExDatalog.Engine.ConstraintEval](ExDatalog.Engine.ConstraintEval.md): Constraint evaluation for Datalog rule bodies.
  - [ExDatalog.Engine.Evaluator](ExDatalog.Engine.Evaluator.md): Single-rule evaluation using k-position semi-naive delta computation.
  - [ExDatalog.Engine.Join](ExDatalog.Engine.Join.md): Stateless join primitives for semi-naive Datalog evaluation.
  - [ExDatalog.Engine.Naive](ExDatalog.Engine.Naive.md): Semi-naive fixpoint evaluation engine.

- Magic Sets
  - [ExDatalog.MagicSets](ExDatalog.MagicSets.md): Magic-sets program transformation for demand-driven (goal-directed) evaluation.

- Storage
  - [ExDatalog.Storage](ExDatalog.Storage.md): Behaviour for pluggable relation storage backends.
  - [ExDatalog.Storage.ETS](ExDatalog.Storage.ETS.md): ETS-based storage implementation using per-relation tables.
  - [ExDatalog.Storage.Map](ExDatalog.Storage.Map.md): Map-based storage implementation using Maps and MapSets.

- Knowledge
  - [ExDatalog.Explain](ExDatalog.Explain.md): Derivation tree explanation for Datalog knowledge.
  - [ExDatalog.Knowledge](ExDatalog.Knowledge.md): The complete knowledge base produced by Datalog evaluation.
  - [ExDatalog.Telemetry](ExDatalog.Telemetry.md): Telemetry event definitions for ExDatalog evaluation.

- DSL
  - [ExDatalog.Callback](ExDatalog.Callback.md): A BEAM callback predicate: an Elixir function invoked during rule evaluation.
  - [ExDatalog.DSL.CompileError](ExDatalog.DSL.CompileError.md): Raised when a DSL macro cannot be compiled.
  - [ExDatalog.Schema](ExDatalog.Schema.md): An Ecto-inspired DSL for defining Datalog programs.
  - [ExDatalog.UnsupportedFeature](ExDatalog.UnsupportedFeature.md): Returned when a DSL feature is recognized but not yet implemented.

