Liking cljdoc? Tell your friends :D

vaelii.impl.sign

Sign arithmetic: a quantity is negative, zero or positive, qualitativeSum / qualitativeDifference / qualitativeProduct combine signs, derivativeOf makes a trend the sign of a rate, and greaterInMagnitudeThan resolves the ambiguous sum. The algebra (pure data) comes first, then the KB reading and SignProver, registered with vaelii.core/add-reasoner :sign. See docs/sign.md.

Sign arithmetic: a quantity is negative, zero or positive, `qualitativeSum` /
`qualitativeDifference` / `qualitativeProduct` combine signs, `derivativeOf` makes a
trend the sign of a rate, and `greaterInMagnitudeThan` resolves the ambiguous sum.  The
algebra (pure data) comes first, then the KB reading and `SignProver`, registered with
`vaelii.core/add-reasoner :sign`.  See docs/sign.md.
raw docstring

all-signsclj

The three values a quantity's sign takes, jointly exhaustive and pairwise disjoint.

The three values a quantity's sign takes, jointly exhaustive and pairwise disjoint.
sourceraw docstring

arithmetic-predicatesclj

source

combinedclj

(combined kind sa sb dominant)

The signs the output of kind can take, given its two inputs' possible sets and which input (if either) is the larger in magnitude. kind is the arithmetic predicate the relation was stated with.

The signs the output of `kind` can take, given its two inputs' possible sets and which
input (if either) is the larger in magnitude.  `kind` is the arithmetic predicate the
relation was stated with.
sourceraw docstring

inconsistent-state?clj

(inconsistent-state? state)

Has some quantity been narrowed to no sign at all?

Has some quantity been narrowed to no sign at all?
sourceraw docstring

negatedclj

Each sign under negation: qualitativeDifference reads A − B as A + (−B).

Each sign under negation: `qualitativeDifference` reads A − B as A + (−B).
sourceraw docstring

possible-signsclj

(possible-signs kb context attribute quantity)

The signs attribute (:sign or :trend) may take for quantity in context, and what says so: [#{sign} #{handle}]. [#{} #{}] when the reading is inconsistent; all-signs with no support for a quantity nothing constrains.

The signs `attribute` (`:sign` or `:trend`) may take for `quantity` in `context`, and
what says so: `[#{sign} #{handle}]`.  `[#{} #{}]` when the reading is inconsistent;
`all-signs` with no support for a quantity nothing constrains.
sourceraw docstring

readingclj

(reading kb context)

The resolved sign state visible from context, or :inconsistent when the facts contradict each other. The resolve-state shape, except that a narrowed key's support is a node over the supports it was derived from; possible-signs reads one out as a handle set.

Cached on the KB's :qcn atom and stamped with observe/change-clock, as qcn-kb/read-network is. An inconsistency is reported once per KB, context and state (observe/newly-seen?).

The resolved sign state visible from `context`, or `:inconsistent` when the facts
contradict each other.  The `resolve-state` shape, except that a narrowed key's support
is a node over the supports it was derived from; `possible-signs` reads one out as a
handle set.

Cached on the KB's `:qcn` atom and stamped with `observe/change-clock`, as
`qcn-kb/read-network` is.  An inconsistency is reported once per KB, context and state
(`observe/newly-seen?`).
sourceraw docstring

resolve-stateclj

(resolve-state state cs)

Narrow every constraint's output to the greatest fixpoint.

state is {[attribute quantity] → [#{sign} #{handle}]}, attribute :sign or :trend; an absent key is all-signs with no support. A constraint is {:in [key…] :out key :derive fn :support #{handle}}, :derive mapping the inputs' sets to the output's. The sets reached do not depend on the order of cs; which handles a narrowing names does.

A worklist over cs's positions, applied in passes in cs order: a constraint is re-applied only after a key it reads moved, in the current pass when it stands after the constraint that moved the key and in the next pass otherwise. A constraint whose inputs have not moved cannot move its output, so this applies the narrowings a round-robin over the whole of cs applies, in the same order, and names the same handles, at a cost of the moves rather than of passes × constraints.

Narrow every constraint's output to the greatest fixpoint.

`state` is `{[attribute quantity] → [#{sign} #{handle}]}`, `attribute` `:sign` or
`:trend`; an absent key is `all-signs` with no support.  A constraint is `{:in [key…]
:out key :derive fn :support #{handle}}`, `:derive` mapping the inputs' sets to the
output's.  The sets reached do not depend on the order of `cs`; which handles a
narrowing names does.

A worklist over `cs`'s positions, applied in passes in `cs` order: a constraint is
re-applied only after a key it reads moved, in the current pass when it stands after
the constraint that moved the key and in the next pass otherwise.  A constraint whose
inputs have not moved cannot move its output, so this applies the narrowings a
round-robin over the whole of `cs` applies, in the same order, and names the same
handles, at a cost of the moves rather than of passes × constraints.
sourceraw docstring

sign-of-valueclj

Each sign term the KB states, and the keyword the tables are written over.

Each sign term the KB states, and the keyword the tables are written over.
sourceraw docstring

sign-predicatesclj

The predicates a sign is stated with and the prover answers.

The predicates a sign is stated with and the prover answers.
sourceraw docstring

sign-proverclj

(sign-prover)

The sign-arithmetic prover, to register with vaelii.core/add-prover.

The sign-arithmetic prover, to register with `vaelii.core/add-prover`.
sourceraw docstring

sign-sourcesclj

Every predicate the reading reads (prover-types/SupportingProver).

Every predicate the reading reads (`prover-types/SupportingProver`).
sourceraw docstring

value-of-signclj

source

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