pub struct Subcube {
pub n: usize,
pub care: u64,
pub value: u64,
}Expand description
A subcube of {0,1}ⁿ: the coordinates set in care are fixed to the matching bits of value;
the rest are free. As a blocker it is the footprint of one clause — the corners that falsify
it. (Pnp.lean’s Blocker, generalized from clean 3-bit faces to any width.)
Fields§
§n: usize§care: u64Bitmask of the fixed (“cared-about”) coordinates — the blocker’s support.
value: u64Required values on the fixed coordinates; bits outside care are held at 0.
Implementations§
Source§impl Subcube
impl Subcube
Sourcepub fn blocker(clause: &[Lit], n: usize) -> Subcube
pub fn blocker(clause: &[Lit], n: usize) -> Subcube
The blocker of a clause: the subcube of corners that set every literal false. A positive
literal xᵥ is false at c[v]=0; a negative literal ¬xᵥ is false at c[v]=1. So care
is the clause’s variable set and value’s bit v is set exactly for the negative literals.
Sourcepub fn covers(&self, corner: Corner) -> bool
pub fn covers(&self, corner: Corner) -> bool
Does this subcube contain corner? (Pnp.lean’s Blocker.Covers — is the clause falsified
at this corner?)
Sourcepub fn dimension(&self) -> usize
pub fn dimension(&self) -> usize
The number of free coordinates — the subcube’s dimension as a face (n - |support|).
Sourcepub fn footprint_card(&self) -> u64
pub fn footprint_card(&self) -> u64
How many corners this blocker forbids: 2^dimension (the footprint cardinality).
Sourcepub fn clause_literals(&self) -> Vec<(usize, bool)>
pub fn clause_literals(&self) -> Vec<(usize, bool)>
Recover the clause this blocker is the footprint of — the inverse of Subcube::blocker.
A fixed coordinate v appears positively when value’s bit is 0 (the clause is falsified
at v=0) and negatively when it is 1. Round-tripping a clause through blocker and back is
the proof that the geometric representation loses nothing.
Sourcepub fn clause_lp_value(&self, point: &[f64]) -> f64
pub fn clause_lp_value(&self, point: &[f64]) -> f64
The LP value of this blocker’s clause at a fractional point of [0,1]ⁿ: Σ over literals of
x (positive) or 1−x (negative). The clause’s relaxation is satisfied iff the value is ≥ 1.
At the ½-center every literal contributes ½, so the value is width/2 — satisfied iff width ≥ 2.
Sourcepub fn resolve(&self, other: &Subcube) -> Option<(usize, Subcube)>
pub fn resolve(&self, other: &Subcube) -> Option<(usize, Subcube)>
Resolve two blockers — the geometry of clause resolution, the engine of “rules beget rules.”
Two blockers resolve when their fixed coordinates agree everywhere except a single pivot where
they take opposite values (one clause carries the pivot literal, the other its negation, with no
other clashing literal). The resolvent is the merged blocker with the pivot freed — a new rule
derived from the two neighbors, exactly the Quine–McCluskey adjacency of two implicants. Returns
(pivot, resolvent), or None when there is no single clean pivot (no opposite literal, or a
second clash making the resolvent a tautology).