Rete.Element (Rete v0.1.0)

Copy Markdown View Source

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

Internal. Elements live on the right side of a beta node. An alpha node emits them, and a join pairs them with tokens arriving from the left.

Summary

Functions

The subset of an element's bindings used as a join key.

Types

t()

@type t() :: %Rete.Element{bindings: %{required(atom()) => term()}, fact: term()}

Functions

join_key(element, keys)

@spec join_key(t(), [atom()]) :: %{required(atom()) => term()}

The subset of an element's bindings used as a join key.

iex> element = %Rete.Element{fact: {:order, 1, 250}, bindings: %{cid: 1, amt: 250}}
iex> Rete.Element.join_key(element, [:cid])
%{cid: 1}