Liking cljdoc? Tell your friends :D
Clojure only.

vaelii.impl.reads

The named entry points onto the index — a read as stored, or a read as believed.

The fourth invariant is that a stored sentex is not a believed one (README.md, "The model in one page"). Every IndexStore posting is storage: it holds a defeated default, a conclusion whose support was withdrawn and a spelling an equality retired, because all three are revivable and the index is not where belief lives. So a caller reading a posting has a question to answer, and until it is asked in the name of the read nothing distinguishes the caller that answered it from the one that forgot.

This namespace is where it is asked. Every raw vaelii.impl.protocols index read outside a short roster of implementers goes through an entry point here, and the entry point's own name says which answer it gives — lein lint's E16 is what keeps that true, and its roster is the one place the exceptions are written down.

The two entry points, and why they take different arguments

  • as-stored-… takes the index store. An as-stored read is an index operation, so the entry point's arglist is the protocol method's and nothing else is in scope. A caller reaching one is saying it wants storage: a candidate set it filters itself, a roster that must over-approximate, a diagnostic that reports what is written. Each entry point below says what a stored-but-disbelieved answer is for.
  • believed-… takes the KB. Belief lives in the JTMS, so a believed read is a question about the KB and not about the index — which is exactly the distinction the arglists carry. The filter is jtms/in?, which already drops a superseded spelling along with a defeated one (vaelii.impl.jtms's -in?), so a believed entry point means what kb/sentexes-matching means for the handles it yields.

An entry point over a named method is a wrapper and never a rewrite: one call to the method, the same laziness, the same count-aware path. An entry point over the family-* methods tallies its family's :reads here, one per logical read, since the method serves every family and tallies nothing. An argument read is the slot roster and then a node per predicate in it, and tallies :argument-slot and :argument-root once each, which is what keeps assert_cost_test reading the same numbers.

A read over every context is named …-global

A family read takes the reader's ancestor set, and passes p/every-context only where it reads past every reader on purpose: a roster scoped later, the taxonomy's supporters, a census. The entry point that forwards p/every-context ends in -global, and lint E16 holds the roster of its callers (docs/indexing.md, "The family methods").

Where there is only one entry point, and why

  • The cardinalities (stored-count-…) count a posting set's members. Belief is not in the index, so there is no O(1) believed count and this namespace does not pretend otherwise — a believed count is (count (believed-… …)) and is O(n). The public readers state the same thing (vaelii.core/count-with-functor).
  • The vocabulary (stored-terms-global, stored-term-count-global) is the roster of names the term index is keyed by. A name enters with the first sentex mentioning it and leaves with the last, so it answers what this KB talks about — a question defeat does not change.
  • The watched-rule roster (watched-rule?, watched-rules, watched-rules-on) answers "which rules might need re-checking", never "does the exception hold", and stores no truth value at all (protocols/IndexStore). Filtering it by belief would narrow a re-check queue, and a missed re-check is a wrong belief where an extra one is a query nobody needed.

Two belief questions this namespace does not answer

  • A rule's belief is resolution/rule-believed? and not jtms/in?: a sentex the TMS holds no node for is available rather than disbelieved, which is an arm a plain membership test does not have. So as-stored-rules-by-antecedent-global and its consequent twins have no believed sibling here, and a chainer asks res/rule-believed? of each handle it means to fire.
  • resolution/*belief-blind* is not read here. It is a named opt-out scoped to the retrieval entry point that resolves CxEverything, and no caller of these entry points is on that path — an entry point that consulted it would extend the opt-out to reads nobody granted it to.
The named entry points onto the index — a read **as stored**, or a read **as believed**.

The fourth invariant is that a stored sentex is not a believed one (README.md, "The
model in one page").  Every `IndexStore` posting is storage: it holds a defeated
default, a conclusion whose support was withdrawn and a spelling an equality retired,
because all three are revivable and the index is not where belief lives.  So a caller
reading a posting has a question to answer, and until it is asked in the name of the
read nothing distinguishes the caller that answered it from the one that forgot.

This namespace is where it is asked.  Every raw `vaelii.impl.protocols` index read
outside a short roster of implementers goes through an entry point here, and the entry point's own
name says which answer it gives — `lein lint`'s **E16** is what keeps that true, and
its roster is the one place the exceptions are written down.

## The two entry points, and why they take different arguments

- **`as-stored-…` takes the index store.**  An as-stored read *is* an index
  operation, so the entry point's arglist is the protocol method's and nothing else is in
  scope.  A caller reaching one is saying it wants storage: a candidate set it filters
  itself, a roster that must over-approximate, a diagnostic that reports what is
  written.  Each entry point below says what a stored-but-disbelieved answer is *for*.
- **`believed-…` takes the KB.**  Belief lives in the JTMS, so a believed read is a
  question about the KB and not about the index — which is exactly the distinction the
  arglists carry.  The filter is `jtms/in?`, which already drops a **superseded**
  spelling along with a defeated one (`vaelii.impl.jtms`'s `-in?`), so a believed entry point
  means what `kb/sentexes-matching` means for the handles it yields.

An entry point over a named method is a **wrapper and never a rewrite**: one call to
the method, the same laziness, the same count-aware path.  An entry point over the
`family-*` methods tallies its family's `:reads` here, one per logical read, since the
method serves every family and tallies nothing.  An argument read is the slot roster
and then a node per predicate in it, and tallies `:argument-slot` and `:argument-root`
once each, which is what keeps `assert_cost_test` reading the same numbers.

## A read over every context is named `…-global`

A family read takes the reader's ancestor set, and passes `p/every-context` only where it
reads past every reader on purpose: a roster scoped later, the taxonomy's supporters, a
census.  The entry point that forwards `p/every-context` ends in `-global`, and lint
E16 holds the roster of its callers (docs/indexing.md, "The family methods").

## Where there is only one entry point, and why

- **The cardinalities** (`stored-count-…`) count a posting set's members.  Belief is
  not in the index, so there is no O(1) believed count and this namespace does not
  pretend otherwise — a believed count is `(count (believed-… …))` and is O(n).  The
  public readers state the same thing (`vaelii.core/count-with-functor`).
- **The vocabulary** (`stored-terms-global`, `stored-term-count-global`) is the roster
  of names the term index is keyed by.  A name enters with the first sentex mentioning it and leaves
  with the last, so it answers *what this KB talks about* — a question defeat does not
  change.
- **The watched-rule roster** (`watched-rule?`, `watched-rules`, `watched-rules-on`)
  answers "which rules might need re-checking", never "does the exception hold", and
  stores no truth value at all (`protocols/IndexStore`).  Filtering it by belief would
  narrow a re-check queue, and a missed re-check is a wrong belief where an extra one
  is a query nobody needed.

## Two belief questions this namespace does not answer

- **A rule's** belief is `resolution/rule-believed?` and not `jtms/in?`: a sentex the
  TMS holds no node for is *available* rather than disbelieved, which is an arm a plain
  membership test does not have.  So `as-stored-rules-by-antecedent-global` and its
  consequent twins have no believed sibling here, and a chainer asks
  `res/rule-believed?` of each handle it means to fire.
- **`resolution/*belief-blind*`** is not read here.  It is a named opt-out scoped to
  the retrieval entry point that resolves `CxEverything`, and no caller of these entry points is on
  that path — an entry point that consulted it would extend the opt-out to reads nobody granted
  it to.
raw docstring

*contexts-read*clj

nil, or a volatile set to which each entry point here that reads by context adds the contexts it reads. A test binds it around a settle step to bound the contexts that step reads (genlcx_move_oracle_test); a read over every context adds nothing.

nil, or a volatile set to which each entry point here that reads by context adds the
contexts it reads.  A test binds it around a settle step to bound the contexts that
step reads (`genlcx_move_oracle_test`); a read over every context adds nothing.
sourceraw docstring

as-stored-arity-binding-kindsclj

(as-stored-arity-binding-kinds index pred)

The [kind value] of every stored length binding of pred, as a set, belief unread: one read.

The `[kind value]` of every **stored** length binding of `pred`, as a set, belief
unread: one read.
sourceraw docstring

as-stored-arity-bindingsclj

(as-stored-arity-bindings index pred contexts)

[[handle kind value context] ...], the stored length bindings of pred stated in a context of contexts, belief unread.

`[[handle kind value context] ...]`, the **stored** length bindings of `pred` stated
in a context of `contexts`, belief unread.
sourceraw docstring

as-stored-arity-bindings-globalclj

(as-stored-arity-bindings-global index pred)

as-stored-arity-bindings in every context.

`as-stored-arity-bindings` in every context.
sourceraw docstring

as-stored-arity-boundclj

(as-stored-arity-bound index)

Every predicate holding a stored length binding, as a set, belief unread.

Every predicate holding a **stored** length binding, as a set, belief unread.
sourceraw docstring

as-stored-at-pathclj

(as-stored-at-path index pattern)

Handles whose trie path matches pattern — one walk, no records fetched, nothing interpreted. A variable token in the path is a wildcard that fans over every child.

The rawest read the index has. Level 0 of vaelii.impl.levels addresses the trie directly and interprets neither belief nor polarity, which is what makes it the floor the other levels are measured against, and vaelii.impl.decide reads one exact sentence under every context to find a stored converse.

Handles whose trie path matches `pattern` — one walk, no records fetched, nothing
interpreted.  A variable token in the path is a wildcard that fans over every child.

The rawest read the index has.  Level 0 of `vaelii.impl.levels` addresses the trie
directly and interprets neither belief nor polarity, which is what makes it the floor
the other levels are measured against, and `vaelii.impl.decide` reads one exact
sentence under every context to find a stored converse.
sourceraw docstring

as-stored-childrenclj

(as-stored-children index prefix)

The child tokens stored under trie prefix prefix, belief unread: under [], the first token of every stored sentence, so every functor of a stored fact.

The child tokens **stored** under trie prefix `prefix`, belief unread: under `[]`, the
first token of every stored sentence, so every functor of a stored fact.
sourceraw docstring

as-stored-contexts-with-functorclj

(as-stored-contexts-with-functor index pred contexts)

[seen n]: the contexts of the set contexts in which a fact with functor pred is stored, either polarity, and how many contexts state one — the predicate extent's children, no handle read and no belief consulted. Two calls: the children count, then, when it is not zero, min(|contexts stating one|, |contexts|) membership probes. A defeated fact keeps its context listed, so the answer is for a caller that must over-approximate where pred is stated.

`[seen n]`: the contexts of the set `contexts` in which a fact with functor `pred` is
**stored**, either polarity, and how many contexts state one — the predicate extent's
children, no handle read and no belief consulted.  Two calls: the children count, then,
when it is not zero, min(|contexts stating one|, |contexts|) membership probes.  A
defeated fact keeps its context listed, so the answer is for a caller that must
over-approximate where `pred` is stated.
sourceraw docstring

as-stored-contexts-with-functor-globalclj

(as-stored-contexts-with-functor-global index pred)

as-stored-contexts-with-functor over every context.

`as-stored-contexts-with-functor` over every context.
sourceraw docstring

as-stored-in-contextclj

(as-stored-in-context index context)

Handles stored in context — its whole extent, rules included, belief unread.

A stored-but-disbelieved answer is what a caller wants here when it is about the contents of a context rather than about what holds in it: a teardown that must remove every record it finds, an ancestor set sweep that fetches each record and decides on the record, a level-1 diagnostic reporting what the root holds.

Handles stored in `context` — its whole extent, rules included, belief unread.

A stored-but-disbelieved answer is what a caller wants here when it is about the
*contents* of a context rather than about what holds in it: a teardown that must remove
every record it finds, an ancestor set sweep that fetches each record and decides on the record,
a level-1 diagnostic reporting what the root holds.
sourceraw docstring

as-stored-installed-keysclj

(as-stored-installed-keys index h)

The taxonomy keys stored handle h installs, as a set, belief unread: the keys a reconcile re-examines when h's label moves. One read.

The taxonomy keys **stored** handle `h` installs, as a set, belief unread: the keys a
reconcile re-examines when `h`'s label moves.  One read.
sourceraw docstring

as-stored-leafclj

(as-stored-leaf index path)

Handles stored at exactly the trie leaf path: one read, never a wildcard match (kb/find-sentex-handle's dedup).

Handles stored at exactly the trie leaf `path`: one read, never a wildcard match
(`kb/find-sentex-handle`'s dedup).
sourceraw docstring

as-stored-mint-contexts-globalclj

(as-stored-mint-contexts-global index)

The contexts some filed mint is stored in, as a set.

The contexts some filed mint is stored in, as a set.
sourceraw docstring

as-stored-mint-termsclj

(as-stored-mint-terms index)

The terms some filed mint is about, as a set.

The terms some filed mint is about, as a set.
sourceraw docstring

as-stored-mints-about-globalclj

(as-stored-mints-about-global index term)

Handles of the mints filed about term, in every context.

Handles of the mints filed about `term`, in every context.
sourceraw docstring

as-stored-mints-inclj

(as-stored-mints-in index c)

Handles of the mints filed in context c. One leaf read.

Handles of the mints filed in context `c`.  One leaf read.
sourceraw docstring

as-stored-named-globalclj

(as-stored-named-global index functor)

The handles the positive (functor (sentexHandle H)) facts stored in any context name, as a set: the children of the trie's [functor m sentexHandle] level. On the map backends the set is the one the backend holds, so two reads with no write between them answer one object.

The handles the positive `(functor (sentexHandle H))` facts **stored** in any context
name, as a set: the children of the trie's `[functor m sentexHandle]` level.  On the map
backends the set is the one the backend holds, so two reads with no write between them
answer one object.
sourceraw docstring

as-stored-namingclj

(as-stored-naming index functor h)
(as-stored-naming index functor h contexts)

The handles of the positive (functor (sentexHandle h)) facts stored in a context of contexts (every context when nil), as a vector, or nil when there is none. The children under the prefix are filtered by contexts before a leaf is read, so a context outside contexts costs a membership test.

The handles of the positive `(functor (sentexHandle h))` facts **stored** in a context
of `contexts` (every context when nil), as a vector, or nil when there is none.  The
children under the prefix are filtered by `contexts` before a leaf is read, so a context
outside `contexts` costs a membership test.
sourceraw docstring

as-stored-naming-by-contextclj

(as-stored-naming-by-context index functor h)

The positive (functor (sentexHandle h)) facts stored, as one [context handles] pair per context stating one: the children under the prefix and the leaf under each.

The positive `(functor (sentexHandle h))` facts **stored**, as one `[context handles]`
pair per context stating one: the children under the prefix and the leaf under each.
sourceraw docstring

as-stored-opposed-bodiesclj

(as-stored-opposed-bodies index)

Every body stored in both polarities, as a set.

Every body **stored** in both polarities, as a set.
sourceraw docstring

as-stored-opposed-inclj

(as-stored-opposed-in index contexts)

The handles of the facts of every body stored in both polarities that are stated in a context of contexts, belief unread: |contexts| leaf reads.

The handles of the facts of every body **stored** in both polarities that are stated
in a context of `contexts`, belief unread: |contexts| leaf reads.
sourceraw docstring

as-stored-opposed-members-globalclj

(as-stored-opposed-members-global index body)

The handles of body's facts of both polarities while it is stored in both, in every context, belief unread; empty when it is not.

The handles of `body`'s facts of both polarities while it is **stored** in both, in
every context, belief unread; empty when it is not.
sourceraw docstring

as-stored-predicates-at-argclj

(as-stored-predicates-at-arg index pos term)

The predicates holding a stored fact, either polarity, with term at argument pos — the slot roster's entry, no handle read and no belief consulted.

A roster read rather than a posting read, so it names predicates where the other entry points here name handles. A predicate enters with its first stored fact at the slot and leaves with its last, so a defeated claim keeps it listed: the answer is for a caller that must over-approximate which predicates a term could be claimed under.

The predicates holding a **stored** fact, either polarity, with `term` at argument `pos`
— the slot roster's entry, no handle read and no belief consulted.

A roster read rather than a posting read, so it names predicates where the other
entry points here name handles.  A predicate enters with its first stored fact at the
slot and leaves with its last, so a defeated claim keeps it listed: the answer is for a
caller that must over-approximate which predicates a term could be claimed under.
sourceraw docstring

as-stored-rule-keysclj

(as-stored-rule-keys index)

The antecedent keys some stored rule takes (rules/antecedent-key), as a set: the root level of the :rule-antecedent trie.

The antecedent keys some **stored** rule takes (`rules/antecedent-key`), as a set: the
root level of the `:rule-antecedent` trie.
sourceraw docstring

as-stored-rules-by-antecedent-globalclj

(as-stored-rules-by-antecedent-global index pred)

Handles of rules with an antecedent on pred, stated in any context — every rule, whatever its direction, belief unread.

Belief for a rule is resolution/rule-believed? and not jtms/in?, which is why there is no believed entry point beside this one: a rule the TMS holds no node for is available rather than disbelieved, and a chainer asks that question of each handle it means to fire.

Handles of rules with an antecedent on `pred`, stated in any context — every rule,
whatever its direction, belief unread.

Belief for a **rule** is `resolution/rule-believed?` and not `jtms/in?`, which is why
there is no believed entry point beside this one: a rule the TMS holds no node for is available
rather than disbelieved, and a chainer asks that question of each handle it means to
fire.
sourceraw docstring

as-stored-rules-by-consequent-globalclj

(as-stored-rules-by-consequent-global index pred)

as-stored-rules-by-consequent-in in every context.

`as-stored-rules-by-consequent-in` in every context.
sourceraw docstring

as-stored-rules-by-consequent-inclj

(as-stored-rules-by-consequent-in index pred contexts)

Handles of rules concluding pred stated in one of contexts, a set — every rule, whatever its direction, belief unread.

resolution/rule-believed? is the belief question, as for the antecedent entry point above. A rule whose consequent functor is a variable files under protocols/var-consequent-key rather than under a canonical ?var0, so a concrete goal's answer is this bucket unioned with that catch-all (resolution/concluding-rule-handles).

Handles of rules concluding `pred` stated in one of `contexts`, a set — every rule,
whatever its direction, belief unread.

`resolution/rule-believed?` is the belief question, as for the antecedent entry point above.  A
rule whose consequent functor is a variable files under `protocols/var-consequent-key`
rather than under a canonical `?var0`, so a concrete goal's answer is this bucket
unioned with that catch-all (`resolution/concluding-rule-handles`).
sourceraw docstring

as-stored-rules-inclj

(as-stored-rules-in index kind contexts)

Handles of the stored rules of kind stated in one of contexts: :rule for every rule, :solve for the rules a solve reads (rules/solve-sentex?). The rule extent ends in the context, so this costs min(|contexts stating one|, |contexts|) probes plus a leaf read per context kept.

Handles of the **stored** rules of `kind` stated in one of `contexts`: `:rule` for
every rule, `:solve` for the rules a solve reads (`rules/solve-sentex?`).  The rule
extent ends in the context, so this costs min(|contexts stating one|, |contexts|) probes
plus a leaf read per context kept.
sourceraw docstring

as-stored-rules-in-globalclj

(as-stored-rules-in-global index kind)

as-stored-rules-in in every context.

`as-stored-rules-in` in every context.
sourceraw docstring

as-stored-self-tuplesclj

(as-stored-self-tuples index f contexts)

The handles of the stored ground positive binary self tuples (f a a) of functor f stated in a context of contexts, belief unread.

The handles of the **stored** ground positive binary self tuples `(f a a)` of functor
`f` stated in a context of `contexts`, belief unread.
sourceraw docstring

as-stored-self-tuples-globalclj

(as-stored-self-tuples-global index f)

as-stored-self-tuples in every context.

`as-stored-self-tuples` in every context.
sourceraw docstring

as-stored-shape-lengthsclj

(as-stored-shape-lengths index f)

The lengths the positive facts of functor f are stored at, as a set, belief unread: one roster read. A length leaves with its last fact.

The lengths the positive facts of functor `f` are **stored** at, as a set, belief
unread: one roster read.  A length leaves with its last fact.
sourceraw docstring

as-stored-shape-tuples-globalclj

(as-stored-shape-tuples-global index f n)

The handles of the stored positive facts of functor f holding n arguments, in every context, belief unread.

The handles of the **stored** positive facts of functor `f` holding `n` arguments, in
every context, belief unread.
sourceraw docstring

as-stored-supporter-mapclj

(as-stored-supporter-map index)

Every taxonomy key with a stored supporter, as {k {handle ctx}}, by a walk of every entry index holds: O(store), for a raw taxonomy's private store, which holds the supporter families and nothing else.

Every taxonomy key with a **stored** supporter, as `{k {handle ctx}}`, by a walk of every
entry `index` holds: O(store), for a raw taxonomy's private store, which holds the
supporter families and nothing else.
sourceraw docstring

as-stored-supporters-globalclj

(as-stored-supporters-global index k)

The stored supporters of taxonomy key k ([:genl a b], [:genlCx a b] or a flat-cache key) as {handle ctx}, belief unread: the node's children, then one leaf read per context. The taxonomy decides an entry's belief from them, and a disbelieved supporter stays listed so that its revival can bring the entry back.

The **stored** supporters of taxonomy key `k` (`[:genl a b]`, `[:genlCx a b]` or a
flat-cache key) as `{handle ctx}`, belief unread: the node's children, then one leaf
read per context.  The taxonomy decides an entry's belief from them, and a disbelieved
supporter stays listed so that its revival can bring the entry back.
sourceraw docstring

as-stored-unary-denied-termsclj

(as-stored-unary-denied-terms index pred)

The terms a stored (not (pred term)) names, as a set, belief unread.

The terms a **stored** `(not (pred term))` names, as a set, belief unread.
sourceraw docstring

as-stored-unary-denied-typesclj

(as-stored-unary-denied-types index)

The predicates as-stored-unary-denied-terms holds a term under, as a set, belief unread.

The predicates `as-stored-unary-denied-terms` holds a term under, as a set, belief
unread.
sourceraw docstring

as-stored-unary-kept-termsclj

(as-stored-unary-kept-terms index pred)

The terms of as-stored-unary-multi-terms whose unary roster lists pred, as a set, belief unread: a superset of the terms holding a stored membership or denial of pred beside a stored fact of another unary predicate.

The terms of `as-stored-unary-multi-terms` whose unary roster lists `pred`, as a set,
belief unread: a superset of the terms holding a **stored** membership or denial of
`pred` beside a stored fact of another unary predicate.
sourceraw docstring

as-stored-unary-kept-typesclj

(as-stored-unary-kept-types index)

The predicates as-stored-unary-kept-terms holds a term under, as a set, belief unread.

The predicates `as-stored-unary-kept-terms` holds a term under, as a set, belief
unread.
sourceraw docstring

as-stored-unary-multi-termsclj

(as-stored-unary-multi-terms index)

The terms the unary roster lists two or more predicates of, as a set, belief unread: a superset of the terms holding two stored memberships.

The terms the unary roster lists two or more predicates of, as a set, belief unread:
a superset of the terms holding two **stored** memberships.
sourceraw docstring

as-stored-unary-with-arg-globalclj

(as-stored-unary-with-arg-global index term)

Handles of the unary fact sentexes whose lone argument is term, either polarity, in every context — belief unread, and a superset (the unary roster outlives its last unary fact where a fact of another arity empties the node), so the caller filters each record by arity. The :unary-slot roster, then the argument-root nodes at position 1.

Handles of the unary fact sentexes whose lone argument is `term`, either polarity, in
every context — belief unread, and a superset (the unary roster outlives its last unary
fact where a fact of another arity empties the node), so the caller filters each record
by arity.  The `:unary-slot` roster, then the argument-root nodes at position 1.
sourceraw docstring

as-stored-with-arg-globalclj

(as-stored-with-arg-global index pos term)

Handles of fact sentexes holding term at 1-based argument pos, in every context — belief unread. One read of the slot roster [:argument-slot pos term] for the predicates at the slot, then each predicate's argument-root node.

Same shape as as-stored-with-functor: a candidate set whose consumer decides per record.

Handles of fact sentexes holding `term` at 1-based argument `pos`, in every context —
belief unread.  One read of the slot roster `[:argument-slot pos term]` for the
predicates at the slot, then each predicate's argument-root node.

Same shape as `as-stored-with-functor`: a candidate set whose consumer decides per
record.
sourceraw docstring

as-stored-with-argsclj

(as-stored-with-args index pred pos-terms)

Handles with functor pred AND each [pos term] of pos-terms, belief unread: the intersection of pred's argument-root nodes at the named positions, or the predicate extent when pos-terms is empty. pred may be nil, for a variable-functor pattern.

Handles with functor `pred` AND each `[pos term]` of `pos-terms`, belief unread:
the intersection of `pred`'s argument-root nodes at the named positions, or the
predicate extent when `pos-terms` is empty.  `pred` may be nil, for a
variable-functor pattern.
sourceraw docstring

as-stored-with-args-inclj

(as-stored-with-args-in index pred pos-terms contexts)

as-stored-with-args restricted to the handles stated in one of contexts, a set: the argument roots end in the context, so no leaf outside contexts is read.

`as-stored-with-args` restricted to the handles stated in one of `contexts`, a set: the
argument roots end in the context, so no leaf outside `contexts` is read.
sourceraw docstring

as-stored-with-functorclj

(as-stored-with-functor index pred)

Handles of fact sentexes whose functor is pred, any arity, either polarity — belief unread.

The candidate-set read: a caller narrowing by predicate almost always fetches each record and decides on its polarity, its context and its belief together, and doing so one handle at a time is cheaper than two passes over the same set. A caller whose filter is belief alone takes believed-with-functor instead.

Handles of fact sentexes whose functor is `pred`, any arity, either polarity — belief
unread.

The candidate-set read: a caller narrowing by predicate almost always fetches each
record and decides on its polarity, its context and its belief together, and doing so
one handle at a time is cheaper than two passes over the same set.  A caller whose
filter is belief alone takes `believed-with-functor` instead.
sourceraw docstring

as-stored-with-functor-inclj

(as-stored-with-functor-in index pred contexts)

as-stored-with-functor restricted to the facts stated in one of contexts — a reader's ancestor set, or nil for every context. The predicate extent ends in the context, so this costs min(|contexts stating one|, |contexts|) membership probes plus one leaf read per context kept (docs/indexing.md, "By-context reads").

`as-stored-with-functor` restricted to the facts stated in one of `contexts` — a
reader's ancestor set, or nil for every context.  The predicate extent ends in the
context, so this costs min(|contexts stating one|, |contexts|) membership probes plus
one leaf read per context kept (docs/indexing.md, "By-context reads").
sourceraw docstring

as-stored-with-termclj

(as-stored-with-term index term)

Handles the inverted term index keys by term — belief unread.

Exact for a symbol; for a compound outside the indexed depth bounds it holds only the sentexes that nest it deep enough, so kb/find-sentexes is the exact read for one. The postings are a candidate set in both cases: a term appears in a sentence the reader then has to look at.

Handles the inverted term index keys by `term` — belief unread.

Exact for a symbol; for a compound outside the indexed depth bounds it holds only the
sentexes that nest it deep enough, so `kb/find-sentexes` is the exact read for one.  The
postings are a candidate set in both cases: a term appears in a sentence the reader then
has to look at.
sourceraw docstring

as-stored-with-termsclj

(as-stored-with-terms index terms)

Handles the inverted term index keys by every one of terms, one intersection — belief unread. A candidate set, as as-stored-with-term's is.

Handles the inverted term index keys by every one of `terms`, one intersection — belief
unread.  A candidate set, as `as-stored-with-term`'s is.
sourceraw docstring

believed-with-argsclj

(believed-with-args kb pred pos-terms)

Handles with functor pred AND each [pos term] of pos-terms that the KB believes — as-stored-with-args filtered by jtms/in?, lazily.

The narrowing read's believed entry point: a caller that knows several of a sentence's terms and wants only what holds asks here rather than intersecting and then filtering by hand.

Handles with functor `pred` AND each `[pos term]` of `pos-terms` that the KB
**believes** — `as-stored-with-args` filtered by `jtms/in?`, lazily.

The narrowing read's believed entry point: a caller that knows several of a sentence's terms
and wants only what holds asks here rather than intersecting and then filtering by
hand.
sourceraw docstring

believed-with-functorclj

(believed-with-functor kb pred)

Handles of fact sentexes with functor pred that the KB believes — the extent above, filtered by jtms/in?.

Lazy, as the posting read is: the filter is applied as the seq is walked, so a consumer taking a prefix pays a TMS probe per handle it takes and not per handle in the root. A superseded spelling drops out with a defeated one, since that is what in? answers.

Handles of fact sentexes with functor `pred` that the KB **believes** — the extent
above, filtered by `jtms/in?`.

Lazy, as the posting read is: the filter is applied as the seq is walked, so a consumer
taking a prefix pays a TMS probe per handle it takes and not per handle in the root.  A
superseded spelling drops out with a defeated one, since that is what `in?` answers.
sourceraw docstring

stored-arity-bound?clj

(stored-arity-bound? index pred)

Does pred hold a stored length binding, belief unread: one probe.

Does `pred` hold a **stored** length binding, belief unread: one probe.
sourceraw docstring

stored-census-with-arg-globalclj

(stored-census-with-arg-global index pred pos term)

[n k]: how many facts with functor pred and term at argument pos are stored, in every context, and in how many contexts. Two count reads.

`[n k]`: how many facts with functor `pred` and `term` at argument `pos` are **stored**,
in every context, and in how many contexts.  Two count reads.
sourceraw docstring

stored-count-arity-boundclj

(stored-count-arity-bound index)

How many predicates as-stored-arity-bound holds: one read.

How many predicates `as-stored-arity-bound` holds: one read.
sourceraw docstring

stored-count-atclj

(stored-count-at index prefix)

How many sentexes are stored under trie prefix prefix — the count-aware trie's own tally, no walk. [] is the whole KB.

How many sentexes are **stored** under trie prefix `prefix` — the count-aware trie's
own tally, no walk.  `[]` is the whole KB.
sourceraw docstring

stored-count-childrenclj

(stored-count-children index prefix)

How many child tokens sit under interior prefix prefix — the trie's distinct-value count at a position, answered without building the child set.

What the planner's cost model divides by, so it must not scale with the KB: (count (stored-children …)) would, and this does not: family-child-count answers the child set's cardinality without building it.

How many child tokens sit under interior prefix `prefix` — the trie's distinct-value
count at a position, answered without building the child set.

What the planner's cost model divides by, so it must not scale with the KB:
`(count (stored-children …))` would, and this does not: `family-child-count` answers
the child set's cardinality without building it.
sourceraw docstring

stored-count-in-contextclj

(stored-count-in-context index context)

How many sentexes are stored in context — one set-size read, O(1), nothing fetched and no belief consulted. A defeated default still occupies its context.

How many sentexes are **stored** in `context` — one set-size read, O(1), nothing
fetched and no belief consulted.  A defeated default still occupies its context.
sourceraw docstring

stored-count-unary-denied-typesclj

(stored-count-unary-denied-types index)

How many predicates as-stored-unary-denied-types holds: one read.

How many predicates `as-stored-unary-denied-types` holds: one read.
sourceraw docstring

stored-count-unary-kept-typesclj

(stored-count-unary-kept-types index)

How many predicates as-stored-unary-kept-types holds: one read.

How many predicates `as-stored-unary-kept-types` holds: one read.
sourceraw docstring

stored-count-with-arg-globalclj

(stored-count-with-arg-global index pos term)

How many fact sentexes store term at argument position pos, in every context — the slot roster, then one O(1) count read per predicate at the slot. The sum is disjoint: a handle is one sentex with one functor, so it sits under one predicate at a fixed (pos, term).

How many fact sentexes **store** `term` at argument position `pos`, in every context —
the slot roster, then one O(1) count read per predicate at the slot.  The sum is
disjoint: a handle is one sentex with one functor, so it sits under one predicate at a
fixed `(pos, term)`.
sourceraw docstring

stored-count-with-arg-inclj

(stored-count-with-arg-in index pred pos term contexts)

How many facts with functor pred and term at argument pos are stored in the contexts of contexts: one leaf count per context the argument node lists and contexts holds.

How many facts with functor `pred` and `term` at argument `pos` are **stored** in the
contexts of `contexts`: one leaf count per context the argument node lists and
`contexts` holds.
sourceraw docstring

stored-count-with-functorclj

(stored-count-with-functor index pred)

How many fact sentexes are stored with functor pred — one set-size read, O(1).

The gate in front of nearly every definitional check in the engine: a KB that declares none of a feature's predicates pays one integer read and stops, which is what keeps an unused feature off the assert path.

How many fact sentexes are **stored** with functor `pred` — one set-size read, O(1).

The gate in front of nearly every definitional check in the engine: a KB that declares
none of a feature's predicates pays one integer read and stops, which is what keeps an
unused feature off the assert path.
sourceraw docstring

stored-count-with-functor-inclj

(stored-count-with-functor-in index pred contexts)

How many facts with functor pred are stored in the contexts of contexts: one leaf count per context stating one.

How many facts with functor `pred` are **stored** in the contexts of `contexts`: one
leaf count per context stating one.
sourceraw docstring

stored-mint-context-countclj

(stored-mint-context-count index)

How many contexts some filed mint is stored in. One count read.

How many contexts some filed mint is stored in.  One count read.
sourceraw docstring

stored-mint-count-globalclj

(stored-mint-count-global index)

How many records are filed as mints, in every context. One count read.

How many records are filed as mints, in every context.  One count read.
sourceraw docstring

stored-mint-term-countclj

(stored-mint-term-count index)

How many terms some filed mint is about. One count read.

How many terms some filed mint is about.  One count read.
sourceraw docstring

stored-mint-term?clj

(stored-mint-term? index term)

Is some filed mint about term? One membership test.

Is some filed mint about `term`?  One membership test.
sourceraw docstring

stored-mint?clj

(stored-mint? index term c h)

Is record h filed as a mint about term in context c? One membership test.

Is record `h` filed as a mint about `term` in context `c`?  One membership test.
sourceraw docstring

stored-naming?clj

(stored-naming? index functor h)

Is a positive (functor (sentexHandle h)) stored in any context? One count read.

Is a positive `(functor (sentexHandle h))` **stored** in any context?  One count read.
sourceraw docstring

stored-opposed?clj

(stored-opposed? index body)

Is body stored in both polarities? One membership read, belief unread.

Is `body` **stored** in both polarities?  One membership read, belief unread.
sourceraw docstring

stored-rule-key?clj

(stored-rule-key? index k)

Does a stored rule take the antecedent key k? One membership test.

Does a **stored** rule take the antecedent key `k`?  One membership test.
sourceraw docstring

stored-supporter-count-globalclj

(stored-supporter-count-global index k)

How many stored handles support taxonomy key k, in every context: one count read.

How many **stored** handles support taxonomy key `k`, in every context: one count read.
sourceraw docstring

stored-term-count-globalclj

(stored-term-count-global index)

How many distinct symbol terms the index is keyed by, in every context — the roster's own count, no walk over it.

How many distinct symbol terms the index is keyed by, in every context — the roster's
own count, no walk over it.
sourceraw docstring

stored-terms-globalclj

(stored-terms-global index)

Every symbol term the index is keyed by, in every context — the KB's vocabulary, unordered.

A name is in this roster while some stored sentex mentions it, so it answers what the KB talks about rather than what it currently holds: defeating the one fact about a term does not unname the term.

Every symbol term the index is keyed by, in every context — the KB's vocabulary,
unordered.

A name is in this roster while some **stored** sentex mentions it, so it answers what
the KB talks about rather than what it currently holds: defeating the one fact about a
term does not unname the term.
sourceraw docstring

stores-any?clj

(stores-any? index functor)

Is a positive (functor …) fact stored in any context? One count read on the trie's [functor], belief unread.

Is a positive `(functor …)` fact **stored** in any context?  One count read on the
trie's `[functor]`, belief unread.
sourceraw docstring

stores-in?clj

(stores-in? index pred contexts)

Does a context of contexts store a fact of functor pred, either polarity? The predicate extent's children intersected with contexts, no leaf read, belief unread.

Does a context of `contexts` **store** a fact of functor `pred`, either polarity?  The
predicate extent's children intersected with `contexts`, no leaf read, belief unread.
sourceraw docstring

stores-opposed?clj

(stores-opposed? index)

Is any body stored in both polarities? One count read, belief unread.

Is any body **stored** in both polarities?  One count read, belief unread.
sourceraw docstring

stores-rule-in?clj

(stores-rule-in? index contexts)

Does a context of contexts store a rule? The rule extent's children intersected with contexts, no leaf read.

Does a context of `contexts` **store** a rule?  The rule extent's children intersected
with `contexts`, no leaf read.
sourceraw docstring

watched-rule?clj

(watched-rule? index handle)

Is handle in the exception/watched-rule roster — O(1) membership, the firing-path gate.

The roster stores no truth value, so there is no second entry point: it answers which rules carry an exceptWhen at all, never whether one holds. Whether the exception fires is provers/exceptions-block?, and whether the rule itself is believed is resolution/rule-believed?.

Is `handle` in the exception/watched-rule roster — O(1) membership, the firing-path
gate.

The roster stores no truth value, so there is no second entry point: it answers which rules
carry an `exceptWhen` at all, never whether one holds.  Whether the exception *fires* is
`provers/exceptions-block?`, and whether the rule itself is believed is
`resolution/rule-believed?`.
sourceraw docstring

watched-rulesclj

(watched-rules index)

Handles of every rule carrying a re-check condition — an exception, an (unknown S) antecedent, an aggregate, a closed-extent negative or a different antecedent (rules/rechecked?).

Read to queue re-checks, which is why belief is not filtered: over-queueing costs a query at the next settle and under-queueing leaves a conclusion standing on evidence that has moved. A trigger is conservative in the direction the answer is.

Handles of every rule carrying a re-check condition — an exception, an `(unknown S)`
antecedent, an aggregate, a closed-extent negative or a `different` antecedent
(`rules/rechecked?`).

Read to **queue re-checks**, which is why belief is not filtered: over-queueing costs a
query at the next settle and under-queueing leaves a conclusion standing on evidence
that has moved.  A trigger is conservative in the direction the answer is.
sourceraw docstring

watched-rules-onclj

(watched-rules-on index pred)

Handles of rules whose re-check condition mentions pred — the predicate-scoped slice of watched-rules, and unfiltered for its reason.

Handles of rules whose re-check condition mentions `pred` — the predicate-scoped slice
of `watched-rules`, and unfiltered for its reason.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close