Liking cljdoc? Tell your friends :D

vaelii.impl.asp.clasp

Subprocess wrapper around the clasp ASP solver.

Takes ASPIF text on stdin and reads the JSON Result of --outf=2. clasp's exit codes encode the solve outcome (10 sat, 20 unsat, 30 optimum) and are not errors; a run throws only when clasp does not run or answers nothing parseable. The five modes are solve's. The search flags are search-args, and the limits are docs/asp.md's "The solve limit" and "The time limit".

run-clasp owns the process: it returns only after the process has exited, and kills it with every descendant at the deadline and on a throw out of the wait.

Subprocess wrapper around the clasp ASP solver.

Takes ASPIF text on stdin and reads the JSON `Result` of `--outf=2`.  clasp's exit
codes encode the solve outcome (10 sat, 20 unsat, 30 optimum) and are not errors; a
run throws only when clasp does not run or answers nothing parseable.  The five modes
are `solve`'s.  The search flags are `search-args`, and the limits are docs/asp.md's
"The solve limit" and "The time limit".

`run-clasp` owns the process: it returns only after the process has exited, and kills
it with every descendant at the deadline and on a throw out of the wait.
raw docstring

*clasp-binary*clj

Name (or absolute path) of the clasp executable. Bind to point solve at a non-default install or a test stub.

Name (or absolute path) of the clasp executable. Bind to point
`solve` at a non-default install or a test stub.
sourceraw docstring

available?clj

(available?)

True if the clasp binary runs in the current environment.

True if the clasp binary runs in the current environment.
sourceraw docstring

search-argsclj

(search-args)

The flags under which a solve's search is a function of its program alone: one thread, clasp's own default seed (1) stated rather than assumed, and --solve-limit=N for a positive config/asp-solve-limit. The limit counts conflicts, so it stops a search at the same point on any machine, where --time-limit stops it wherever the machine has got to. In-process clingo's control takes the same flags (vaelii.impl.asp.clingo).

The flags under which a solve's search is a function of its program alone: one
thread, clasp's own default seed (1) stated rather than assumed, and
`--solve-limit=N` for a positive `config/asp-solve-limit`.  The limit counts
conflicts, so it stops a search at the same point on any machine, where
`--time-limit` stops it wherever the machine has got to.  In-process clingo's control
takes the same flags (`vaelii.impl.asp.clingo`).
sourceraw docstring

solveclj

(solve aspif-text mode)

Run clasp on aspif-text in one of the supported modes.

Modes: :label — one minimum-cost witness (for labeling output) :sat — the first witness, for a program with no objective :all-optima — every minimum-cost witness (for inspection) :classify-true — atoms in every minimum-cost witness :classify-supportable — atoms in at least one minimum-cost witness

Returns: :status — :optimum | :sat | :best-effort | :unsat | :interrupted | :unknown :atoms — vector of atom-name strings :cost — optimum cost (nil if no minimize statement or unsat) :witnesses — vector of value vectors (only populated for :all-optima) :raw — full parsed JSON (for diagnostics)

A :label solve of a program with no objective runs under :sat's flags. :interrupted is a search the solve limit, the time limit or a signal stopped; a stopped :label or :sat solve holding a witness is :best-effort instead.

Run clasp on `aspif-text` in one of the supported modes.

Modes:
  :label                — one minimum-cost witness (for labeling output)
  :sat                  — the first witness, for a program with no objective
  :all-optima           — every minimum-cost witness (for inspection)
  :classify-true        — atoms in every minimum-cost witness
  :classify-supportable — atoms in at least one minimum-cost witness

Returns:
  :status    — :optimum | :sat | :best-effort | :unsat | :interrupted | :unknown
  :atoms     — vector of atom-name strings
  :cost      — optimum cost (nil if no minimize statement or unsat)
  :witnesses — vector of value vectors (only populated for :all-optima)
  :raw       — full parsed JSON (for diagnostics)

A `:label` solve of a program with no objective runs under `:sat`'s flags.
`:interrupted` is a search the solve limit, the time limit or a signal stopped; a
stopped `:label` or `:sat` solve holding a witness is `:best-effort` instead.
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