explain_fact
Justify a derived Datalog fact by returning the rule that derived it plus supporting body facts. Use to explain dependency edges.
Instructions
Explain WHY a derived (Datalog) fact holds — returns the rule that derived it plus the supporting body facts (why()/provenance).
This is the inverse of "what holds": instead of listing results, it justifies ONE result. Provenance is computed on demand against the current graph snapshot.
Default program is the bundled depends.dl, so the common use is explaining a MODULE→MODULE dependency edge:
"Why does module A depend on B?" → explain_fact(predicate="depends", key=["", ""])
For a custom rule, pass its source. key is the fact's ground tuple as wire-string
terms (node ids as their decimal id). A null/"no derivation" result means the fact
is not derivable by the program (it does not hold as a derived fact).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| predicate | Yes | The derived predicate to explain (e.g. "depends"). | |
| key | Yes | The fact's ground key tuple as wire-string terms (node ids as decimal). | |
| source | No | Optional Datalog program (derive engine); empty/omitted ⇒ the bundled depends.dl. |