Documentation 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.
DatalogEngineWithProvenance extends DatalogEngine with support for why-provenance queries. After initializing and querying the engine as usual, you can call getJustification to retrieve the last rule that was used to derive a specific ground fact. By recursively calling getJustification on the body atoms of the returned clause, you can reconstruct a full provenance tree explaining why any derived fact holds.
All methods from DatalogEngine — init, query(PositiveAtom), and query(List<PositiveAtom>) — are available unchanged. See the DatalogEngine reference for their documentation.
Methods
getJustification
null if the atom is an EDB base fact (not derived by any rule) or has not been derived at all.
A ground atom (all arguments must be constants) whose provenance you want to inspect.
A ground, variable-free clause whose head matches
fact. The body lists the ground premises used to fire the rule. Returns null if the fact is not derived.getJustification on each PositiveAtom premise recursively. When getJustification returns null for a body atom, that atom is a base EDB fact — the leaf of the derivation tree.
Code example
The following example is adapted fromSemiNaiveEngine.main:
Concrete implementation
The only current implementation isSemiNaiveEngine, obtained through the factory method:
DatalogEngine without provenance tracking (lower memory overhead), use SemiNaiveEngine.newEngine() instead.