Skip to main content

Module term_index

Module term_index 

Source
Expand description

Inverted index over TensorLogic terms for fast predicate/constant/variable lookup.

TermIndexBuilder maintains a posting-list index keyed by TermType. Each posting list is a Vec<TermRef> that records which rule (or fact) and at which position a given term appears. The index supports incremental construction (index_term), point lookups (lookup, lookup_predicate, lookup_constant), derived queries (rules_for_predicate), mutation (remove_rule, clear), and statistics (stats).

Structs§

IndexStats
Summary statistics for a TermIndexBuilder.
TermIndexBuilder
Builds and queries an inverted index over TensorLogic terms.
TermRef
A single posting-list entry: records which rule (or fact) mentions a term and at which position.

Enums§

TermPosition
Describes where in a rule (or as a standalone fact) a term appears.
TermType
The kind/value of a term used as an index key.