AbcDatalog provides several evaluation engines, each implementing theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HarvardPL/AbcDatalog/llms.txt
Use this file to discover all available pages before exploring further.
DatalogEngine interface. They differ in their evaluation strategy (bottom-up saturation vs. top-down query-driven), concurrency model, and the Datalog features they support. Because every engine exposes the same init() / query() interface, you can swap engines with a single-line change.
Engine comparison
| Engine class | Algorithm | Concurrent | Supports negation | Supports unification |
|---|---|---|---|---|
SemiNaiveEngine | Semi-naive bottom-up | No | Yes (stratified) | Yes |
ConcurrentBottomUpEngine | Semi-naive bottom-up | Yes | No | Yes |
ConcurrentChunkedBottomUpEngine | Semi-naive bottom-up (chunked) | Yes | No | Yes |
ConcurrentStratifiedNegationBottomUpEngine | Semi-naive bottom-up | Yes | Yes (stratified) | Yes |
IterativeQsqEngine | Top-down QSQ iterative | No | No | No |
Decision guide
I need stratified negation
I need stratified negation
Use
SemiNaiveEngine (sequential) or ConcurrentStratifiedNegationBottomUpEngine (parallel). Both handle stratified negation — rules where a negated body literal depends only on predicates in lower strata. If you also need provenance tracking, SemiNaiveEngine.newEngineWithProvenance() is the only option that currently supports it.I want parallel evaluation
I want parallel evaluation
Choose one of the concurrent engines:
ConcurrentBottomUpEngine— straightforward parallel semi-naive; no negation support.ConcurrentChunkedBottomUpEngine— batches newly derived facts into chunks before submitting work, which can improve throughput when the derived fact set is large.ConcurrentStratifiedNegationBottomUpEngine— concurrent engine that also handles stratified negation.
I want top-down query-driven evaluation
I want top-down query-driven evaluation
Use
IterativeQsqEngine. It uses the Query-Subquery (QSQ) algorithm, which starts from the query and works backwards through rules, deriving only what is needed to answer the specific query. This is advantageous when only a small fraction of all derivable facts is relevant. Note that it does not support negation or explicit unification/disunification.Common usage pattern
All engines share the same lifecycle, so the code that interacts with aDatalogEngine is engine-agnostic.
Further reading
- Bottom-up engines — semi-naive evaluation, sequential and concurrent variants
- Top-down engine — QSQ algorithm and when to prefer it
- Provenance — tracing fact derivations with
DatalogEngineWithProvenance