Liking cljdoc? Tell your friends :D

vaelii.impl.asp.solve-context

(do/label Base Into [mode]) and (do/classify Into): ground the assumptionRules, solve rules and constraint rules visible from a base context into a Program, solve it, and write each optimal answer set as an inert labeling context under the base; then aggregate brave/cautious over those contexts. answer-sets reads the program as ASP does. Labeling and classification extents are inert, the placement edge is :monotonic, and the grounding is not stored. See docs/solving.md.

`(do/label Base Into [mode])` and `(do/classify Into)`: ground the `assumptionRule`s,
solve rules and constraint rules visible from a base context into a `Program`, solve it,
and write each optimal answer set as an inert labeling context under the base; then
aggregate brave/cautious over those contexts.  `answer-sets` reads the program as ASP
does.  Labeling and classification extents are inert, the placement edge is `:monotonic`,
and the grounding is not stored.  See docs/solving.md.
raw docstring

answer-set-readingsclj

Each :reading answer-sets takes, with the options it reads beside search-options.

Each `:reading` `answer-sets` takes, with the options it reads beside `search-options`.
sourceraw docstring

answer-setsclj

(answer-sets kb base)
(answer-sets kb base opts)

Ground the program in base (build) and solve it with no keep-belief and no tiebreak objective, writing nothing. opts' :reading is :all (the default), :one, :brave or :cautious; answer-set-readings and search-options give the options each reads. Returns {:status :costs :choices :derived :ground-ms :solve-ms} with :answer-sets [#{atom} …] and :answer-set-costs, or with :consequences #{atom}. :status is the solve's, or :no-choices / :no-backend. Refusal: check-options!'s. See docs/solving.md, "The ASP reading of a program".

Ground the program in `base` (`build`) and solve it with no keep-belief and no tiebreak
objective, writing nothing.  `opts`' `:reading` is `:all` (the default), `:one`, `:brave`
or `:cautious`; `answer-set-readings` and `search-options` give the options each reads.
Returns `{:status :costs :choices :derived :ground-ms :solve-ms}` with `:answer-sets
[#{atom} …]` and `:answer-set-costs`, or with `:consequences #{atom}`.  `:status` is the
solve's, or `:no-choices` / `:no-backend`.  Refusal: `check-options!`'s.  See
docs/solving.md, "The ASP reading of a program".
sourceraw docstring

check-options!clj

(check-options! opts ks)

Refuse a non-map opts, a key outside ks, and a value outside its option's domain: :unknown-option, :mismatch :not-a-map, :unknown-key or :bad-value.

Refuse a non-map `opts`, a key outside `ks`, and a value outside its option's domain:
`:unknown-option`, `:mismatch` `:not-a-map`, `:unknown-key` or `:bad-value`.
sourceraw docstring

classifyclj

(classify kb into-cx)

do/classify: aggregate the labelings a prior (do/label _ Into) wrote and write (forced H) (true in every labeling), (excluded H) (false in every one) or (supportable H) per head, with its classificationOf marker, into <Into>Class, replacing the previous classification. Refuses :labeling-run-blocked when class-blocked finds anything. Returns {:into :class-context :count :forced [..] :supportable [..] :excluded [..]}, or :count 0 :reason :no-labelings. See docs/solving.md, "(do/classify Into)".

`do/classify`: aggregate the labelings a prior `(do/label _ Into)` wrote and write
`(forced H)` (true in every labeling), `(excluded H)` (false in every one) or
`(supportable H)` per head, with its `classificationOf` marker, into `<Into>Class`,
replacing the previous classification.  Refuses `:labeling-run-blocked` when
`class-blocked` finds anything.  Returns `{:into :class-context :count :forced [..]
:supportable [..] :excluded [..]}`, or `:count 0 :reason :no-labelings`.  See
docs/solving.md, "`(do/classify Into)`".
sourceraw docstring

labelclj

(label kb base into-cx)
(label kb base into-cx mode)

do/label: ground and solve the program build makes in base. mode is :all (the default), :one or :sat:

  • :all writes each optimal answer set as an inert labeling context <Into><i> under base, holding (head) per true atom, (not head) per false one and its labelingOf marker, after clearing the previous run (clear-run!);
  • :one returns one optimal answer set and writes nothing;
  • :sat is :one without the keep-belief objective.

An :all run refuses :labeling-run-blocked before grounding when the previous run cannot be replaced (blocked-artifacts). A run grounding no choice clears too; a run with no backend leaves the previous run standing.

Returns {:base :into :choices [..] :derived [..] :labelings [{:context :true [..] :false [..]}] :count n :unenumerated [..] :unenumerated-in-guards [..] :ground-ms :translate-ms :solve-ms}, :context nil under :one / :sat, :best-effort? true when a stopped solve held a model. :unenumerated names each transitive predicate the grounding read with both arguments open (provers/*unenumerated*). :count 0 carries a :reason: :no-choices, :no-backend, or :unsatisfiable under :one / :sat. See docs/solving.md, "(do/label Base Into [mode])".

`do/label`: ground and solve the program `build` makes in `base`.  `mode` is `:all`
(the default), `:one` or `:sat`:

  * `:all` writes each optimal answer set as an inert labeling context `<Into><i>`
    under `base`, holding `(head)` per true atom, `(not head)` per false one and its
    `labelingOf` marker, after clearing the previous run (`clear-run!`);
  * `:one` returns one optimal answer set and writes nothing;
  * `:sat` is `:one` without the keep-belief objective.

An `:all` run refuses `:labeling-run-blocked` before grounding when the previous run
cannot be replaced (`blocked-artifacts`).  A run grounding no choice clears too; a run
with no backend leaves the previous run standing.

Returns `{:base :into :choices [..] :derived [..] :labelings [{:context :true [..]
:false [..]}] :count n :unenumerated [..] :unenumerated-in-guards [..] :ground-ms
:translate-ms :solve-ms}`, `:context` nil under `:one` / `:sat`, `:best-effort? true`
when a stopped solve held a model.  `:unenumerated` names each transitive predicate the
grounding read with both arguments open (`provers/*unenumerated*`).  `:count 0`
carries a `:reason`: `:no-choices`, `:no-backend`, or `:unsatisfiable` under `:one` /
`:sat`.  See docs/solving.md, "`(do/label Base Into [mode])`".
sourceraw docstring

search-optionsclj

The options every reading of answer-sets reads: the search's strategy and bounds.

The options every reading of `answer-sets` reads: the search's strategy and bounds.
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