srdatalog.ir.hir.split

Split-rule HIR transforms: Pass 4.5 (temp relation decl synthesis) and Pass 5.5 (temp index registration). Mirror the inline blocks in src/srdatalog/hir/hir.nim’s compileToHir.

Both passes run as regular HIR transforms, positioned around IndexSelectionPass: JoinPlannerPass (order 200) TempRelSynthesisPass (order 250) <– this file IndexSelectionPass (order 300) TempIndexRegistrationPass (order 350) <– this file

Split metadata (split_at, temp_vars, temp_rel_name) is populated by JoinPlannerPass from hir_plan._plan_variant.

Module Contents

Classes

TempIndexRegistrationPass

Pass 5.5: register the identity index [0..arity-1] for each split variant’s temp relation in its enclosing stratum’s required_indices and canonical_index. Runs after the main IndexSelectionPass so it only affects temp rels (which weren’t seen by the selection pass because they’re head-only here).

TempRelSynthesisPass

Pass 4.5: for each split variant, add a _temp_<RuleName> RelationDecl to the HirProgram (if not already declared). Temp is marked is_generated=True, is_temp=True. Column types inferred from above-split source relations.

API

class srdatalog.ir.hir.split.TempIndexRegistrationPass[source]

Pass 5.5: register the identity index [0..arity-1] for each split variant’s temp relation in its enclosing stratum’s required_indices and canonical_index. Runs after the main IndexSelectionPass so it only affects temp rels (which weren’t seen by the selection pass because they’re head-only here).

info

‘PassInfo(…)’

run(hir: srdatalog.ir.hir.types.HirProgram) srdatalog.ir.hir.types.HirProgram[source]
class srdatalog.ir.hir.split.TempRelSynthesisPass[source]

Pass 4.5: for each split variant, add a _temp_<RuleName> RelationDecl to the HirProgram (if not already declared). Temp is marked is_generated=True, is_temp=True. Column types inferred from above-split source relations.

info

‘PassInfo(…)’

run(hir: srdatalog.ir.hir.types.HirProgram) srdatalog.ir.hir.types.HirProgram[source]