Expand description
Lowering from AST to IR
This module transforms Datalog programs (AST) into the Relational IR (RIR) representation for execution. The lowering process:
- Infers schemas from facts and predicate declarations
- Tracks variable positions across atoms for join key computation
- Builds left-deep join trees for multi-atom rule bodies
- Handles negation via set difference (Diff) nodes
- Wraps recursive predicates in Fixpoint nodes
- Projects to match head variables
Structsยง
- Lowerer
- Lowerer transforms AST programs into RIR execution plans.