Rete.Network.Node.Query (Rete v0.5.0)

Copy Markdown View Source

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

There is no parameter list. A query is its conditions and its body. Rete.Engine.query/3 lets the caller constrain any variable in :bind.

:index is the key sets Rete.Ruleset.index/2 declared, each sorted. A filter whose keys are a superset of one of them reads a bucket instead of every match. It changes speed and nothing else, so an empty list only means every filter scans.

Summary

Types

t()

@type t() :: %Rete.Network.Node.Query{
  bind: [atom()],
  hash: integer(),
  id: non_neg_integer() | nil,
  index: [[atom()]],
  module: module(),
  name: atom(),
  rhs: fun()
}