engine.rete.facts

Working-memory facts and partial matches used by the RETE network.

Classes

Fact

Fundamental unit of data within the RETE internals.

PartialMatch

Represent facts satisfying a subset of a rule's preconditions.

Functions

fact_id_for_triple(→ str)

Return the canonical internal id for one RDFLib triple.

Module Contents

engine.rete.facts.fact_id_for_triple(triple: axiom.common.Triple) → str

Return the canonical internal id for one RDFLib triple.

class engine.rete.facts.Fact(/, **data: Any)

Bases: pydantic.BaseModel

Fundamental unit of data within the RETE internals.

In the current design, logical entailment is triple-oriented. Any broader RETE-OO-style object handling remains internal scaffolding and MUST NOT bypass the engine’s triple-based materialization contract.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: str = None
triple: axiom.common.Triple = None
stated: bool = None
class engine.rete.facts.PartialMatch(/, **data: Any)

Bases: pydantic.BaseModel

Represent facts satisfying a subset of a rule’s preconditions.

Partial matches are the join-time support structure later referenced by agenda scheduling, justification tracking, and explanation reconstruction.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

facts: tuple[Fact, Ellipsis] = None
bindings: dict[str, rdflib.term.Node] = None
depth: int = None