Liking cljdoc? Tell your friends :D

vaelii.impl.asp.atoms

The atom id table asp.edge/translate builds. Two kinds of value are interned under one counter, so ids are unique across kinds and start at 1 (0 is the ASPIF terminator):

  • a sentex id, an atom the solver decides, labelled s<sentex-id>;
  • a contradiction descriptor (contradiction <head> :involved [[:sentex h] …]), a violation atom the minimize statement weighs, labelled c<atom-id>.

A witness reports labels, and each label maps back to its value. The table is an atom over a map, and interning is idempotent.

The atom id table `asp.edge/translate` builds.  Two kinds of value are interned under
one counter, so ids are unique across kinds and start at 1 (0 is the ASPIF terminator):

  * a sentex id, an atom the solver decides, labelled `s<sentex-id>`;
  * a contradiction descriptor `(contradiction <head> :involved [[:sentex h] …])`, a
    violation atom the minimize statement weighs, labelled `c<atom-id>`.

A witness reports labels, and each label maps back to its value.  The table is an atom
over a map, and interning is idempotent.
raw docstring

atom-of-labelclj

(atom-of-label table label)

Reverse: given a label string (from a clasp witness), return the atom id, or nil if the label is unknown.

Reverse: given a label string (from a clasp witness), return the
atom id, or nil if the label is unknown.
sourceraw docstring

atom-of-sentexclj

(atom-of-sentex table sentex-id)

Atom id for sentex-id, or nil if not yet interned.

Atom id for `sentex-id`, or nil if not yet interned.
sourceraw docstring

intern-contradiction!clj

(intern-contradiction! table descriptor)

Ensure descriptor has an atom id. descriptor is the nested sentence-shaped value (contradiction <head> :involved [[:sentex H1] [:sentex H2] …]) so consumers can introspect a witness's contradiction atoms without secondary queries.

Ensure `descriptor` has an atom id. `descriptor` is the nested
sentence-shaped value
  (contradiction <head> :involved [[:sentex H1] [:sentex H2] …])
so consumers can introspect a witness's contradiction atoms without
secondary queries.
sourceraw docstring

intern-sentex!clj

(intern-sentex! table sentex-id)

Ensure the sentex with id sentex-id has an atom id. Returns the atom id. Idempotent. Callers that have a sentex record should pass (sentex/id sentex).

Ensure the sentex with id `sentex-id` has an atom id. Returns the
atom id. Idempotent. Callers that have a sentex record should pass
`(sentex/id sentex)`.
sourceraw docstring

label-of-atomclj

(label-of-atom table atom-id)

Label string for atom-id, or nil.

Label string for `atom-id`, or nil.
sourceraw docstring

new-tableclj

(new-table)

Return a fresh empty atom table.

Return a fresh empty atom table.
sourceraw docstring

sentex-id-of-atomclj

(sentex-id-of-atom table atom-id)

The sentex id backing atom-id, or nil if the atom is not sentex-backed.

The sentex id backing `atom-id`, or nil if the atom is not sentex-backed.
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