Locy Compiler Internals¶
Responsibilities¶
The compiler transforms Locy AST into an executable, validated, stratified program.
Main Stages¶
- Module context resolution.
- Rule grouping and dependency graph construction.
- Type and schema checks.
- Wardedness and safety checks.
- Stratification and topological ordering.
- Command validation and binding checks.
Key Guarantees¶
- No undefined rule references.
- No cyclic negation.
- Output schema consistency for overloaded rules.
- Guardrails for recursive aggregation semantics.
Outputs¶
CompiledProgram- Ordered strata and command list
- Validation-ready metadata for execution