Replacing a fork's base with an export dump while the fork keeps what it wrote: the
fork's own premises and its removals of base premises are read by content, its own half
is emptied, the dump is imported into the base's stores, belief is rebuilt over the
merged contents, and the premises are asserted again. And a durable fork's reopen over
a base that grew: its index takes in the base's new records (follow-base!) and its rules
fire over them (fire-arrivals!). A namespace of its own because it sits above the dump
importer, the index writers and the overlay stores, which vaelii.impl.kb requires. See
docs/overlay.md, "Replacing the base" and "A base that grew between mounts".
Replacing a fork's base with an export dump while the fork keeps what it wrote: the fork's own premises and its removals of base premises are read by content, its own half is emptied, the dump is imported into the base's stores, belief is rebuilt over the merged contents, and the premises are asserted again. And a durable fork's reopen over a base that grew: its index takes in the base's new records (`follow-base!`) and its rules fire over them (`fire-arrivals!`). A namespace of its own because it sits above the dump importer, the index writers and the overlay stores, which `vaelii.impl.kb` requires. See docs/overlay.md, "Replacing the base" and "A base that grew between mounts".
A (fn [phase]) rebase! calls at :emptied, after the own half is emptied and before
the base is refilled, and at :refilled, after the base is refilled and before the
writes are asserted again; finish-pending! calls it at :pending, before it asserts a
stopped rebase's writes again; or nil. A test binds it to throw there, which leaves the
directory as a crash at that point leaves it.
A `(fn [phase])` `rebase!` calls at `:emptied`, after the own half is emptied and before the base is refilled, and at `:refilled`, after the base is refilled and before the writes are asserted again; `finish-pending!` calls it at `:pending`, before it asserts a stopped rebase's writes again; or nil. A test binds it to throw there, which leaves the directory as a crash at that point leaves it.
(finish-pending! kb fns)Assert again the writes a rebase of the durable fork kb left in its directory, and
retract again the base premises it records. The marker then keeps the forms refused and
the retractions of a sentence kb holds no premise of, the delta is deleted, and the
marker goes too when it keeps nothing. Returns replay!'s summary with :kept, the
retractions kept; nil when the directory holds no marker. fns are rebase!'s.
Assert again the writes a rebase of the durable fork `kb` left in its directory, and retract again the base premises it records. The marker then keeps the forms refused and the retractions of a sentence `kb` holds no premise of, the delta is deleted, and the marker goes too when it keeps nothing. Returns `replay!`'s summary with `:kept`, the retractions kept; nil when the directory holds no marker. `fns` are `rebase!`'s.
(fire-arrivals! kb hs)Run in the fork kb what an assert of each base record hs names would run past its
store and index: a rule's and an exceptWhen's re-check postings, each sentence's
re-check triggers, then a chaining run from the believed ones and a settle. Drops the
owed firings.
Run in the fork `kb` what an assert of each base record `hs` names would run past its store and index: a rule's and an `exceptWhen`'s re-check postings, each sentence's re-check triggers, then a chaining run from the believed ones and a settle. Drops the owed firings.
(firings-owed kb)The base handles whose rule firings the fork kb owes (fire-arrivals!), or nil.
The base handles whose rule firings the fork `kb` owes (`fire-arrivals!`), or nil.
(follow-base! kb)Bring the index of kb, a durable fork, to the base its mount accepted: apply the ops
a catch-up left pending (ostore/pending-follow), then record and apply the ops for the
records the base gained (ostore/follow-owed, follow-ops), and record the base's
summary after each. kb/open-kb calls it before anything reads the fork's index.
Bring the index of `kb`, a durable fork, to the base its mount accepted: apply the ops a catch-up left pending (`ostore/pending-follow`), then record and apply the ops for the records the base gained (`ostore/follow-owed`, `follow-ops`), and record the base's summary after each. `kb/open-kb` calls it before anything reads the fork's index.
(fork? kb)Is kb a fork, an overlay over a frozen base?
Is `kb` a fork, an overlay over a frozen base?
(own-records kb)The fork's own premises and inert sentexes, ascending by handle: each record of the own half that is a premise of the merged KB or holds no TMS node, less a copy of a base record equal to it, strength included (an override that changed nothing). The records a delta export writes.
The fork's own premises and inert sentexes, ascending by handle: each record of the own half that is a premise of the merged KB or holds no TMS node, less a copy of a base record equal to it, strength included (an override that changed nothing). The records a delta export writes.
(pending? kb)Does the durable fork kb's directory hold the marker of a rebase that has not asserted
the fork's writes again?
Does the durable fork `kb`'s directory hold the marker of a rebase that has not asserted the fork's writes again?
(rebase! kb dir opts fns)Install the export dump at dir as fork kb's base, keeping what the fork wrote, and
return the import's summary with :rebase added: {:asserted n :refused [..] :unresolved [..] :retracted n :elapsed-ms n}.
The fork's premises, inert sentexes and retractions of base premises are read by content
first, and a durable fork writes them to its directory as a delta with a marker
(write-pending!). Then the own half is emptied (ostore/rebase!), the dump is imported
into the base's stores, belief is rebuilt over the merged contents (recovery/rebuild!),
what the fork wrote is asserted again (replay!), and the marker is deleted. A marker
an earlier rebase left is finished first (finish-pending!), and what it keeps joins the
capture. fns is {:assert! :assert-inert! :retract! :recover :reindex :on-replayed}.
Refused before the first write: a fork whose base arrived as another KB's stores
(:frozen-base), a dump this build does not read, and a dump whose reasoner set kb
does not register (:reasoner-mismatch, as import! refuses it).
Install the export dump at `dir` as fork `kb`'s base, keeping what the fork wrote, and
return the import's summary with `:rebase` added: `{:asserted n :refused [..]
:unresolved [..] :retracted n :elapsed-ms n}`.
The fork's premises, inert sentexes and retractions of base premises are read by content
first, and a durable fork writes them to its directory as a delta with a marker
(`write-pending!`). Then the own half is emptied (`ostore/rebase!`), the dump is imported
into the base's stores, belief is rebuilt over the merged contents (`recovery/rebuild!`),
what the fork wrote is asserted again (`replay!`), and the marker is deleted. A marker
an earlier rebase left is finished first (`finish-pending!`), and what it keeps joins the
capture. `fns` is `{:assert! :assert-inert! :retract! :recover :reindex :on-replayed}`.
Refused before the first write: a fork whose base arrived as another KB's stores
(`:frozen-base`), a dump this build does not read, and a dump whose reasoner set `kb`
does not register (`:reasoner-mismatch`, as `import!` refuses it).(removed-keys kb)The content keys of the base premises the merged KB holds as no premise: the ones the fork retracted.
The content keys of the base premises the merged KB holds as no premise: the ones the fork retracted.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |