title: Inhabitance Verdict category: concepts

Inhabitance Verdict

The v0.2.1 release introduces carrier non-emptiness as a first-class verdict primitive sibling to cert:CompletenessCertificate. Together they answer two distinct questions about a type:ConstrainedType:

For constraint systems that admit multiple satisfying value tuples, an InhabitanceCertificate.verified may be true while the corresponding CompletenessCertificate.verified is false — the carrier is inhabited but the minimal basis leaves sites free.

Dispatch routing

predicate:InhabitanceDispatchTable routes every input to one of three polynomial deciders based on the constraint system's shape:

  1. predicate:Is2SatShaperesolver:TwoSatDecider (priority 0): Aspvall-Plass-Tarjan SCC decision in O(n+m).
  2. predicate:IsHornShaperesolver:HornSatDecider (priority 1): unit propagation in O(n+m).
  3. predicate:IsResidualFragmentresolver:ResidualVerdictResolver (priority 2, catch-all): returns Err(InhabitanceImpossibilityWitness) with reduction:ConvergenceStall for non-polynomial residual fragments.

Coverage is exhaustive by construction; reduction:DispatchMiss is unreachable for this table.

Identities

Unrestricted IH_2 would be equivalent to P = NP and is not adopted.

One-liner consumer API

use uor_foundation::enforcement::prelude::*;
use uor_foundation_macros::ConstrainedType;

#[derive(ConstrainedType, Default)]
#[uor(residue = 255, hamming = 8)]
struct Shape;

let cert: Validated<InhabitanceCertificate> =
    InhabitanceResolver::new().certify(&Shape)?;
match cert.witness() {
    Some(witness_bytes) => println!("inhabited: {witness_bytes:?}"),
    None => println!("inhabited (verified, witness elided)"),
}

The Lean 4 counterpart exposes the same shape via UOR.Enforcement.Certify and UOR.Pipeline.runInhabitance.

See also