sim_datalog
Predict new derived facts from hypothetical graph changes without committing. Simulate dependencies by adding nodes or edges to see what new facts would appear.
Instructions
Predict which NEW derived facts a hypothetical change would create — WITHOUT committing anything (what-if simulation).
Give it hypothetical nodes and/or edges; it evaluates the program over base ∪ overlay and returns only the facts that are NEW vs the current graph (sim ∖ base).
Default program is the bundled depends.dl, so the common use is previewing module dependencies:
"If module A imported B, which NEW dependencies appear?" → sim_datalog(predicate="depends", edges=[{src:"", dst:"", edgeType:"IMPORTS_FROM"}])
Hypothetical node ids may be NEW (invent a decimal id) — an edge may reference them, so you can simulate a wholly new module/import, not only bridge existing nodes. The committed graph is never touched. Companion to explain_gap: gap names the missing premise, sim verifies that adding it produces the fact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| predicate | Yes | The derived predicate whose NEW facts to predict (e.g. "depends"). | |
| nodes | No | Hypothetical nodes to overlay. | |
| edges | No | Hypothetical edges to overlay. | |
| source | No | Optional Datalog program (derive engine); empty/omitted ⇒ the bundled depends.dl. |