The KB half every calculus over vaelii.impl.qcn shares: a calculus value
(calculus), the believed facts of one reader context read into a resident network,
the passes over it, entailment and refutation as prover solutions, the support an
entailment rests on, and the delta a forward re-join runs over. See docs/qcn.md.
The KB half every calculus over `vaelii.impl.qcn` shares: a calculus value (`calculus`), the believed facts of one reader context read into a resident network, the passes over it, entailment and refutation as prover solutions, the support an entailment rests on, and the delta a forward re-join runs over. See docs/qcn.md.
(asserted-pairs kb node? pred context)(asserted-pairs kb node? pred context [pos node])Every [handles a b] for which (pred a b) is believed at context,
through the matcher's spec fan. handles is the fact, then for a sub-predicate fact
the genl edges of one path up to pred that context sees (tax/reach-support).
[pos node] keeps the facts holding node at argument pos, read off its argument
index.
Every `[handles a b]` for which `(pred a b)` is believed at `context`, through the matcher's spec fan. `handles` is the fact, then for a sub-predicate fact the `genl` edges of one path up to `pred` that `context` sees (`tax/reach-support`). `[pos node]` keeps the facts holding `node` at argument `pos`, read off its argument index.
(blocked-nodes calc kb context)The nodes of the unsatisfiable components of the network of calc visible from
context (split): no goal naming one is answered there. #{} when the network is
satisfiable, and for a variable context.
The nodes of the unsatisfiable components of the network of `calc` visible from
`context` (`split`): no goal naming one is answered there. `#{}` when the network is
satisfiable, and for a variable `context`.(built-calculi-values)Every calculus built in this process, one per name.
Every calculus built in this process, one per name.
(calculi-triggered-by kb pred)Every registered calculus one of whose :trigger-predicates is pred or a
super-predicate of it by the global genls closure, or nil. Every one, not the first:
one predicate can move two networks. A caller holding (genl sub super) asks it of
super.
Every registered calculus one of whose `:trigger-predicates` is `pred` or a super-predicate of it by the global `genls` closure, or nil. Every one, not the first: one predicate can move two networks. A caller holding `(genl sub super)` asks it of `super`.
(calculus nm algebra denotation)(calculus nm algebra denotation narrowing)(calculus nm algebra denotation narrowing typed)Bundle an algebra and its vocabulary into the value every function here takes.
denotation maps each stored predicate to the set of base relations it denotes, so its
keys are the predicates the prover claims.
narrowing is the optional second reader — nil for a calculus that has none:
{:fn (fn [kb context] → {:net … :support …} | nil)
:over-nodes (fn [nodes] → {:net … :support …} | nil)
:pair (fn [kb context a b support?] → [#{base relations} #{handle}] | nil)
:node? which terms are nodes, when not every node is a symbol
:bindings the dynamic vars :fn reads, whose values key the resident network
:sources every predicate whose arrival or departure moves what it answers
:contexts the subset that puts a NODE in the network, so names a reader context}
with-goal-nodes runs :over-nodes over a goal's nodes too. Any key may be absent.
:sources and :contexts fold into :trigger-predicates and :context-predicates.
typed is the predicates whose arg declarations are narrower than the network's
nodes, answered only over arguments those types admit (solve-goal).
The value carries its two pass caches and is registered in built-calculi.
Bundle an algebra and its vocabulary into the value every function here takes.
`denotation` maps each stored predicate to the set of base relations it denotes, so its
keys are the predicates the prover claims.
`narrowing` is the optional second reader — nil for a calculus that has none:
{:fn (fn [kb context] → {:net … :support …} | nil)
:over-nodes (fn [nodes] → {:net … :support …} | nil)
:pair (fn [kb context a b support?] → [#{base relations} #{handle}] | nil)
:node? which terms are nodes, when not every node is a symbol
:bindings the dynamic vars `:fn` reads, whose values key the resident network
:sources every predicate whose arrival or departure moves what it answers
:contexts the subset that puts a NODE in the network, so names a reader context}
`with-goal-nodes` runs `:over-nodes` over a goal's nodes too. Any key may be absent.
`:sources` and `:contexts` fold into `:trigger-predicates` and `:context-predicates`.
`typed` is the predicates whose `arg` declarations are narrower than the network's
nodes, answered only over arguments those types admit (`solve-goal`).
The value carries its two pass caches and is registered in `built-calculi`.(calculus-for kb pred)The registered calculus whose :predicates holds pred, or nil; a predicate belongs
to one calculus. A predicate that only moves a network is calculi-triggered-by's.
The registered calculus whose `:predicates` holds `pred`, or nil; a predicate belongs to one calculus. A predicate that only moves a network is `calculi-triggered-by`'s.
(closed-network calc kb context)The pass over the satisfiable components of the network of calc visible from
context: tighten of the network as read when it is satisfiable, else of what split
leaves.
The pass over the satisfiable components of the network of `calc` visible from `context`: `tighten` of the network as read when it is satisfiable, else of what `split` leaves.
(closure-with-support calc kb context)(closure-with-support calc kb context nodes)The support-carrying pass over the satisfiable components of the network of calc
visible from context, every pair at once, with nodes added: {:network … :support …}. A caller reading many pairs reads them here; support walks every pair per call.
The support-carrying pass over the satisfiable components of the network of `calc`
visible from `context`, every pair at once, with `nodes` added: `{:network … :support
…}`. A caller reading many pairs reads them here; `support` walks every pair per call.(constraint calc net i j)The constraint set on [i j] in net: the identity on the diagonal, the recorded
set, else the universe (unknown).
The constraint set on `[i j]` in `net`: the identity on the diagonal, the recorded set, else the universe (unknown).
(converse-entailed? calc p q)Does calc's network entail (p a b) from every believed (q b a): does calc own
p and q, with the algebra's converse of q's denotation inside p's? A believed
(inverse p q) the converse table implies is then a source the network already reads
(provers/shadowing-channels).
Does `calc`'s network entail `(p a b)` from every believed `(q b a)`: does `calc` own `p` and `q`, with the algebra's converse of `q`'s denotation inside `p`'s? A believed `(inverse p q)` the converse table implies is then a source the network already reads (`provers/shadowing-channels`).
(definite calc kb context a b)The single base relation between a and b when path consistency determines it;
:inconsistent when the network contradicts itself, :unknown when two or more
remain possible.
The single base relation between `a` and `b` when path consistency determines it; `:inconsistent` when the network contradicts itself, `:unknown` when two or more remain possible.
(inconsistency-culprits calc kb context){:pair [i j] :support #{handle}} for an unsatisfiable network, the pair whose
constraint emptied and the sentexes behind it, or nil when the network is satisfiable.
Which pair is blamed depends on the driver's order (docs/qcn.md, "Support").
`{:pair [i j] :support #{handle}}` for an unsatisfiable network, the pair whose
constraint emptied and the sentexes behind it, or nil when the network is satisfiable.
Which pair is blamed depends on the driver's order (docs/qcn.md, "Support").(inconsistent? calc kb context)Is the network of calc visible from context unsatisfiable?
Is the network of `calc` visible from `context` unsatisfiable?
(join-baseline kb calc context){:handles … :net …}: the handles the network of calc in context was read out of,
and the network they close to.
`{:handles … :net …}`: the handles the network of `calc` in `context` was read out of,
and the network they close to.(join-delta kb calc context){:moved … :baseline …} for calc in context: the pairs that may license a firing
the last re-join did not, and the baseline to hand note-joined after this re-join.
:moved is :all with no baseline recorded, either side unsatisfiable, or a handle gone
from the network's input; else the pairs, both directions, whose closed constraint
differs, #{} without a pair read when both baseline values are identical? to now's.
`{:moved … :baseline …}` for `calc` in `context`: the pairs that may license a firing
the last re-join did not, and the baseline to hand `note-joined` after this re-join.
`:moved` is `:all` with no baseline recorded, either side unsatisfiable, or a handle gone
from the network's input; else the pairs, both directions, whose closed constraint
differs, `#{}` without a pair read when both baseline values are `identical?` to now's.(network kb calc context)The constraint network {[a b] → #{base relations}} of every believed relation of
calc visible from context, both directions stored: each (P a b) intersects the
pair with P's denotation, each (not (P a b)) with its complement. An unrecorded pair
is the universe. A variable context reads every context's facts, each as its own
context believes it, into one diagnostic network that answers no goal.
The constraint network `{[a b] → #{base relations}}` of every believed relation of
`calc` visible from `context`, both directions stored: each `(P a b)` intersects the
pair with P's denotation, each `(not (P a b))` with its complement. An unrecorded pair
is the universe. A variable `context` reads every context's facts, each as its own
context believes it, into one diagnostic network that answers no goal.(network-support kb calc context)The asserted support of network: {[a b] → #{handle}}, the sentexes intersected into
each pair.
The asserted support of `network`: `{[a b] → #{handle}}`, the sentexes intersected into
each pair.(nodes net)Every term named by a constraint in net.
Every term named by a constraint in `net`.
(note-joined kb calc context baseline)Record baseline as the network every rule mentioning calc has now been joined over
in context, in the KB's :qcn-joined map. Only a caller that re-joins all of those
rules may call this; a single rule's own full join does not.
Record `baseline` as the network every rule mentioning `calc` has now been joined over in `context`, in the KB's `:qcn-joined` map. Only a caller that re-joins all of those rules may call this; a single rule's own full join does not.
(possible calc kb context a b)The base relations still possible between a and b given everything believed in
context, narrowed by the calculus's :pair reading — #{} when either lies in an
unsatisfiable component of the network.
The base relations still possible between `a` and `b` given everything believed in
`context`, narrowed by the calculus's `:pair` reading — `#{}` when either lies in an
unsatisfiable component of the network.(possible-among calc kb context nodes)A fn of two of nodes answering the base relations still possible between them given
everything believed in context, read off one pass over the network with nodes
added. It answers #{} for every pair when a node lies in an unsatisfiable component.
A fn of two of `nodes` answering the base relations still possible between them given
everything believed in `context`, read off one pass over the network with `nodes`
added. It answers `#{}` for every pair when a node lies in an unsatisfiable component.(prover calc)(prover calc open-est)The entailment prover for calc, to register with vaelii.core/add-prover. Its
est-bindings reads no network: a ground goal is 1 and an open one is bounded by the
stored facts on the calculus's predicates, or is open-est when given. A calculus whose
open answers the nodes do not list passes provers/deferred-est (docs/qcn.md, "Cost,
completeness, registration").
The entailment prover for `calc`, to register with `vaelii.core/add-prover`. Its `est-bindings` reads no network: a ground goal is 1 and an open one is bounded by the stored facts on the calculus's predicates, or is `open-est` when given. A calculus whose open answers the nodes do not list passes `provers/deferred-est` (docs/qcn.md, "Cost, completeness, registration").
(prover-for? nm pr)Is pr the prover of the calculus named nm?
Is `pr` the prover of the calculus named `nm`?
(reader-contexts kb calc)The reader contexts of calc: held-contexts over its :context-predicates, the
facts that put a node into a network.
The reader contexts of `calc`: `held-contexts` over its `:context-predicates`, the facts that put a node into a network.
(registered-calculi kb)The calculi whose prover is registered on kb, memoized against the registry's
identity (registry-calculi).
The calculi whose prover is registered on `kb`, memoized against the registry's identity (`registry-calculi`).
(reported-sources kb calc context)unsatisfiable-sources as a report names them: no :stand-in, and :support as a
sorted vector of handles. nil when no source is unsatisfiable.
`unsatisfiable-sources` as a report names them: no `:stand-in`, and `:support` as a sorted vector of handles. nil when no source is unsatisfiable.
(solve-with-support calc kb goal context)(solve-with-support calc kb goal context pairs)Entailed solutions for the positive literal goal in context, each paired with the
handles it rests on: a seq of [bindings #{handle}]. The diagonal at a node rests on
a believed (reflexive P) statement context sees (res/declaration-supports) and a
fact naming the node, one solution per such pair (node-statements), so placement sees
where the node is. A goal on two distinct variables answers the diagonal too, so the
antecedent that binds first decides no firing. A solution with empty support is
dropped. pairs narrows the enumeration as in solve-goal, with the diagonal of every
node it names.
Entailed solutions for the positive literal `goal` in `context`, each paired with the
handles it rests on: a seq of `[bindings #{handle}]`. The diagonal at a node rests on
a believed `(reflexive P)` statement `context` sees (`res/declaration-supports`) and a
fact naming the node, one solution per such pair (`node-statements`), so placement sees
where the node is. A goal on two distinct variables answers the diagonal too, so the
antecedent that binds first decides no firing. A solution with empty support is
dropped. `pairs` narrows the enumeration as in `solve-goal`, with the diagonal of every
node it names.(support calc kb context a b)The handles of the stored sentexes the relation between a and b rests on: the
facts intersected into that pair, plus the facts behind every composition that narrowed
it, for one derivation. The :pair reading's handles join them where it narrows what
possible answers. #{} when the pair is unconstrained or either node lies in an
unsatisfiable component.
The handles of the stored sentexes the relation between `a` and `b` rests on: the
facts intersected into that pair, plus the facts behind every composition that narrowed
it, for one derivation. The `:pair` reading's handles join them where it narrows what
`possible` answers. `#{}` when the pair is unconstrained or either node lies in an
unsatisfiable component.(tighten kb {:keys [algebra pc-cache] :as calc} context net extra)Path consistency over net, a network as network reads it or one with-goal-nodes
extended, memoized on the network value with resident-pass in front, warm-started
(qcn/path-consistent-from) when net narrows the resident network. extra is the
goal's nodes beyond net's; only a miss reads net's own nodes. A read files nothing:
the settle places an unsatisfiable component (unsatisfiable-regions).
Path consistency over `net`, a network as `network` reads it or one `with-goal-nodes` extended, memoized on the network value with `resident-pass` in front, warm-started (`qcn/path-consistent-from`) when `net` narrows the resident network. `extra` is the goal's nodes beyond `net`'s; only a miss reads `net`'s own nodes. A read files nothing: the settle places an unsatisfiable component (`unsatisfiable-regions`).
(typed-admits? calc kb pred x y context)Do the types context sees declared of pred's two positions admit x and y
(res/arg-admits-fn)? True for a pred that calc does not name :typed. The
admission solve-goal asks of a positive goal, for a caller re-deciding one answer.
Do the types `context` sees declared of `pred`'s two positions admit `x` and `y` (`res/arg-admits-fn`)? True for a `pred` that `calc` does not name `:typed`. The admission `solve-goal` asks of a positive goal, for a caller re-deciding one answer.
(unsatisfiable-as-written kb calc context)qcn/unsatisfiable-pairs of the network of calc in context, less the stand-in pairs
of its unsatisfiable sources: the pairs whose stored facts no model satisfies.
`qcn/unsatisfiable-pairs` of the network of `calc` in `context`, less the stand-in pairs of its unsatisfiable sources: the pairs whose stored facts no model satisfies.
(unsatisfiable-components calc kb context)Each unsatisfiable component of the network of calc visible from context, as
{:nodes #{node} :pairs #{[a b]} :culprits #{handle}}: its nodes, its pairs
unsatisfiable as written, and the handles a support-carrying pass over it blames
(qcn/path-consistent-with-support). nil when the network is satisfiable.
Each unsatisfiable component of the network of `calc` visible from `context`, as
`{:nodes #{node} :pairs #{[a b]} :culprits #{handle}}`: its nodes, its pairs
unsatisfiable as written, and the handles a support-carrying pass over it blames
(`qcn/path-consistent-with-support`). nil when the network is satisfiable.(unsatisfiable-regions calc kb context touched)The conflicted regions of the network of calc visible from context: each connected
component (touched-components) holding a node of touched, or every one when touched
is nil, whose pass is unsatisfiable, as {:nodes #{node} :pairs #{[a b]} :sources […] :members #{handle}}. :pairs is the component's pairs unsatisfiable as written, less
those a narrowing's unsatisfiable source emptied, and :sources those sources as
reported-sources names them. :members is the support of its pairs, a source's
support for a pair it emptied included. The pass runs over each such component alone,
memoized on its value (component-pass). [] for a variable context.
The conflicted regions of the network of `calc` visible from `context`: each connected
component (`touched-components`) holding a node of `touched`, or every one when `touched`
is nil, whose pass is unsatisfiable, as `{:nodes #{node} :pairs #{[a b]} :sources […]
:members #{handle}}`. `:pairs` is the component's pairs unsatisfiable as written, less
those a narrowing's unsatisfiable source emptied, and `:sources` those sources as
`reported-sources` names them. `:members` is the support of its pairs, a source's
support for a pair it emptied included. The pass runs over each such component alone,
memoized on its value (`component-pass`). `[]` for a variable `context`.(unsatisfiable-somewhere? calc kb)Is the network of calc unsatisfiable for some context? Asked of the
governing-contexts alone: a context sees the facts one of them at or above it sees,
less what a defeat or an except withdraws below it, and a network over fewer facts
is never tighter — so no context is unsatisfiable where all of them are satisfiable
(docs/exceptions.md, "Two withdrawals a firing carries").
Is the network of `calc` unsatisfiable for some context? Asked of the `governing-contexts` alone: a context sees the facts one of them at or above it sees, less what a defeat or an `except` withdraws below it, and a network over fewer facts is never tighter — so no context is unsatisfiable where all of them are satisfiable (docs/exceptions.md, "Two withdrawals a firing carries").
(unsatisfiable-sources kb calc context)The unsatisfiable sources a narrowing of calc read in context, each
{:source kw :pairs [[p q] …] :support #{handle} :stand-in #{[a b]}}, a :metric source
adding :cycle [instant …], or naming :dimensions [dimension …] in place of both when
its problem is refused. :stand-in is the pairs of this network the narrowing
emptied for the source and no stored fact emptied. nil when no source is unsatisfiable.
The unsatisfiable sources a narrowing of `calc` read in `context`, each
`{:source kw :pairs [[p q] …] :support #{handle} :stand-in #{[a b]}}`, a `:metric` source
adding `:cycle [instant …]`, or naming `:dimensions [dimension …]` in place of both when
its problem is refused. `:stand-in` is the pairs of this network the narrowing
emptied for the source and no stored fact emptied. nil when no source is unsatisfiable.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 |