Expand description
Assumption-based Truth Maintenance System (de Kleer’s ATMS).
Beliefs are tracked in terms of the assumptions that support them. An environment is a
set of assumptions (one bit each, ≤64 assumptions → a u64 bitset). A node’s label is the
set of minimal environments under which it holds (no environment in a label is a subset of
another — minimality is what makes an ATMS efficient). A nogood is an inconsistent
environment; every superset of a nogood is also inconsistent. A node is believed in a context
iff the context is consistent and contains one of the node’s supporting environments.
Zero-heap: environments are u64 bitsets; labels live in caller-supplied slices.
Functions§
- env_
subset - Is
suba subset ofsup? (every assumption insubis insup) - holds_
in - Is a node with this
labelbelieved incontext? The context must be consistent (not a superset of any nogood) AND contain one of the node’s supporting environments. - is_
nogood - Is
envinconsistent givennogoods? True iffenvis a superset of any nogood (a nogood’s assumptions are all present, so the contradiction fires). - label_
add - Add
envto a label held inlabel[..n], maintaining minimality: if an existing environment already subsumesenv(existing ⊆ env),envis redundant and is dropped; any existing environments thatenvsubsumes (env ⊆ existing) are removed in favour of the more generalenv. Returns the new label length. Zero-heap (in-place compaction oflabel). - label_
holds - Does some environment in
labelhold undercontext? (ignoring consistency — seeholds_in). True iff any label environment is a subset ofcontext.
Type Aliases§
- Environment
- A set of assumptions — one bit per assumption (≤64). The empty environment
0is the “holds unconditionally” (premise) environment.