API Reference Rete v#0.2.0

Copy Markdown View Source

Modules

Collects rule, expression and taxonomy data from ruleset modules.

A rule whose left hand side is satisfied, waiting to fire.

The activations waiting to fire, most salient first.

Turns ruleset modules into a Rete.Network.

The beta side of the network: a graph of Rete.Network.Node descriptions.

Turns a Rete.IR.CompoundNegation into something a Rete network can express.

Topological ordering of the left hand side of a production.

Binding classification and guard splitting.

Expression construction and code generation: the last phase of the DSL front end.

Gate normalization: the phase between parsing and binding classification.

Turns the quoted arguments of Rete.Ruleset.defrule/2 and Rete.Ruleset.defquery/2 into Rete.IR structs.

Scope-aware variable analysis for DSL fragments.

A fact that matched one condition, with the bindings that match produced.

The propagation loop and the fire cycle.

What each node kind does when tokens or elements arrive.

Everything that changes while rules fire, as one value threaded through the loop.

The intermediate representation (IR) shared by every compile phase of Rete.

A collection binding — for example, [{:order, id}], or orders = [{:order, id} when amt > 0].

The negation of a conjunction: "no match satisfies all of these at once".

A compile-time generated named function that lives in the ruleset module.

A single fact condition — for example, {:order, id, amt}, %Order{id: id}, or f = {:order, id} when amt > 0.

An unnormalized logical gate, {gate, [condition, ...]}.

The negation of a single condition.

A rule or a query.

A guard over bindings only, with no fact input.

Asking a session why.

Observing what a session does, through one callback.

Records every event, newest last.

Writes a readable line per event.

Working memory: everything a session knows, as one immutable value.

One join key's worth of elements or tokens: an ordered multiset.

A compiled rulebase: everything the engine needs, and nothing that changes.

The node descriptions the engine runs.

A collection binding: gathers every element matching the token into a list.

A collection binding whose membership also depends on a cross-condition guard, so the candidates cannot be reduced until a token is known.

Matches one condition against a single fact, independently of any token.

A hash join plus a filter that needs the token and the fact together.

Joins tokens to elements on equality of :join_bind. The common case: no guard reaches across conditions, so the join is a hash lookup.

Propagates a token only while no element matches it on :join_bind.

A negation whose match also depends on a cross-condition guard.

A terminal node for a rule. Firing it calls :rhs with the token's bindings, and logically inserts whatever comes back.

A terminal node for a query. Holds the tokens that reached it, to be read back by name.

The first condition of a rule. Has no token to join against, so it turns each matching element straight into a token.

A predicate over the token's bindings, with no fact input. Produced by a rule level when guard.

Macros for defining rulesets in a Rete network.

A session is an immutable value: every operation returns a new one.

Decides which alpha nodes a fact must be offered to.

A partial match travelling down the beta network: what a rule has established so far.