Liking cljdoc? Tell your friends :D

vaelii.client

A thin EDN-over-HTTP client for the vaelii daemon (vaelii.serve). Runs no engine: it POSTs {:op :args} and reads the result back, over JDK java.net.http (no dependency — JDK 21 ships it).

Every call threads an explicit connection handle as its first argument — (query conn '(dog ?x) 'Ctx) — the network mirror of vaelii.core's explicit-kb API. A conn from client holds a reusable HttpClient; no socket opens until a call. A daemon reply of {:ok false} becomes an ex-info carrying the daemon's :error and :type, so a remote naming or disjointness refusal surfaces like a local one.

A daemon with VAELII_API_TOKEN set answers 401 (:unauthorized) to a call that presents no bearer token; the conn reads the same variable, so a client in the daemon's environment carries it with nothing said.

Public because a client is a thing applications write against; the implementation is vaelii.impl.client, which is free to change. Result shapes are vaelii.core's: a sentex comes back as a plain map (the daemon projects the record), a solution as a binding map.

Every op the daemon serves has a wrapper here, spelled as vaelii.core spells the fn — bare or !-marked exactly as it does — and at its arities, with kb replaced by conn. The ones below are written out; the rest are generated from the daemon's op table by lein regen-client, which is also what makes the claim checkable rather than aspirational (client_surface_test). call still reaches any op directly, which is what a caller wants for serve/feed-ops and for an op newer than this build.

A thin EDN-over-HTTP client for the vaelii daemon (`vaelii.serve`).  Runs no engine:
it POSTs `{:op :args}` and reads the result back, over JDK `java.net.http` (no
dependency — JDK 21 ships it).

Every call threads an **explicit connection handle** as its first argument —
`(query conn '(dog ?x) 'Ctx)` — the network mirror of `vaelii.core`'s explicit-`kb`
API.  A `conn` from `client` holds a reusable `HttpClient`; no socket opens until a
call.  A daemon reply of `{:ok false}` becomes an `ex-info` carrying the daemon's
`:error` and `:type`, so a remote naming or disjointness refusal surfaces like a
local one.

A daemon with `VAELII_API_TOKEN` set answers 401 (`:unauthorized`) to a call that
presents no bearer token; the `conn` reads the same variable, so a client in the
daemon's environment carries it with nothing said.

Public because a client is a thing applications write against; the implementation is
`vaelii.impl.client`, which is free to change.  Result shapes are `vaelii.core`'s: a
sentex comes back as a plain map (the daemon projects the record), a solution as a
binding map.

**Every op the daemon serves has a wrapper here**, spelled as `vaelii.core` spells the
fn — bare or `!`-marked exactly as it does — and at its arities, with `kb` replaced by
`conn`.  The ones below are written out; the rest are generated from the daemon's op
table by `lein regen-client`, which is also what makes the claim checkable rather than
aspirational (`client_surface_test`).  `call` still reaches any op directly, which is
what a caller wants for `serve/feed-ops` and for an op newer than this build.
raw docstring

abduceclj

(abduce conn goal)
(abduce conn goal context)
(abduce conn goal context opts)

What would have to be true for goal to be provable in context.

What would have to be true for `goal` to be provable in `context`.
sourceraw docstring

abduce-discard!clj

(abduce-discard! conn result)

Discard an abduction's scratch context — every hypothesis in it, and everything they licensed.

Discard an abduction's scratch context — every hypothesis in it, and everything they
licensed.
sourceraw docstring

add-provenanceclj

(add-provenance conn handle m)

Merge m into handle's provenance map (creating it if absent), returning the merged map.

Merge `m` into `handle`'s provenance map (creating it if absent), returning the merged
map.
sourceraw docstring

argueclj

(argue conn asent context)
(argue conn asent context opts)

Four-valued epistemic status of a ground assertion.

Four-valued epistemic status of a ground assertion.
sourceraw docstring

askclj

(ask conn goal)
(ask conn goal context)
(ask conn goal context opts)

The first solution for goal, or nil. opts is the wall clock vaelii.core/ask takes — {:max-ms n}, held under the daemon's ceiling, and given the ceiling's when absent.

The first solution for `goal`, or nil.  `opts` is the wall clock `vaelii.core/ask`
takes — `{:max-ms n}`, held under the daemon's ceiling, and given the ceiling's when
absent.
sourceraw docstring

ask-withinclj

(ask-within conn goal budget)
(ask-within conn goal context budget)

Anytime ask: answer goal in context, but bounded by budget — a map of any of {:max-ms n :max-results n :max-cost <tier>}.

Anytime `ask`: answer `goal` in `context`, but bounded by `budget` — a map of any of
`{:max-ms n :max-results n :max-cost <tier>}`.
sourceraw docstring

ask?clj

(ask? conn goal)
(ask? conn goal context)
(ask? conn goal context opts)

Whether goal has any solution. Same opts as ask.

Whether `goal` has any solution.  Same `opts` as `ask`.
sourceraw docstring

assertclj

(assert conn sentence)
(assert conn sentence context)
(assert conn sentence context opts)

Assert sentence in context (optional opts) — returns the handle(s). Bare — no ! — for vaelii.core/assert's reason: additive, and retract! takes it back. With no context it is CxUniverse, as in process.

Assert `sentence` in `context` (optional `opts`) — returns the handle(s).  Bare —
no `!` — for `vaelii.core/assert`'s reason: additive, and `retract!` takes it back.
With no context it is `CxUniverse`, as in process.
sourceraw docstring

assert-manyclj

(assert-many conn sentences context)
(assert-many conn sentences context opts)

Assert every sentence in sentences into context, as one call.

Assert every sentence in `sentences` into `context`, as one call.
sourceraw docstring

assert-ruleclj

(assert-rule conn antecedents consequent)
(assert-rule conn antecedents consequent context)
(assert-rule conn antecedents consequent context opts)

Assert a rule from antecedents to consequent in context — returns the handle(s); a conjunctive consequent yields one handle per conjunct. With no context it is CxUniverse, as in process.

Assert a rule from `antecedents` to `consequent` in `context` — returns the
handle(s); a conjunctive consequent yields one handle per conjunct.  With no context
it is `CxUniverse`, as in process.
sourceraw docstring

belief-statusclj

(belief-status conn handle context)

Storage, raw IN, exception forest, inheritance path, belief, and visibility for handle as viewed from context.

Storage, raw IN, exception forest, inheritance path, belief, and visibility for
`handle` as viewed from `context`.
sourceraw docstring

believedclj

(believed conn handles)

The subset of handles raw structural JTMS IN, as a set — in? asked of many handles at once.

The subset of `handles` raw structural JTMS IN, as a set — `in?` asked of many handles
at once.
sourceraw docstring

believed?clj

(believed? conn handle context)

Whether handle is JTMS IN after exceptions visible from context, before assertion-context inheritance.

Whether `handle` is JTMS IN after exceptions visible from `context`, before
assertion-context inheritance.
sourceraw docstring

blocked-justificationsclj

(blocked-justifications conn)

The ids of the justifications a rule exception currently blocks — every antecedent IN and supporting nothing. The one justification property belief does not report.

The ids of the justifications a rule exception currently blocks — every antecedent IN
and supporting nothing.  The one justification property belief does not report.
sourceraw docstring

cachesclj

(caches conn)

What this process is holding beside the stores — every derived structure the engine caches, ranked by entries.

What this process is holding beside the stores — every derived structure the engine
caches, ranked by entries.
sourceraw docstring

calculiclj

(calculi conn)

The shipped qualitative calculi as data — one map apiece, naming the calculus, the base relations it distinguishes (jointly exhaustive and pairwise disjoint, so exactly one holds of any two terms), the identity it puts on the diagonal, and the predicates it claims.

The shipped qualitative calculi as data — one map apiece, naming the calculus, the base
relations it distinguishes (jointly exhaustive and pairwise disjoint, so exactly one
holds of any two terms), the identity it puts on the diagonal, and the predicates it
claims.
sourceraw docstring

callclj

(call conn op args)
(call conn op args opts)

POST {:op op :args args} and return the :result, or throw ex-info on an {:ok false} reply. The low-level entry the wrappers below use; reach for it for an op with no wrapper yet — vaelii.serve/op-names is the reachable set. opts is {:timeout-ms n} for this call alone, which the long poll below is what needs.

POST `{:op op :args args}` and return the `:result`, or throw `ex-info` on an
`{:ok false}` reply.  The low-level entry the wrappers below use; reach for it for
an op with no wrapper yet — `vaelii.serve/op-names` is the reachable set.  `opts` is
`{:timeout-ms n}` for this call alone, which the long `poll` below is what needs.
sourceraw docstring

canonical-sentexclj

(canonical-sentex conn sentence context)

The canonical sentex for sentence in context, without storing it — the un-stored counterpart of sentex.

The canonical sentex for `sentence` in `context`, **without storing it** — the un-stored
counterpart of `sentex`.
sourceraw docstring

chain-reportclj

(chain-report conn)

Per forward rule, what forward chaining did with it — how many firings it placed, how many it refused and why, or whether it did nothing at all.

Per forward rule, what forward chaining did with it — how many firings it **placed**,
how many it **refused** and why, or whether it did nothing at all.
sourceraw docstring

chain-statsclj

(chain-stats conn)

Chaining-run instrumentation: {:runs n :last {:derived n :truncated? bool}}.

Chaining-run instrumentation: `{:runs n :last {:derived n :truncated? bool}}`.
sourceraw docstring

checkclj

(check conn sentence)
(check conn sentence context)
(check conn sentence context opts)

Would (assert kb sentence context opts) succeed, and if not, why? Returns a vector of problems — empty when the sentence is admissible — and stores nothing: no sentex, no index entry, no taxonomy edge, no chaining, no settle.

Would `(assert kb sentence context opts)` succeed, and if not, why? Returns a **vector
of problems** — empty when the sentence is admissible — and **stores nothing**: no
sentex, no index entry, no taxonomy edge, no chaining, no settle.
sourceraw docstring

check-editclj

(check-edit conn batch)

check over a whole edit batch — {:add [[sentence context opts?] …] :remove [handle …]}, the shape edit takes — storing nothing.

`check` over a whole `edit` batch — `{:add [[sentence context opts?] …] :remove [handle
…]}`, the shape `edit` takes — storing nothing.
sourceraw docstring

clear-cachesclj

(clear-caches conn)
(clear-caches conn opts)

Drop every cache that offers a clear, and say what went: {:cleared [{:cache :label :entries}…] :entries total}.

Drop every cache that offers a clear, and say what went: `{:cleared [{:cache :label
:entries}…] :entries total}`.
sourceraw docstring

clientclj

(client host port)
(client host port opts)

A connection handle to a daemon at host:port (opts: :timeout-ms, default 30000; :token, the bearer token every call presents — VAELII_API_TOKEN when the key is absent, and an explicit nil to send no Authorization header at all). Holds a reusable HttpClient; no network happens until a call.

A connection handle to a daemon at `host`:`port` (opts: `:timeout-ms`, default
30000; `:token`, the bearer token every call presents — `VAELII_API_TOKEN` when the
key is absent, and an explicit nil to send no `Authorization` header at all).  Holds
a reusable `HttpClient`; no network happens until a call.
sourceraw docstring

compare-tacticiansclj

(compare-tacticians conn goal)
(compare-tacticians conn goal context)
(compare-tacticians conn goal context opts)

Run goal in context under several tacticians — the node engine's search orderings — each to completion, and return one row per tactician: the search it ran, its wall-clock, and its answer set.

Run `goal` in `context` under several **tacticians** — the node engine's search
orderings — each to completion, and return one row per tactician: the search it ran, its
wall-clock, and its answer set.
sourceraw docstring

conflictsclj

(conflicts conn)

The KB's current conflicts.

The KB's current conflicts.
sourceraw docstring

context-downclj

(context-down conn c)

The contexts that inherit from c, reflexively — c plus every context that sees it.

The contexts that inherit from `c`, reflexively — `c` plus every context that sees it.
sourceraw docstring

context-upclj

(context-up conn c)

The contexts c inherits from, reflexively — c plus everything it sees via genlCx.

The contexts `c` inherits from, reflexively — `c` plus everything it *sees* via
`genlCx`.
sourceraw docstring

contextsclj

(contexts conn)

Every context the KB holds.

Every context the KB holds.
sourceraw docstring

contexts-ofclj

(contexts-of conn sentence)

The contexts in which sentence is asserted.

The contexts in which `sentence` is asserted.
sourceraw docstring

contradictionsclj

(contradictions conn)

The coexisting P/¬P dilemmas.

The coexisting P/¬P dilemmas.
sourceraw docstring

count-in-contextclj

(count-in-context conn context)

How many sentexes are stored in context — one set-size read, O(1), nothing fetched.

How many sentexes are **stored** in `context` — one set-size read, O(1), nothing
fetched.
sourceraw docstring

count-with-argclj

(count-with-arg conn pos term)

How many fact sentexes hold term at argument position pos, as stored — cheap, one O(1) set-size read per predicate declaring an argument at that slot.

How many fact sentexes hold `term` at argument position `pos`, as **stored** — cheap,
one O(1) set-size read per predicate declaring an argument at that slot.
sourceraw docstring

count-with-functorclj

(count-with-functor conn pred)

How many fact sentexes with functor pred are stored — one set-size read, O(1).

How many fact sentexes with functor `pred` are **stored** — one set-size read, O(1).
sourceraw docstring

defeat-classclj

(defeat-class conn handle)

The current defeat-class of a believed handle (:monotonic / :default), or nil when it is OUT — the effective strength of the belief after settling.

The current defeat-class of a believed handle (:monotonic / :default), or nil when it is
OUT — the effective strength of the belief after settling.
sourceraw docstring

dependent-justificationsclj

(dependent-justifications conn handle)

Justifications that use handle as an antecedent — what rests on it, which is what an impact analysis before a retract! asks for.

Justifications that use `handle` as an antecedent — what rests on it, which is what an
impact analysis before a `retract!` asks for.
sourceraw docstring

deprecated?clj

(deprecated? conn term)
(deprecated? conn term context)

Did a believed rewriteOf name term the dispreferred side? False for a sameAs or equals member: those merge without retiring either name.

Did a believed `rewriteOf` name `term` the dispreferred side? False for a `sameAs` or
`equals` member: those merge without retiring either name.
sourceraw docstring

describeclj

(describe conn term)
(describe conn term context)
(describe conn term context opts)

Everything the KB holds about one term, as one map, keyed by the term's own role (term-role) — the read behind "what can I ask about X?".

Everything the KB holds about one term, as one map, keyed by the term's own role
(`term-role`) — the read behind "what can I ask about `X`?".
sourceraw docstring

disjoint-metatypesclj

(disjoint-metatypes conn)

The declared disjoint metatypes — each a type whose member types are pairwise disjoint by (disjointMetatype M).

The declared disjoint metatypes — each a type whose member types are pairwise disjoint
by `(disjointMetatype M)`.
sourceraw docstring

disjoint?clj

(disjoint? conn a b)
(disjoint? conn a b context)

Are types a and b provably disjoint (via disjoint declarations, closed under genl)? With a context, only declarations and genl edges visible from it count — the vantage every definitional check now judges from.

Are types `a` and `b` provably disjoint (via disjoint declarations, closed under genl)?
With a `context`, only declarations and genl edges visible from it count — the vantage
every definitional check now judges from.
sourceraw docstring

edit!clj

(edit! conn batch)

Apply a batch of assertions and retractions in one settle.

Apply a batch of assertions and retractions in **one settle**.
sourceraw docstring

edit-with-consequences!clj

(edit-with-consequences! conn batch)
(edit-with-consequences! conn batch opts)

edit, plus what the batch turned out to mean — the belief it added and the belief it took away, in preview's entry shapes.

`edit`, plus what the batch turned out to **mean** — the belief it added and the belief
it took away, in `preview`'s entry shapes.
sourceraw docstring

equiv-classclj

(equiv-class conn term)
(equiv-class conn term context)

Every term known equal to term, itself included.

Every term known equal to `term`, itself included.
sourceraw docstring

escalateclj

(escalate conn goal)
(escalate conn goal context)
(escalate conn goal context floor)

The cheapest level that answers goal — climb the stack from floor and stop at the first level with results.

The cheapest level that answers `goal` — climb the stack from `floor` and stop at the
first level with results.
sourceraw docstring

explain-levelsclj

(explain-levels conn goal)
(explain-levels conn goal context)

What every level yields for goal: a seq of {:level :name :count}.

What every level yields for `goal`: a seq of {:level :name :count}.
sourceraw docstring

export!clj

(export! conn dir)
(export! conn dir opts)

Write kb out as a portable export dump in dir and return a summary:

Write `kb` out as a portable **export dump** in `dir` and return a summary:
sourceraw docstring

exposed-clashesclj

(exposed-clashes conn)

Every disjointness clash the KB currently makes jointly visible: a term holding two types some context can see as disjoint, where each membership was admissible where it was written.

Every disjointness clash the KB currently makes jointly visible: a term holding two
types some context can see as disjoint, where each membership was admissible where it
was written.
sourceraw docstring

find-sentexesclj

(find-sentexes conn term)

Every sentex containing term.

Every sentex containing `term`.
sourceraw docstring

find-termsclj

(find-terms conn q)
(find-terms conn q opts)

The vocabulary terms whose name matches q, sorted by name.

The vocabulary terms whose name matches `q`, sorted by name.
sourceraw docstring

forward-chainclj

(forward-chain conn)
(forward-chain conn opts)

Run forward chaining to a fixpoint over every believed sentex, then settle belief (resolve contradictions).

Run forward chaining to a fixpoint over every believed sentex, then settle belief
(resolve contradictions).
sourceraw docstring

genl?clj

(genl? conn sub super)
(genl? conn sub super context)

Is sub a (reflexive-transitive) subtype of super? Types, not individuals — for an individual's type membership use isa?.

Is `sub` a (reflexive-transitive) subtype of `super`? Types, not individuals — for an
individual's type membership use `isa?`.
sourceraw docstring

genlsclj

(genls conn t)
(genls conn t context)

The types t is a subtype of, transitively. With a context, only the genl edges visible from it count.

The types `t` is a subtype of, transitively.  With a `context`, only the `genl` edges
visible from it count.
sourceraw docstring

handle-ofclj

(handle-of conn sentence context)

The handle for sentence in context, or nil.

The handle for `sentence` in `context`, or nil.
sourceraw docstring

handlesclj

(handles conn)

Every live sentex handle in the KB — premises and anything forward-derived alike, read straight off the record store.

Every live sentex handle in the KB — premises and anything forward-derived alike, read
straight off the record store.
sourceraw docstring

has-prop?clj

(has-prop? conn kind pred)
(has-prop? conn kind pred context)

Does pred carry the metadata property kind — one of :transitive, :symmetric, :asymmetric, :reflexive, :functional, :decontextualized, :forced-decontextualized, :abducible, :reifiable, :unreifiable? Declared by the corresponding sentex, e.g. (symmetric siblingOf).

Does `pred` carry the metadata property `kind` — one of `:transitive`, `:symmetric`,
`:asymmetric`, `:reflexive`, `:functional`, `:decontextualized`,
`:forced-decontextualized`, `:abducible`, `:reifiable`, `:unreifiable`? Declared by the
corresponding sentex, e.g. `(symmetric siblingOf)`.
sourceraw docstring

healthclj

(health conn)

The daemon's liveness reply, {:ok true} — a GET, so it needs no op.

The daemon's liveness reply, `{:ok true}` — a GET, so it needs no op.
sourceraw docstring

in?clj

(in? conn handle)

Whether the sentex handle names is raw JTMS IN.

Whether the sentex `handle` names is raw JTMS IN.
sourceraw docstring

inverse-ofclj

(inverse-of conn pred)
(inverse-of conn pred context)

The predicate declared inverse to pred by an (inverse P Q) sentex, or nil.

The predicate declared inverse to `pred` by an `(inverse P Q)` sentex, or nil.
sourceraw docstring

isa?clj

(isa? conn x t)
(isa? conn x t context)

Whether individual x is of type t, through the genl closure.

Whether individual `x` is of type `t`, through the `genl` closure.
sourceraw docstring

justificationclj

(justification conn jid)

The justification for an id, or nil — nil in, nil out; a non-id is refused (:bad-handle).

The justification for an id, or nil — nil in, nil out; a non-id is refused
(`:bad-handle`).
sourceraw docstring

kb-diffclj

(kb-diff conn b)

What two KBs disagree about, as content: {:added :removed :moved :belief-changed}.

What two KBs disagree about, as content: `{:added :removed :moved :belief-changed}`.
sourceraw docstring

kb-qualityclj

(kb-quality conn)
(kb-quality conn opts)

Seven readings about the knowledge — one map, seven keys, each a distribution rather than a number:

Seven readings about the **knowledge** — one map, seven keys, each a distribution rather
than a number:
sourceraw docstring

levelsclj

(levels conn)

The stack as data: {:level :name :below :adds} per level.

The stack as data: {:level :name :below :adds} per level.
sourceraw docstring

lookupclj

(lookup conn level goal)
(lookup conn level goal context)

Answer goal in context using exactly the machinery of level:

Answer `goal` in `context` using exactly the machinery of `level`:
sourceraw docstring

metatype-membersclj

(metatype-members conn m)

The member types of disjoint metatype m — the set whose every pair disjoint? holds of, closed under genl.

The member types of disjoint metatype `m` — the set whose every pair `disjoint?` holds
of, closed under genl.
sourceraw docstring

pollclj

(poll conn token cursor)
(poll conn token cursor opts)

Read a subscription forward from cursor{:events [...] :cursor n :lagged k}. Each event is {:believed-added [...] :believed-removed [...]} in preview's entry shapes, one per settle, oldest first.

opts is {:wait-ms n}: the daemon holds the request open that long waiting for the first event, and this client extends its read timeout to cover it.

:lagged is on every reply and is the one field a caller must read. Non-zero, the daemon's ring dropped that many events before this poll reached them, and the caller is behind rather than current — re-read what it cares about rather than trusting the events it did get to be the whole story.

Read a subscription forward from `cursor` — `{:events [...] :cursor n :lagged k}`.
Each event is `{:believed-added [...] :believed-removed [...]}` in `preview`'s entry
shapes, one per settle, oldest first.

`opts` is `{:wait-ms n}`: the daemon holds the request open that long waiting for the
first event, and this client extends its read timeout to cover it.

**`:lagged` is on every reply and is the one field a caller must read.**  Non-zero, the
daemon's ring dropped that many events before this poll reached them, and the caller is
behind rather than current — re-read what it cares about rather than trusting the
events it did get to be the whole story.
sourceraw docstring

possible-relationsclj

(possible-relations conn calculus context a b)

The base relations calculus still allows between a and b, given everything believed in context — the set ask checks a goal against, exposed directly.

The base relations `calculus` still allows between `a` and `b`, given everything
believed in `context` — the set `ask` checks a goal against, exposed directly.
sourceraw docstring

premise?clj

(premise? conn handle)

Is the sentex at handle a premise — asserted in its own right rather than derived? A premise rests on nothing, so no justification names it as a conclusion and retracting its supports cannot take it OUT; a derived sentex is the other case, and supporting-justifications is what shows why.

Is the sentex at `handle` a **premise** — asserted in its own right rather than derived?
A premise rests on nothing, so no justification names it as a conclusion and retracting
its supports cannot take it OUT; a derived sentex is the other case, and
`supporting-justifications` is what shows why.
sourceraw docstring

previewclj

(preview conn batch)
(preview conn batch opts)

What would this batch do to the KB — without leaving it done.

What would this batch do to the KB — **without** leaving it done.
sourceraw docstring

propsclj

(props conn kind)

The set of predicates carrying metadata property kind (see has-prop?).

The set of predicates carrying metadata property `kind` (see `has-prop?`).
sourceraw docstring

provable?clj

(provable? conn goal)
(provable? conn goal context)
(provable? conn goal context opts)

Whether goal is provable. Same opts as prove.

Whether `goal` is provable.  Same `opts` as `prove`.
sourceraw docstring

proveclj

(prove conn goal)
(prove conn goal context)
(prove conn goal context opts)

A proof tree for goal, as data. opts is vaelii.core/prove's bound — {:max-ms n :max-depth n}, both held under the daemon's ceilings.

A proof tree for `goal`, as data.  `opts` is `vaelii.core/prove`'s bound —
`{:max-ms n :max-depth n}`, both held under the daemon's ceilings.
sourceraw docstring

prove-withinclj

(prove-within conn goal budget)
(prove-within conn goal context budget)

Anytime prove: run the depth-first backward chainer over goal (a sentence or a conjunction vector, as prove) in context, bounded by budget — a map of any of {:max-ms n :max-results n :max-depth n :max-term-growth n}.

Anytime `prove`: run the depth-first backward chainer over `goal` (a sentence or a
conjunction vector, as `prove`) in `context`, bounded by `budget` — a map of any of
`{:max-ms n :max-results n :max-depth n :max-term-growth n}`.
sourceraw docstring

provenanceclj

(provenance conn handle)

The provenance map recorded for handle{:creator … :created … …} — or nil if none.

The provenance map recorded for `handle` — `{:creator … :created … …}` — or nil if none.
sourceraw docstring

qualitative-networkclj

(qualitative-network conn calculus context)

The constraint network calculus computes over everything believed and visible in context: every pair of terms its predicates relate, tightened by path consistency to the base relations still possible between them.

The constraint network `calculus` computes over everything **believed and visible** in
`context`: every pair of terms its predicates relate, tightened by path consistency to
the base relations still possible between them.
sourceraw docstring

qualitative-scenarioclj

(qualitative-scenario conn calculus context)

One concrete arrangement consistent with everything believed in context{[a b] → relation}, one base relation per pair — or nil when the believed facts are unsatisfiable.

One concrete arrangement consistent with everything believed in `context` — `{[a b] →
relation}`, one base relation per pair — or nil when the believed facts are
unsatisfiable.
sourceraw docstring

qualitative-scenariosclj

(qualitative-scenarios conn calculus context limit)

Up to limit distinct arrangements, as qualitative-scenario renders one.

Up to `limit` distinct arrangements, as `qualitative-scenario` renders one.
sourceraw docstring

quality-reportclj

(quality-report conn quality)

A kb-quality map as Markdown — the counts first and the capped lists after.

A `kb-quality` map as Markdown — the counts first and the capped lists after.
sourceraw docstring

queryclj

(query conn goal)
(query conn goal context)
(query conn goal context opts)

Solutions for goal as binding maps — ({?x Muffet}).

Solutions for `goal` as binding maps — `({?x Muffet})`.
sourceraw docstring

query-planclj

(query-plan conn goal)
(query-plan conn goal context)

How a goal would be answered, at whichever of the two scales the goal has.

How a goal would be answered, at whichever of the two scales the goal has.
sourceraw docstring

query?clj

(query? conn goal)
(query? conn goal context)
(query? conn goal context opts)

Is goal answerable under opts? query, asked for one answer.

Is `goal` answerable under `opts`? `query`, asked for one answer.
sourceraw docstring

readable-sentenceclj

(readable-sentence conn sx)

A sentex's sentence with the author's variable names restored — pass a sentex map (from sentex / sentexes-matching).

A sentex's sentence with the author's variable names restored — pass a sentex map (from
`sentex` / `sentexes-matching`).
sourceraw docstring

representativeclj

(representative conn term)
(representative conn term context)

The term standing for term's equivalence class — term itself when nothing has merged it, so this is total and never nil.

The term standing for `term`'s equivalence class — `term` itself when nothing has merged
it, so this is total and never nil.
sourceraw docstring

retract!clj

(retract! conn handle)

Retract the sentex handle names, tearing down what it solely supported.

Retract the sentex `handle` names, tearing down what it solely supported.
sourceraw docstring

same-class?clj

(same-class? conn a b)
(same-class? conn a b context)

Do a and b denote the same thing? The complement of a provable (different a b): distinct symbols denote distinct individuals until an equality sentex says otherwise.

Do `a` and `b` denote the same thing? The complement of a provable `(different a b)`:
distinct symbols denote distinct individuals until an equality sentex says otherwise.
sourceraw docstring

search-treeclj

(search-tree conn goal)
(search-tree conn goal context)
(search-tree conn goal context opts)

The backward search for goal in context, as data — every node the frontier reached, not only the path that answered.

The backward search for `goal` in `context`, as data — every node the frontier reached,
not only the path that answered.
sourceraw docstring

sees?clj

(sees? conn k y)

Does context k see assertions made in context y? True iff y is in k's genlCx up-closure (reflexively, so a context sees itself).

Does context `k` see assertions made in context `y`? True iff `y` is in `k`'s genlCx
up-closure (reflexively, so a context sees itself).
sourceraw docstring

sentexclj

(sentex conn handle)

The sentex handle names, as a map.

The sentex `handle` names, as a map.
sourceraw docstring

sentex-countclj

(sentex-count conn)

How many sentexes the KB holds, in total — the count the count-aware trie keeps at its root, so O(1) and nothing fetched.

How many sentexes the KB holds, in total — the count the count-aware trie keeps at its
root, so O(1) and nothing fetched.
sourceraw docstring

sentexes-in-contextclj

(sentexes-in-context conn context)
(sentexes-in-context conn context opts)

Every stored sentex asserted in context (its extent, rules included) — a defeated or unsupported one included.

Every **stored** sentex asserted in `context` (its extent, rules included) — a defeated
or unsupported one included.
sourceraw docstring

sentexes-matchingclj

(sentexes-matching conn sentence)
(sentexes-matching conn sentence context)

The believed sentexes matching sentence (a pattern may carry ?vars), as maps.

The believed sentexes matching `sentence` (a pattern may carry `?vars`), as maps.
sourceraw docstring

sentexes-with-argclj

(sentexes-with-arg conn pos term)
(sentexes-with-arg conn pos term opts)

Every stored fact sentex holding term at 1-based argument position pos — a defeated or unsupported one included.

Every **stored** fact sentex holding `term` at 1-based argument position `pos` — a
defeated or unsupported one included.
sourceraw docstring

sentexes-with-functorclj

(sentexes-with-functor conn pred)
(sentexes-with-functor conn pred opts)

Every stored fact sentex whose functor is pred, any arity, either polarity — a defeated or unsupported one included.

Every **stored** fact sentex whose functor is `pred`, any arity, either polarity — a
defeated or unsupported one included.
sourceraw docstring

settle-statsclj

(settle-stats conn)

Instrumentation for the exceptWhen fixpoint in settle.

Instrumentation for the `exceptWhen` fixpoint in `settle`.
sourceraw docstring

specsclj

(specs conn t)
(specs conn t context)

The types that are subtypes of t, transitively. Scoped by context like genls.

The types that are subtypes of `t`, transitively.  Scoped by `context` like `genls`.
sourceraw docstring

supporting-justificationsclj

(supporting-justifications conn handle)

Justifications that conclude handle (its supporting justifications), in content order — the informant's own sentence, then the antecedent sentences (kb/justification-content-key).

Justifications that conclude `handle` (its supporting justifications), in **content**
order — the informant's own sentence, then the antecedent sentences
(`kb/justification-content-key`).
sourceraw docstring

term-countclj

(term-count conn)

How many distinct terms the KB's vocabulary holds — one set-size read, O(1), nothing fetched.

How many distinct terms the KB's vocabulary holds — one set-size read, O(1), nothing
fetched.
sourceraw docstring

term-expressionclj

(term-expression conn term)

The functional expression a reified term denotes — (FruitFn AppleTree) for the constant minted from it — or nil for an ordinary term, and for a reified one whose (termOfUnit K E) map is not believed.

The functional expression a reified term denotes — `(FruitFn AppleTree)` for the
constant minted from it — or nil for an ordinary term, and for a reified one whose
`(termOfUnit K E)` map is not believed.
sourceraw docstring

termsclj

(terms conn)

Every term the index is keyed by — the KB's vocabulary: each predicate, individual, type, and context name mentioned by a stored sentex, at any nesting depth.

Every term the index is keyed by — the KB's vocabulary: each predicate, individual,
type, and context name mentioned by a stored sentex, at any nesting depth.
sourceraw docstring

typesclj

(types conn)

Every type currently in the genl hierarchy — the nodes of the closure, i.e. every type named by some believed genl edge.

Every type currently in the genl hierarchy — the nodes of the closure, i.e. every type
named by some believed `genl` edge.
sourceraw docstring

types-ofclj

(types-of conn x)
(types-of conn x context)

The types individual x belongs to.

The types individual `x` belongs to.
sourceraw docstring

unwatchclj

(unwatch conn token)

Drop subscription token; true if there was one. Idempotent.

Drop subscription `token`; true if there was one.  Idempotent.
sourceraw docstring

violationsclj

(violations conn)

The recorded definitional violations.

The recorded definitional violations.
sourceraw docstring

vocabulary-auditclj

(vocabulary-audit conn)

Every term CxCore declares in kb, classified — {:enforced [[term why] …] :inert [[term why] …] :unclassified [term …] :retired [term …] :contradicted [term …]}.

Every term `CxCore` declares in `kb`, classified — `{:enforced [[term why] …] :inert
[[term why] …] :unclassified [term …] :retired [term …] :contradicted [term …]}`.
sourceraw docstring

watchclj

(watch conn)
(watch conn goal context)

Open a change-feed subscription and return {:token t :cursor 0 :max-events n}.

In process vaelii.core/watch takes a callback; a callback does not cross an EDN wire, so what a remote caller holds is a subscription the daemon keeps and this client reads forward with a cursor. With no goal it is every belief change; with one it is the same standing query, and a goal that cannot be answered from a moved region is refused with the same :not-watchable it is refused with in process.

(let [{:keys [token cursor]} (watch conn)]
  (loop [c cursor]
    (let [{:keys [events cursor lagged]} (poll conn token c {:wait-ms 20000})]
      (when (pos? lagged) (resync!))
      (run! render! events)
      (recur cursor))))
Open a change-feed subscription and return `{:token t :cursor 0 :max-events n}`.

In process `vaelii.core/watch` takes a callback; a callback does not cross an EDN
wire, so what a remote caller holds is a subscription the daemon keeps and this client
reads forward with a cursor.  With no goal it is every belief change; with one it is
the same standing query, and a goal that cannot be answered from a moved region is
refused with the same `:not-watchable` it is refused with in process.

    (let [{:keys [token cursor]} (watch conn)]
      (loop [c cursor]
        (let [{:keys [events cursor lagged]} (poll conn token c {:wait-ms 20000})]
          (when (pos? lagged) (resync!))
          (run! render! events)
          (recur cursor))))
sourceraw docstring

watchersclj

(watchers conn)

What the daemon is holding open: one entry per subscription with its goal, how many events it has been :delivered, and how many are still :pending on its ring. Neither is the reader's own position — that lives here, not there.

What the daemon is holding open: one entry per subscription with its goal, how many
events it has been `:delivered`, and how many are still `:pending` on its ring.  Neither
is the reader's own position — that lives here, not there.
sourceraw docstring

whyclj

(why conn handle)
(why conn handle opts)

Why the sentex handle names is believed — its supporting justifications, as data. opts is core/why's {:max-depth n}, which is how a {:truncated? true} branch is re-asked whole.

Why the sentex `handle` names is believed — its supporting justifications, as data.
`opts` is `core/why`'s `{:max-depth n}`, which is how a `{:truncated? true}` branch is
re-asked whole.
sourceraw docstring

why-notclj

(why-not conn handle)
(why-not conn sentence context)
(why-not conn sentence context opts)

Why a sentence is not believed, by handle or by sentence and context; opts takes {:nearest n} to name the rule that came closest and what it is missing.

Why a sentence is *not* believed, by handle or by sentence and context; `opts` takes
`{:nearest n}` to name the rule that came closest and what it is missing.
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