Liking cljdoc? Tell your friends :D

vaelii.impl.protocols

Storage protocols so the record store and index store each have swappable implementations (in-memory by default, on-disk for durability, or an alternate KV store later). The rest of the system programs against these protocols and never against a concrete backend.

Storage protocols so the record store and index store each have swappable
implementations (in-memory by default, on-disk for durability, or an alternate KV
store later).  The rest of the system programs against these protocols and never
against a concrete backend.
raw docstring

IndexStorecljprotocol

The index store — the flattened count-aware trie, the secondary root indexes, the rule predicate index, the exception re-check index, and the inverted term index. Every entry is derived from the records, so it can be thrown away and rebuilt (vaelii.impl.reindex); it needs no durability of its own.

The index store — the flattened count-aware trie, the secondary root indexes, the
rule predicate index, the exception re-check index, and the inverted term index.
Every entry is derived from the records, so it can be thrown away and rebuilt
(`vaelii.impl.reindex`); it needs no durability of its own.

sentexes-with-termclj

(sentexes-with-term store term)

Handles of sentexes the term index keys by term.

Handles of sentexes the term index keys by `term`.

rules-by-consequentclj

(rules-by-consequent store pred)

Handles of rules concluding pred.

Handles of rules concluding pred.

rules-with-exception-onclj

(rules-with-exception-on store pred)

Handles of rules whose exception mentions pred.

Handles of rules whose exception mentions pred.

unindex-exception!clj

(unindex-exception! store handle preds)

Deregister a rule handle from its exception predicates.

Deregister a rule handle from its exception predicates.

sentexes-with-termsclj

(sentexes-with-terms store terms)

Handles of sentexes keyed by all terms — one intersection.

Handles of sentexes keyed by all `terms` — one intersection.

index-sentexclj

(index-sentex store sentex handle)

Insert a ground sentex handle into the trie.

Insert a ground sentex handle into the trie.

count-with-argclj

(count-with-arg store pos term)

How many fact sentexes have term at pos.

How many fact sentexes have `term` at `pos`.

count-in-contextclj

(count-in-context store context)

How many sentexes are in context.

How many sentexes are in `context`.

unindex-sentex!clj

(unindex-sentex! store sentex handle)

Remove a sentex handle from the trie.

Remove a sentex handle from the trie.

childrenclj

(children store prefix)

Child tokens registered under an interior prefix.

Child tokens registered under an interior prefix.

sentexes-with-functorclj

(sentexes-with-functor store pred)

Handles of fact sentexes whose functor is pred (any arity, either polarity).

Handles of fact sentexes whose functor is `pred` (any arity, either polarity).

exception-rulesclj

(exception-rules store)

Handles of every rule carrying an exception.

Handles of every rule carrying an exception.

index-entriesclj

(index-entries store)

Every index entry as a lazy [key value] seq — the portable projection.

Every index entry as a lazy `[key value]` seq — the portable projection.

lookupclj

(lookup store pattern)

Handles whose path matches a full pattern.

Handles whose path matches a full pattern.

sentexes-in-contextclj

(sentexes-in-context store context)

Handles of sentexes asserted in context.

Handles of sentexes asserted in `context`.

termsclj

(terms store)

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

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

clear-index!clj

(clear-index! store)

Remove every index entry (wipe the store — reindex rebuilds).

Remove every index entry (wipe the store — `reindex` rebuilds).

count-atclj

(count-at store prefix)

Sentex count under a path prefix.

Sentex count under a path prefix.

rules-by-antecedentclj

(rules-by-antecedent store pred)

Handles of rules with an antecedent on pred.

Handles of rules with an antecedent on pred.

sentexes-with-argclj

(sentexes-with-arg store pos term)

Handles of fact sentexes with term at 1-based argument pos.

Handles of fact sentexes with `term` at 1-based argument `pos`.

term-countclj

(term-count store)

How many distinct symbol terms the index is keyed by (one set-size read, O(1)).

How many distinct symbol terms the index is keyed by (one set-size read, O(1)).

count-with-functorclj

(count-with-functor store pred)

How many fact sentexes have functor pred.

How many fact sentexes have functor `pred`.

unindex-rule!clj

(unindex-rule! store handle ante-preds conseq-pred)

Deregister a rule handle.

Deregister a rule handle.

index-ruleclj

(index-rule store handle ante-preds conseq-pred)

Register a rule handle by its predicates.

Register a rule handle by its predicates.

index-loadclj

(index-load store entries)

Install [key value] entries into an empty index, in this store's own representation.

Install `[key value]` entries into an empty index, in this store's own representation.

index-exceptionclj

(index-exception store handle preds)

Register a rule handle under each predicate its exception mentions.

Register a rule handle under each predicate its exception mentions.

exception-rule?clj

(exception-rule? store handle)

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

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

sentexes-with-argsclj

(sentexes-with-args store pred pos-terms)

Handles with functor pred AND each [pos term] — one set intersection.

Handles with functor `pred` AND each `[pos term]` — one set intersection.
raw docstring

RecordStorecljprotocol

The record store — canonical sentexes and justifications, keyed by integer handle. The durable ground truth: everything else the KB holds is derived from it.

The record store — canonical sentexes and justifications, keyed by integer handle.
The durable ground truth: everything else the KB holds is derived from it.

clear-records!clj

(clear-records! store)

Remove every stored record (wipe the whole store).

Remove every stored record (wipe the whole store).

get-sentexclj

(get-sentex store id)

Fetch a sentex by handle, or nil.

Fetch a sentex by handle, or nil.

sentex-idsclj

(sentex-ids store)

All live sentex handles.

All live sentex handles.

mark-premiseclj

(mark-premise store id strength)

Record a handle as an asserted premise at strength.

Record a handle as an asserted premise at `strength`.

unmark-premise!clj

(unmark-premise! store id)

Record that a handle is no longer a premise.

Record that a handle is no longer a premise.

put-sentexclj

(put-sentex store sentex)

Persist a sentex; return its handle.

Persist a sentex; return its handle.

put-justificationclj

(put-justification store d)

Persist a justification; return its handle.

Persist a justification; return its handle.

delete-sentex!clj

(delete-sentex! store id)

Remove a sentex record.

Remove a sentex record.

get-provenanceclj

(get-provenance store id)

The provenance map for handle id, or nil.

The provenance map for handle `id`, or nil.

delete-provenance!clj

(delete-provenance! store id)

Remove the provenance for handle id.

Remove the provenance for handle `id`.

next-idclj

(next-id store)

Allocate the next monotonic handle — one above every handle the store holds, including one that arrived as an explicit :id on a put rather than from here. A handle is an identity, so no store may issue one twice.

Allocate the next monotonic handle — one above every
handle the store holds, including one that arrived as
an explicit `:id` on a put rather than from here.  A
handle is an identity, so no store may issue one twice.

delete-justification!clj

(delete-justification! store id)

Remove a justification record.

Remove a justification record.

premise-idsclj

(premise-ids store)

All handles currently marked as premises.

All handles currently marked as premises.

put-provenanceclj

(put-provenance store id prov)

Persist the provenance map for handle id (overwrites).

Persist the provenance map for handle `id` (overwrites).

get-justificationclj

(get-justification store id)

Fetch a justification by handle, or nil.

Fetch a justification by handle, or nil.

justification-idsclj

(justification-ids store)

All live justification handles.

All live justification handles.

premise-strengthclj

(premise-strength store id)

The recorded assumption strength of a premise handle.

The recorded assumption strength of a premise handle.
raw 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