engine.rete.compiler¶
Rule compilation into RETE intermediate representations.
Classes¶
A constant-position filter used by the alpha side of the network. |
|
Normalized triple body condition with explicit alpha constraints and binders. |
|
Normalized predicate condition with explicit binding dependencies. |
|
Compiler output consumed by RETE network construction. |
|
Construction-time utility for ordering joins in conjunctive rule bodies. |
|
Entry point for translating public rule definitions into RETE IR. |
Module Contents¶
- class engine.rete.compiler.AlphaConstraint(/, **data: Any)¶
Bases:
pydantic.BaseModelA constant-position filter used by the alpha side of the network.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- position: Literal['subject', 'predicate', 'object']¶
- value: rdflib.term.Node¶
- class engine.rete.compiler.CompiledTripleCondition(/, **data: Any)¶
Bases:
pydantic.BaseModelNormalized triple body condition with explicit alpha constraints and binders.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- pattern: engine.rules.TriplePattern¶
- constraints: tuple[AlphaConstraint, Ellipsis] = None¶
- class engine.rete.compiler.CompiledPredicateCondition(/, **data: Any)¶
Bases:
pydantic.BaseModelNormalized predicate condition with explicit binding dependencies.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- arguments: tuple[rdflib.term.Node, Ellipsis] = None¶
- class engine.rete.compiler.CompiledRule(/, **data: Any)¶
Bases:
pydantic.BaseModelCompiler output consumed by RETE network construction.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- rule_id: engine.proof.RuleId¶
- triple_conditions: tuple[CompiledTripleCondition, Ellipsis] = None¶
- predicate_conditions: tuple[CompiledPredicateCondition, Ellipsis] = None¶
- productions: tuple[engine.rete.consequents.TripleProduction, Ellipsis] = None¶
- callbacks: tuple[engine.rete.consequents.CallbackSchedule, Ellipsis] = None¶
- contradictions: tuple[engine.rete.consequents.ContradictionSchedule, Ellipsis] = None¶
- class engine.rete.compiler.JoinOptimizer¶
Construction-time utility for ordering joins in conjunctive rule bodies.
- static order_triple_conditions(conditions: tuple[CompiledTripleCondition, Ellipsis]) tuple[CompiledTripleCondition, Ellipsis]¶
Order triple joins using simple selectivity heuristics.
More constants are better. Constant predicates are preferred, and constants other than rdf:type are treated as more selective.
- class engine.rete.compiler.RuleCompiler¶
Entry point for translating public rule definitions into RETE IR.
This remains a programmatic rule-definition boundary; no text syntax is implied by this scaffold.
- classmethod compile_rule(rule: engine.rules.Rule) CompiledRule¶
Translate one public
Ruleinto compiled RETE IR.