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):
s<sentex-id>;(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.(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.
(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.
(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.
(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)`.
(label-of-atom table atom-id)Label string for atom-id, or nil.
Label string for `atom-id`, or nil.
(new-table)Return a fresh empty atom table.
Return a fresh empty atom table.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |