Liking cljdoc? Tell your friends :D

vaelii.impl.solve

The Program builder and the local solver behind vaelii.impl.types.solve/Solver: program builds the Program a labeling hands a solver, content-key orders contested assumptions by what they assert, and local-solver is the deterministic greedy stub. The ASP backend is vaelii.impl.asp.edge/edge-solver. See docs/asp.md and docs/nmtms.md, "Only :default content reaches a solver".

The `Program` builder and the local solver behind `vaelii.impl.types.solve/Solver`:
`program` builds the `Program` a labeling hands a solver, `content-key` orders contested
assumptions by what they assert, and `local-solver` is the deterministic greedy stub.  The
ASP backend is `vaelii.impl.asp.edge/edge-solver`.  See docs/asp.md and docs/nmtms.md,
"Only `:default` content reaches a solver".
raw docstring

content-keyclj

(content-key program handle)

A total order key on program's contested assumptions, read off what each asserts: the sentence, then the context, then the handle for identical content. The print vars are bound off, so an ambient *print-length* cannot elide the key and leave the order to arrival (docs/nmtms.md, "1. Order independence").

A total order key on `program`'s contested assumptions, read off **what each asserts**:
the sentence, then the context, then the handle for identical content.  The print vars
are bound off, so an ambient `*print-length*` cannot elide the key and leave the order
to arrival (docs/nmtms.md, "1. Order independence").
sourceraw docstring

local-solverclj

A deterministic greedy Solver: walk the contradictions highest priority first, then by their members' content-keys, and satisfy each still-unsatisfied one by defeating its contested member with the greatest content-key. A contradiction with no live contested member is reported violated. It does not optimize globally, so two overlapping pairs can cost two defeats where the optimum spends one (docs/asp.md, "The objective").

A deterministic greedy `Solver`: walk the contradictions highest priority first, then
by their members' `content-key`s, and satisfy each still-unsatisfied one by defeating
its contested member with the greatest `content-key`.  A contradiction with no live
contested member is reported violated.  It does not optimize globally, so two
overlapping pairs can cost two defeats where the optimum spends one (docs/asp.md,
"The objective").
sourceraw docstring

nogood-membersclj

(nogood-members ng)

Every handle a nogood involves — its positive members (:nogood, forbidden to hold together) and its negated members (:neg, forbidden to be absent together, e.g. an at-least-one requirement). :neg is optional and usually absent.

Every handle a nogood involves — its positive members (`:nogood`, forbidden to hold
together) and its negated members (`:neg`, forbidden to be *absent* together, e.g. an
at-least-one requirement).  `:neg` is optional and usually absent.
sourceraw docstring

programclj

(program contested nogoods content)
(program contested nogoods content cardinalities)
(program contested nogoods content cardinalities derivations)

Build a solver Program for a set of contested handles and the nogoods among them, keeping only the nogoods with a contested member. Contradiction members that are not contested are fixed: known-true background, assumed and never decided. content maps each contested handle to {:sentence :context}, which content-key orders by.

cardinalities (optional) are the at-most-k / at-least-k bounds solve-context grounds from asp/atMost / asp/atLeast; their members are contested heads.

derivations (optional) are a solve's ground normal rules, [{:head id :pos #{id} :neg #{id}} …]. Every head one derives that is not contested is a :derived atom, neither an assumption nor fixed. This arity also keeps a nogood over derived atoms alone and a hard nogood with no member, which no model satisfies.

Build a solver Program for a set of `contested` handles and the `nogoods` among
them, keeping only the nogoods with a contested member.  Contradiction members that
are not contested are `fixed`: known-true background, assumed and never decided.
`content` maps each contested handle to `{:sentence :context}`, which `content-key`
orders by.

`cardinalities` (optional) are the at-most-`k` / at-least-`k` bounds `solve-context`
grounds from `asp/atMost` / `asp/atLeast`; their members are contested heads.

`derivations` (optional) are a solve's ground normal rules, `[{:head id :pos #{id}
:neg #{id}} …]`.  Every head one derives that is not contested is a `:derived` atom,
neither an assumption nor fixed.  This arity also keeps a nogood over derived atoms
alone and a hard nogood with no member, which no model satisfies.
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