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. A namespace of its own because it
sits above both the dump importer and the overlay stores, which vaelii.impl.kb
requires. See docs/overlay.md, "Replacing the base".
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. A namespace of its own because it sits above both the dump importer and the overlay stores, which `vaelii.impl.kb` requires. See docs/overlay.md, "Replacing the base".
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's delta,
retract again the base premises it records, delete the marker and the delta, and return
replay!'s summary; 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's delta, retract again the base premises it records, delete the marker and the delta, and return `replay!`'s summary; nil when the directory holds no marker. `fns` are `rebase!`'s.
(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!). fns carries the write
entry points, {: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!`). `fns` carries the write
entry points, `{: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 |