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.

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.

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.

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.
raw docstring

askclj

(ask conn goal)
(ask conn goal context)

The first solution for goal, or nil.

The first solution for `goal`, or nil.
sourceraw docstring

ask?clj

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

Whether goal has any solution.

Whether `goal` has any solution.
sourceraw docstring

assertclj

(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.

Assert `sentence` in `context` (optional `opts`) — returns the handle(s).  Bare —
no `!` — for `vaelii.core/assert`'s reason: additive, and `retract!` takes it back.
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 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.

Assert a rule from `antecedents` to `consequent` in `context` — returns the
handle(s); a conjunctive consequent yields one handle per conjunct.
sourceraw docstring

callclj

(call conn op args)

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/ops is the reachable set.

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/ops` is the reachable set.
sourceraw docstring

clientclj

(client host port)
(client host port opts)

A connection handle to a daemon at host:port (opts: :timeout-ms, default 30000). Holds a reusable HttpClient; no network happens until a call.

A connection handle to a daemon at `host`:`port` (opts: `:timeout-ms`, default
30000).  Holds a reusable `HttpClient`; no network happens until a call.
sourceraw docstring

conflictsclj

(conflicts conn)

The KB's current conflicts.

The KB's current conflicts.
sourceraw docstring

contextsclj

(contexts conn)

Every context the KB holds.

Every context the KB holds.
sourceraw docstring

contradictionsclj

(contradictions conn)

The coexisting P/¬P dilemmas.

The coexisting P/¬P dilemmas.
sourceraw docstring

find-sentexesclj

(find-sentexes conn term)

Every sentex containing term.

Every sentex containing `term`.
sourceraw docstring

genlsclj

(genls conn t)

The types t is a subtype of, transitively.

The types `t` is a subtype of, transitively.
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

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 currently believed.

Whether the sentex `handle` names is currently believed.
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

provable?clj

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

Whether goal is provable.

Whether `goal` is provable.
sourceraw docstring

proveclj

(prove conn goal)
(prove conn goal context)

A proof tree for goal, as data.

A proof tree for `goal`, as data.
sourceraw docstring

queryclj

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

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

Solutions for `goal` as binding maps — `({?x Fido})`.
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

sentexclj

(sentex conn handle)

The sentex handle names, as a map.

The sentex `handle` names, as a map.
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

specsclj

(specs conn t)

The types that are subtypes of t, transitively.

The types that are subtypes of `t`, transitively.
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

violationsclj

(violations conn)

The recorded definitional violations.

The recorded definitional violations.
sourceraw docstring

whyclj

(why conn handle)

Why the sentex handle names is believed — its supporting justifications, as data.

Why the sentex `handle` names is believed — its supporting justifications, as data.
sourceraw docstring

why-notclj

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

Why a sentence is not believed, by handle or by sentence and context.

Why a sentence is *not* believed, by handle or by sentence and context.
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