Liking cljdoc? Tell your friends :D

vaelii.impl.jtms

The reference non-monotonic truth-maintenance network: nodes keyed by sentex handle (no sentex reference, so the resident graph holds no records), justifications, premise strengths, defeat-classes, and the superseded, forced, and blocked sets. Belief is a least fixpoint over current state, so it is order-independent, and every relabel is scoped to the affected region (locality). The caller owns physical deletion after a sweep. See docs/nmtms.md.

The reference non-monotonic truth-maintenance network: nodes keyed by sentex handle
(no sentex reference, so the resident graph holds no records), justifications, premise
strengths, defeat-classes, and the `superseded`, forced, and `blocked` sets.  Belief is
a least fixpoint over current state, so it is order-independent, and every relabel is
scoped to the affected region (locality).  The caller owns physical deletion after a
sweep.  See docs/nmtms.md.
raw docstring

*dedup-cache*clj

{:tms tms :m HashMap-of-consequence->HashSet-of-just-keys}, or nil (default): then has-justification? scans -supports. A run-scoped index bound by chain/chain; the first ask per conclusion builds its key set and later asks are one hash probe. The binding carries its TMS and dedup-cache-for hands the map only to that TMS, since a nested run over a second KB has overlapping handle spaces. Existence is structural, so only a removal (retract!, sweep!) invalidates, and both clear the cache; add-justification extends the entry. See docs/inference.md, Justification dedup.

`{:tms tms :m HashMap-of-consequence->HashSet-of-just-keys}`, or nil (default): then
`has-justification?` scans `-supports`.  A run-scoped index bound by `chain/chain`; the first
ask per conclusion builds its key set and later asks are one hash probe.  The binding carries
its TMS and `dedup-cache-for` hands the map only to that TMS, since a nested run over a
second KB has overlapping handle spaces.  Existence is structural, so only a removal
(`retract!`, `sweep!`) invalidates, and both clear the cache; `add-justification` extends the
entry.  See docs/inference.md, Justification dedup.
sourceraw docstring

->justclj

(->just id informant antecedents consequence bindings)
(->just id informant antecedents consequence bindings strength)
(->just id informant antecedents consequence bindings strength subsumptions)

Construct a Justification, defaulting strength to :monotonic — a bare monotone justification adds no defeasibility of its own, so conferred-class caps it at its weakest antecedent. A rule-handle informant is taken out of antecedents (without-informant). subsumptions is a rule firing's set of [sub super] pairs, stored under :subsumptions when it is not empty.

Construct a Justification, defaulting `strength` to :monotonic — a bare monotone
justification adds no defeasibility of its own, so `conferred-class` caps it at its
weakest antecedent.  A rule-handle informant is taken out of `antecedents`
(`without-informant`).  `subsumptions` is a rule firing's set of `[sub super]` pairs,
stored under `:subsumptions` when it is not empty.
sourceraw docstring

add-justificationclj

(add-justification tms just)
(add-justification tms just k)

Add just to the network. k, when given, is its justification-key, already built for the has-justification? that guarded the add.

Add `just` to the network.  `k`, when given, is its `justification-key`, already built
for the `has-justification?` that guarded the add.
sourceraw docstring

add-premiseclj

(add-premise tms datum)
(add-premise tms datum strength-kw)

Add datum as a premise at strength (default :default).

Add `datum` as a premise at `strength` (default :default).
sourceraw docstring

any-belief?clj

(any-belief? tms)
source

any-node?clj

(any-node? tms)
source

before-networkclj

(before-network tms)

A reference network tms as it stood when the open write record first recorded it, as a network over that state map, or tms itself when the record holds none or tms is not a reference network.

A reference network `tms` as it stood when the open write record first recorded it,
as a network over that state map, or `tms` itself when the record holds none or `tms`
is not a reference network.
sourceraw docstring

blockedclj

(blocked tms)

The justification ids currently blocked by their rule's exception.

The justification ids currently blocked by their rule's exception.
sourceraw docstring

class-antecedentsclj

(class-antecedents j)

The antecedents of justification j whose classes cap the class it confers: all of them, except under respell-informant, where only the first does.

The antecedents of justification `j` whose classes cap the class it confers: all of
them, except under `respell-informant`, where only the first does.
sourceraw docstring

classes-in-regionclj

(classes-in-region tms region in)

The defeat-classes of the datums in holds inside region, where region and in are a grounded-in-region answer: the classes belief carries with that answer's extra forced OUT, the rest of the graph held at its current classes. The same least fixpoint region-classes computes during a relabel, built on the protocol reads. The settle reads it for a nogood weighed at a vantage (docs/nmtms.md, "A defeat is scoped to its vantage").

The defeat-classes of the datums `in` holds inside `region`, where `region` and `in` are a
`grounded-in-region` answer: the classes belief carries with that answer's `extra` forced
OUT, the rest of the graph held at its current classes.  The same least fixpoint
`region-classes` computes during a relabel, built on the protocol reads.  The settle reads it
for a nogood weighed at a vantage (docs/nmtms.md, "A defeat is scoped to its vantage").
sourceraw docstring

consequence-closureclj

(consequence-closure tms seeds)

The forward consequence closure of seeds, seeds included: every datum a justification resting on one of them concludes, transitively. The region grounded-in-region labels, for a caller that needs the datums a forced-OUT set can move and not their labels.

The forward consequence closure of `seeds`, seeds included: every datum a justification
resting on one of them concludes, transitively.  The region `grounded-in-region` labels,
for a caller that needs the datums a forced-OUT set can move and not their labels.
sourceraw docstring

create-tmsclj

(create-tms)

A fresh, empty truth-maintenance network, the reference implementation. :in is the believed set and the authority on belief, maintained region-locally; nodes carry no label of their own. :blocked is the set of justification ids blocked by their rule's exception; it starts empty. Rules live in the stores as sentexes, not here.

A fresh, empty truth-maintenance network, the reference implementation.  `:in` is the
believed set and the authority on belief, maintained region-locally; nodes carry no label of
their own.  `:blocked` is the set of justification ids blocked by their rule's exception; it
starts empty.  Rules live in the stores as sentexes, not here.
sourceraw docstring

datumsclj

(datums tms)
source

defeat-classclj

(defeat-class tms datum)

The current defeat-class of an IN datum (monotonic / default), or nil when the datum is OUT. Valid after relabel.

:classes holds only the datums above the lattice's bottom, so IN-ness is what separates "OUT, hence no class" from "IN at the default class". An entry's mere presence cannot carry both, since only one of them is information.

The current defeat-class of an IN datum (monotonic / default), or nil
when the datum is OUT.  Valid after `relabel`.

`:classes` holds only the datums *above* the lattice's bottom, so IN-ness is what
separates "OUT, hence no class" from "IN at the default class".  An entry's mere
presence cannot carry both, since only one of them is information.
sourceraw docstring

dependentsclj

(dependents tms datum)

Justification ids that use datum as an antecedent (or a defeater).

Justification ids that use `datum` as an antecedent (or a defeater).
sourceraw docstring

depthclj

(depth tms datum)
source

dissoc-allclj

(dissoc-all m ks)

(apply dissoc m ks) in one transient pass, since apply dissoc copies a full HAMT path per key and ks is the whole swept region of a retraction. Public because vaelii.impl.dense-jtms drops a swept region from its superseded map through it (docs/density.md).

`(apply dissoc m ks)` in one transient pass, since `apply dissoc` copies a full HAMT path
per key and `ks` is the whole swept region of a retraction.  Public because
`vaelii.impl.dense-jtms` drops a swept region from its `superseded` map through it
(docs/density.md).
sourceraw docstring

drop-justification!clj

(drop-justification! tms jid)

Remove the one justification jid from the network, relabel the region it supported, and sweep what that leaves OUT. Returns retract!'s shape; jid's own record is the caller's to delete, and is listed only in :removed-supports. The one removal that names a justification, for a permuting mark leaving: the firing still holds, at a spelling the store stopped folding into its row (chain/reconcile-spellings!).

Remove the one justification `jid` from the network, relabel the region it supported, and
sweep what that leaves OUT.  Returns `retract!`'s shape; `jid`'s own record is the caller's
to delete, and is listed only in `:removed-supports`.  The one removal that names a
justification, for a permuting mark leaving: the firing still holds, at a spelling the store
stopped folding into its row (`chain/reconcile-spellings!`).
sourceraw docstring

ensure-nodeclj

(ensure-node tms datum depth)
source

forced-membersclj

(forced-members tms kind)

Every member of forced set kind, as a set.

Every member of forced set `kind`, as a set.
sourceraw docstring

forced?clj

(forced? tms kind x)

Is x a member of forced set kind?

Is `x` a member of forced set `kind`?
sourceraw docstring

graph-justclj

(graph-just j)

The part of a justification the network is made of: everything except the firing's :bindings. Belief never reads the bindings (valid? needs the antecedents, conferred-class the strength and informant); only the exceptWhen and NAF re-evaluations want them, and those take the record from the store. Measured (lein bench-jtms): 80 of 277 B per justification at 3.6 justifications per node. It also normalizes (antecedents to a vector without the informant, strength defaulted) so both representations store equal values. :bindings is nil, not dropped. :subsumptions stays for just-key.

The part of a justification the network is made of: everything except the firing's
`:bindings`.  Belief never reads the bindings (`valid?` needs the antecedents,
`conferred-class` the strength and informant); only the `exceptWhen` and NAF re-evaluations
want them, and those take the record from the store.  Measured (`lein bench-jtms`): 80 of
277 B per justification at 3.6 justifications per node.  It also normalizes (antecedents to a
vector without the informant, strength defaulted) so both representations store equal
values.  `:bindings` is nil, not dropped.  `:subsumptions` stays for `just-key`.
sourceraw docstring

grounded-in-regionclj

(grounded-in-region tms extra)
(grounded-in-region tms extra belief-only)
(grounded-in-region tms extra belief-only invalid)

For extra (datums to force OUT): the forward consequence closure of extra (:region) and, within it, the datums that stay believed once extra is disbelieved (:in), the rest of the graph held at its current label. Region-local: belief outside the region is read per datum from in?, which keeps classify-local linear in the number of dilemmas (grounded_in_region_test). Built on the protocol reads, so both representations answer it without a method. belief-only maps a justification to the antecedent(s) read at the current label (exc/belief-only-antecedent); invalid is a set of justification ids read as invalid. See docs/labeling.md.

For `extra` (datums to force OUT): the forward consequence closure of `extra` (`:region`)
and, within it, the datums that stay believed once `extra` is disbelieved (`:in`), the rest of
the graph held at its current label.  Region-local: belief outside the region is read per
datum from `in?`, which keeps `classify-local` linear in the number of dilemmas
(`grounded_in_region_test`).  Built on the protocol reads, so both representations answer it
without a method.  `belief-only` maps a justification to the antecedent(s) read at the current
label (`exc/belief-only-antecedent`); `invalid` is a set of justification ids read as invalid.
See docs/labeling.md.
sourceraw docstring

has-justification?clj

(has-justification? tms informant antecedents consequence)
(has-justification? tms informant antecedents consequence k)

Is there already a support for consequence from informant over exactly these antecedents (as a set), with the same subsumptions? Guards against duplicate justifications. Answered from the dedup index when one is bound for this TMS — the same judgement, one hash probe — and by the supports scan otherwise. k, when given, is justification-key of the same informant and antecedents, and carries the subsumptions; without it the question is about a justification with none.

Is there already a support for `consequence` from `informant` over exactly these
antecedents (as a set), with the same subsumptions?  Guards against duplicate
justifications.  Answered from the dedup index when one is bound for this TMS — the
same judgement, one hash probe — and by the supports scan otherwise.  `k`, when given,
is `justification-key` of the same informant and antecedents, and carries the
subsumptions; without it the question is about a justification with none.
sourceraw docstring

heldclj

(held tms)

The hold open on tms, or nil.

The hold open on `tms`, or nil.
sourceraw docstring

hold!clj

(hold! tms h)

Open hold h (observe/new-hold) on tms, and answer whether it opened: false when a hold is open on it already. Until release!, every relabel records the labels it moves as they were before the hold's first move, and once observe/open-hold! registers h, a thread other than its owner reads belief, the blocked and superseded sets, and on the reference every read, from those. A settle holds its network this way, so a reader beside it reads the belief the settle began from until the settle publishes what it decided (vaelii.impl.settle/settle).

Open hold `h` (`observe/new-hold`) on `tms`, and answer whether it opened: false when a
hold is open on it already.  Until `release!`, every relabel records the labels it moves
as they were before the hold's first move, and once `observe/open-hold!` registers `h`, a
thread other than its owner reads belief, the blocked and superseded sets, and
on the reference every read, from those.  A settle holds its network this way, so a
reader beside it reads the belief the settle began from until the settle publishes what
it decided (`vaelii.impl.settle/settle`).
sourceraw docstring

in-datumsclj

(in-datums tms)
source

in?clj

(in? tms datum)

Is datum believed? Structural support minus supersession and the :held forced set: a datum the equality layer has displaced, or a rule a correspondence holds (docs/nat.md), keeps its place in the fixpoint (a twin or a respelled row is justified by it) but is not believed, so it stops matching and stops answering queries.

Is `datum` believed?  Structural support minus supersession and the `:held` forced
set: a datum the equality layer has displaced, or a rule a correspondence holds
(docs/nat.md), keeps its place in the fixpoint (a twin or a respelled row is justified
by it) but is not believed, so it stops matching and stops answering queries.
sourceraw docstring

justificationclj

(justification tms jid)
source

justification-keyclj

(justification-key informant antecedents)
(justification-key informant antecedents subsumptions)

The dedup key of a justification from informant over antecedents with subsumptions, a set or nil — just-key, for a caller that asks has-justification? and then adds the justification, and so would otherwise build the same set twice.

The dedup key of a justification from `informant` over `antecedents` with
`subsumptions`, a set or nil — `just-key`, for a caller that asks
`has-justification?` and then adds the justification, and so would otherwise build the
same set twice.
sourceraw docstring

justificationsclj

(justifications tms)
source

known-datum?clj

(known-datum? tms datum)

Does the TMS hold a node for datum? False for an inert sentex (core/assert-inert) — stored and indexed but never a TMS datum — which is how retract! tells a belief-bearing retraction from a direct teardown.

Does the TMS hold a node for `datum`?  False for an **inert** sentex
(`core/assert-inert`) — stored and indexed but never a TMS datum — which is how
`retract!` tells a belief-bearing retraction from a direct teardown.
sourceraw docstring

lowered-depthsclj

(lowered-depths datum depth dependents antecedents consequence depth-of)

{node depth} for datum at depth and for every node downstream of it whose shallowest justification reads shallower once it is, walked shallowest first. Writes nothing. dependents names the justification ids citing a node, antecedents and consequence read one justification (nil for an id no longer stored), and depth-of is the stored depth.

`{node depth}` for `datum` at `depth` and for every node downstream of it whose
shallowest justification reads shallower once it is, walked shallowest first.  Writes
nothing.  `dependents` names the justification ids citing a node, `antecedents` and
`consequence` read one justification (nil for an id no longer stored), and `depth-of`
is the stored depth.
sourceraw docstring

moved-supportsclj

(moved-supports tms)

The handles whose premise mark, justifications, or forced or blocked membership tms moved since the open write record opened, as a set, or nil.

The handles whose premise mark, justifications, or forced or blocked membership `tms`
moved since the open write record opened, as a set, or nil.
sourceraw docstring

network-in?clj

(network-in? tms datum)

Is datum IN in the network, a superseded spelling included? The families chain/place-nogoods! places detect their nogoods over this label, so a nogood with a superseded member keeps its placement (docs/nmtms.md).

Is `datum` IN in the network, a superseded spelling included?  The families
`chain/place-nogoods!` places detect their nogoods over this label, so a nogood with a
superseded member keeps its placement (docs/nmtms.md).
sourceraw docstring

premise-classclj

(premise-class tms datum)

The class datum's premise mark confers: :monotonic for a :mono member, its premise strength otherwise, nil for a datum that is no premise.

The class `datum`'s premise mark confers: `:monotonic` for a `:mono` member, its
premise strength otherwise, nil for a datum that is no premise.
sourceraw docstring

premise-strengthclj

(premise-strength tms datum)
source

premise?clj

(premise? tms datum)
source

raw-in?clj

(raw-in? tms datum)

Is datum believed, or kept from belief with its label IN: superseded, or a member of the :held forced set? The label a boundary datum of a region read takes, since the fixpoint keeps both kinds IN.

Is `datum` believed, or kept from belief with its label IN: superseded, or a member of
the `:held` forced set?  The label a boundary datum of a region read takes, since the
fixpoint keeps both kinds IN.
sourceraw docstring

region-depthsclj

(region-depths region
               premise?
               supports
               dependents
               antecedents
               consequence
               depth-of)

{node depth} for each node of region whose depth moves when the region is solved afresh, every node outside it held at its stored depth. region is closed under consequence (an affected region). Writes nothing. Knuth's generalization of Dijkstra: a justification is queued once its last antecedent inside the region is final; the queue pops shallowest first.

`{node depth}` for each node of `region` whose depth moves when the region is solved
afresh, every node outside it held at its stored depth.  `region` is closed under
consequence (an affected region).  Writes nothing.  Knuth's generalization of Dijkstra: a
justification is queued once its last antecedent inside the region is final; the queue pops
shallowest first.
sourceraw docstring

region-inclj

(region-in tms region scope base extra belief-only invalid)

The datums of scope, a part of region closed forward within it, that stay believed with extra forced OUT and invalid (justification ids) read as invalid, every datum of region outside scope read at its label in base and every datum outside region at its live one, added to base: grounded-in-region*'s fixpoint over scope, each justification read by region-valid-fn.

The datums of `scope`, a part of `region` closed forward within it, that stay believed
with `extra` forced OUT and `invalid` (justification ids) read as invalid, every datum of
`region` outside `scope` read at its label in `base` and every datum outside `region`
at its live one, added to `base`: `grounded-in-region*`'s fixpoint over `scope`, each
justification read by `region-valid-fn`.
sourceraw docstring

region-valid-fnclj

(region-valid-fn tms region belief-only invalid)

(fn [in j]): is the justification j valid with in the believed datums of region, the read region-in makes of each justification. An antecedent or rule handle in region is believed when in holds it, one outside at its live label, and one belief-only names for j (a handle or a set) at its label wherever it lies. j is invalid when blocked, :void or named by invalid.

`(fn [in j])`: is the justification `j` valid with `in` the believed datums of
`region`, the read `region-in` makes of each justification.  An antecedent or rule
handle in `region` is believed when `in` holds it, one outside at its live label, and
one `belief-only` names for `j` (a handle or a set) at its label wherever it lies.  `j`
is invalid when blocked, `:void` or named by `invalid`.
sourceraw docstring

relabelclj

(relabel tms)

Recompute every node's label and defeat-class, and clear the blocked and superseded sets (both derive from queries that are never stored): the whole-graph counterpart to the region relabels. Nothing on the live paths calls it; it is the differential oracle's operation (strength_test, jtms_dense_oracle_test, jtms_blocked_test), so both representations implement it.

Recompute every node's label and defeat-class, and clear the blocked and superseded sets
(both derive from queries that are never stored): the whole-graph counterpart to the region
relabels.  Nothing on the live paths calls it; it is the differential oracle's operation
(`strength_test`, `jtms_dense_oracle_test`, `jtms_blocked_test`), so both representations
implement it.
sourceraw docstring

release!clj

(release! tms h)

Close hold h on tms. A no-op for a hold that is not the one open.

Close hold `h` on `tms`.  A no-op for a hold that is not the one open.
sourceraw docstring

reset-touched!clj

(reset-touched! tms)

Clear the accumulated touched sets (see touched / touched-in / touched-new). settle clears them once it has read them, at the end — so the touched set a caller sees spans everything since the last settle finished, which for edit is the whole deferred batch and its one settle rather than the settle alone.

Clear the accumulated touched sets (see `touched` / `touched-in` / `touched-new`).
`settle` clears them once it has read them, at the *end* — so the touched set a caller sees
spans everything since the last settle finished, which for `edit` is the whole
deferred batch and its one settle rather than the settle alone.
sourceraw docstring

respell-informantclj

The informant of a justification storing a spelling a reader reads of a fact, from the row holding the fact as written and the marks that sort it (chain/respell-rows!). Its first antecedent is the row and the rest are the marks: every one must be IN for the justification to be valid, and only the row caps the class it confers (class-antecedents), so a spelling holds at the class of the fact it spells.

The informant of a justification storing a spelling a reader reads of a fact, from the
row holding the fact as written and the marks that sort it (`chain/respell-rows!`).  Its
first antecedent is the row and the rest are the marks: every one must be IN for the
justification to be valid, and only the row caps the class it confers
(`class-antecedents`), so a spelling holds at the class of the fact it spells.
sourceraw docstring

restrength-informantclj

(restrength-informant tms informant strength)

Set strength as the rule-contribution slot of every justification whose informant is informant, and relabel the region their consequences span. The slot caches provers/firing-strength, which moves when a re-asserted rule's defeasibility resolves or an exceptWhen arrives or leaves (special/restrength-firings!); without the move belief would keep the arrival order. The antecedent half of conferred-class is read live, so this is the only stored copy. The relabel spans the full affected region, since a class that rises can flip defeat decisions anywhere in the consumer ancestor set.

Set `strength` as the rule-contribution slot of every justification whose informant is
`informant`, and relabel the region their consequences span.  The slot caches
`provers/firing-strength`, which moves when a re-asserted rule's defeasibility resolves or an
`exceptWhen` arrives or leaves (`special/restrength-firings!`); without the move belief would
keep the arrival order.  The antecedent half of `conferred-class` is read live, so this is the
only stored copy.  The relabel spans the full affected region, since a class that rises can
flip defeat decisions anywhere in the consumer ancestor set.
sourceraw docstring

rests-onclj

(rests-on j)

Every handle justification j needs believed to be valid: its antecedents, plus its informant when that is a rule handle. The sweep preview, why-not's missing list, the visibility check and recovery's storedness check read this.

Every handle justification `j` needs believed to be valid: its antecedents, plus its
informant when that is a rule handle.  The sweep preview, `why-not`'s missing list, the
visibility check and recovery's storedness check read this.
sourceraw docstring

retract!clj

(retract! tms datum)

Dependency-directed retraction (drop premise / relabel / sweep). Returns {:removed-sentexes [datum...] :removed-justifications [jid...] :removed-supports [[consequence informant]...]}, the last absent when no justification went; a caller deletes the records and the justifications, and reads the supports without a justification fetch. Unknown datums no-op (empty result): retraction is idempotent.

Dependency-directed retraction (drop premise / relabel / sweep).  Returns
{:removed-sentexes [datum...] :removed-justifications [jid...]
:removed-supports [[consequence informant]...]}, the last absent when no justification
went; a caller deletes the records and the justifications, and reads the supports
without a justification fetch.  Unknown datums no-op (empty result): retraction is
idempotent.
sourceraw docstring

revivedclj

(revived tms)
(revived tms t)

The datums brought back since the last reset: relabelled, believed now, not believed at the reset, and already in the graph at the reset. A revival is the one belief move nothing downstream has seen (no arrival to chain from, no justification to withdraw), so settle re-seeds these onto the agenda. It is touched minus touched-in and touched-new, plus the -touched-out datums believed again. The two-arity takes touched as the caller already read it, since the dense network materializes a fresh set per read. See docs/nmtms.md.

The datums brought back since the last reset: relabelled, believed now, not believed at the
reset, and already in the graph at the reset.  A revival is the one belief move nothing
downstream has seen (no arrival to chain from, no justification to withdraw), so `settle`
re-seeds these onto the agenda.  It is `touched` minus `touched-in` and `touched-new`, plus
the `-touched-out` datums believed again.  The two-arity takes `touched` as the caller
already read it, since the dense network materializes a fresh set per read.
See docs/nmtms.md.
sourceraw docstring

set-blockedclj

(set-blocked tms jids)

Replace the blocked set with jids, the justifications whose exception the caller found to hold, less any id the network holds no justification for, and relabel the region the change reaches. The set is replaced and not accumulated, so belief cannot depend on the order the exceptions were discovered in. The region is seeded from the consequences of the justifications whose blocked status changed; a call that changes nothing does no work.

Replace the blocked set with `jids`, the justifications whose exception the caller found to
hold, less any id the network holds no justification for, and relabel the region the change
reaches.  The set is replaced and not accumulated, so belief cannot depend on the order the
exceptions were discovered in.  The region is seeded from the consequences of the
justifications whose blocked status changed; a call that changes nothing does no work.
sourceraw docstring

set-forcedclj

(set-forced tms kind xs on?)

Add each of xs to forced set kind (on? true) or take it out, and relabel the region the members that moved reach. :mono names premises whose class is :monotonic whatever strength they carry, :out datums never IN, :void justifications that support nothing, and :held datums the fixpoint labels as usual and in? never answers believed, so a :held move relabels nothing. A member may be written before its node or its justification exists, so the element never holds a label the set rules out.

Add each of `xs` to forced set `kind` (`on?` true) or take it out, and relabel the
region the members that moved reach.  `:mono` names premises whose class is
`:monotonic` whatever strength they carry, `:out` datums never IN, `:void`
justifications that support nothing, and `:held` datums the fixpoint labels as usual
and `in?` never answers believed, so a `:held` move relabels nothing.  A member may be written before its node or its
justification exists, so the element never holds a label the set rules out.
sourceraw docstring

snapshotclj

(snapshot tms)

The network as one canonical persistent map (see -snapshot). A testing and debugging surface — the differential oracle compares two implementations with it.

The network as one canonical persistent map (see `-snapshot`).  A testing and
debugging surface — the differential oracle compares two implementations with it.
sourceraw docstring

supersedeclj

(supersede tms m)

Replace the superseded map with m ({datum reason}), as set-blocked replaces: the caller reconciles the whole answer (special/refresh-supersessions). No relabel: supersession only subtracts from what in? reports.

**Replace** the superseded map with `m` (`{datum reason}`), as `set-blocked` replaces:
the caller reconciles the whole answer (`special/refresh-supersessions`).  No relabel:
supersession only subtracts from what `in?` reports.
sourceraw docstring

supersededclj

(superseded tms)

The datum -> reason map of spellings an equality merge has displaced.

The `datum -> reason` map of spellings an equality merge has displaced.
sourceraw docstring

superseded?clj

(superseded? tms datum)
source

supersessionclj

(supersession tms datum)

Why datum is superseded — the representative that displaced it — or nil.

Why `datum` is superseded — the representative that displaced it — or nil.
sourceraw docstring

supportsclj

(supports tms datum)

Justification ids that conclude datum (its supporting justifications).

Justification ids that conclude `datum` (its supporting justifications).
sourceraw docstring

suspend-premiseclj

(suspend-premise tms datum)

Drop datum's premise mark and relabel its region without sweeping: a retraction's effect on belief, undone by add-premise at the same strength. Unknown datums no-op. Bare, not !: the node and its justifications stay. core/preview is the caller (docs/nmtms.md).

Drop `datum`'s premise mark and relabel its region without sweeping: a retraction's
effect on belief, undone by `add-premise` at the same strength.  Unknown datums no-op.
Bare, not `!`: the node and its justifications stay.  `core/preview` is the caller
(docs/nmtms.md).
sourceraw docstring

sweep!clj

(sweep! tms seeds)

Garbage-collect the consequence closure of seeds: every datum in it that is not a premise and is OUT is deleted with the justifications touching it. Returns retract!'s shape, for the caller to apply to its own stores. retract!'s sweep without the retraction, for exceptWhen (docs/exceptions.md, "Garbage collection, not defeat"). Labels must already be current (set-blocked relabels the same region).

Garbage-collect the consequence closure of `seeds`: every datum in it that is not a premise
and is OUT is deleted with the justifications touching it.  Returns `retract!`'s shape, for
the caller to apply to its own stores.  `retract!`'s sweep without the retraction, for
`exceptWhen` (docs/exceptions.md, "Garbage collection, not defeat").  Labels must already be
current (`set-blocked` relabels the same region).
sourceraw docstring

touch-markclj

(touch-mark tms)

A mark of this point in the touched set, for a reader that asks the touched set more than once between resets: touched-since answers what was recorded after it. Each reader keeps its own mark.

A mark of this point in the touched set, for a reader that asks the touched set more
than once between resets: `touched-since` answers what was recorded after it.  Each reader keeps
its own mark.
sourceraw docstring

touch-mark-if-keptclj

(touch-mark-if-kept tms)

touch-mark of tms, or nil for a network that keeps no marks (kb/prior-kb's, whose frames are kept by reading every watched label).

`touch-mark` of `tms`, or nil for a network that keeps no marks (`kb/prior-kb`'s, whose
frames are kept by reading every watched label).
sourceraw docstring

touchedclj

(touched tms)

The datums whose region has been relabelled since the last reset-touched!: a superset of every datum whose belief could have flipped. settle reads it to tell tax/refresh-beliefs which handles moved. It also holds the datums a redundant justification landed on, whose belief did not move but whose published answer may be stale (add-just*). Consumers read a superset, so an extra handle costs a re-derivation and never an answer.

The datums whose region has been relabelled since the last `reset-touched!`: a superset of
every datum whose belief could have flipped.  `settle` reads it to tell `tax/refresh-beliefs`
which handles moved.  It also holds the datums a redundant justification landed on, whose
belief did not move but whose published answer may be stale (`add-just*`).  Consumers read a
superset, so an extra handle costs a re-derivation and never an answer.
sourceraw docstring

touched-inclj

(touched-in tms)

The subset of touched whose label was IN when a relabel since the reset first reached it. With touched and current belief it gives the label delta: IN now but not here came in; here and OUT now went out. A superseded spelling keeps an IN label and is not believed (in?), so settle-finish drops the spellings superseded when the settle began. A datum relabelled twice keeps the earlier answer.

The subset of `touched` whose label was IN when a relabel since the reset first reached it.
With `touched` and current belief it gives the label delta: IN now but not here came in; here
and OUT now went out.  A superseded spelling keeps an IN label and is not believed (`in?`),
so `settle-finish` drops the spellings superseded when the settle began.  A datum relabelled
twice keeps the earlier answer.
sourceraw docstring

touched-newclj

(touched-new tms)

The datums whose node was created since the last reset — the ones that had no label to move because they had no node. touched-in cannot say this: a brand-new datum and a stored one that has been OUT since the settle before both read as "not believed at the last reset", and they are the two halves revived has to keep apart.

The datums whose **node was created since the last reset** — the ones that had no label to move
because they had no node.  `touched-in` cannot say this: a brand-new datum and a
stored one that has been OUT since the settle before both read as "not believed at
the last reset", and they are the two halves `revived` has to keep apart.
sourceraw docstring

touched-sinceclj

(touched-since tms mark)

The datums touched recorded after mark (touch-mark): a datum relabelled again since the mark is in it although touched held it already, which a set difference over touched would drop. A superset of what moved since the mark, as touched is of what moved since the reset. The whole of touched for a mark the reset outdated (reset-touched!) or a nil one.

The datums `touched` recorded after `mark` (`touch-mark`): a datum relabelled again
since the mark is in it although `touched` held it already, which a set difference over
`touched` would drop.  A superset of what moved since the mark, as `touched` is of what
moved since the reset.  The whole of `touched` for a mark the reset outdated
(`reset-touched!`) or a nil one.
sourceraw docstring

unsupported?clj

(unsupported? tms datum)

Does the network hold a node for datum that is no premise and that no justification concludes?

Does the network hold a node for `datum` that is no premise and that no justification
concludes?
sourceraw docstring

with-dedup-cachecljmacro

(with-dedup-cache tms & body)

Run body with the justification dedup index engaged for tms; an outer cache over the same TMS is reused rather than shadowed — the composition observe/with-handle-cache makes — and one over another TMS is shadowed by a fresh map. A no-op when observe/*chain-fast-paths* is bound false — the reference lever chain_fast_paths_test pulls.

Run `body` with the justification dedup index engaged for `tms`; an outer cache
over the *same* TMS is reused rather than shadowed — the composition
`observe/with-handle-cache` makes — and one over another TMS is shadowed by a
fresh map.  A no-op when `observe/*chain-fast-paths*` is bound false — the
reference lever `chain_fast_paths_test` pulls.
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