Skip to main content

Module abductive

Module abductive 

Source
Expand description

Abductive inference — Peirce’s “inference to the best explanation”.

Given observed effects, find the hypotheses that would account for them. This library (split per CLAUDE.md §10) covers the full abductive cycle:

  • chain explanation (abductive_explanation) — walk explanatory edges back to a root;
  • minimal explanation (minimal_explanation) — the parsimonious set of roots covering a set of observations (Peirce’s economy of hypotheses);
  • counter-abduction (counter_abduction) — aggressively prune refuted hypotheses;
  • probabilistic abduction (probabilistic) — Bayesian scoring / ranking of hypotheses;
  • ATMS (atms) — assumption-based truth maintenance: minimal environments + nogoods.

Zero-heap throughout (bounded chains, caller-supplied out buffers, bitset environments).

Re-exports§

pub use atms::env_subset;
pub use atms::holds_in;
pub use atms::is_nogood;
pub use atms::label_add;
pub use atms::label_holds;
pub use atms::Environment;
pub use probabilistic::bayesian_posteriors;
pub use probabilistic::best_hypothesis;
pub use probabilistic::Hypothesis;

Modules§

atms
Assumption-based Truth Maintenance System (de Kleer’s ATMS).
probabilistic
Probabilistic abduction — Bayesian scoring and ranking of competing hypotheses.

Constants§

MAX_ABDUCTION_DEPTH
Max backward-chaining depth for abductive explanation (bounded, zero-heap).

Functions§

abductive_explanation
Abductive inference — walk BACKWARD along explanatory edges (hypothesis →explains→ effect, predicate == explains) from an observed effect to the root hypothesis that accounts for it. Returns that root, or None if the observation has no explanation in the rule set. Zero-heap.
counter_abduction
Counter-abduction: from candidates, drop every hypothesis that has been refuted (ruled out by an observation, or contradicted by an established fact), writing the survivors into out. Returns the surviving count — aggressive pruning of contradictory hypotheses. Zero-heap.
minimal_explanation
Minimal explanation generation (Peirce’s parsimony): the DISTINCT root hypotheses that together explain every observation in observations, written into out. A single hypothesis accounting for several observations appears once (the smallest covering set under the chain model). Observations with no explanation are skipped. Returns the count. Zero-heap.