pub struct TriBit {
pub ones: BitPlane,
pub unknowns: BitPlane,
}Expand description
三值的位并行表示:一对位平面。
Fields§
§ones: BitPlane1 平面:取真的组。
unknowns: BitPlaneX 平面:取未知的组。
Implementations§
Source§impl TriBit
impl TriBit
Sourcepub const fn from_binary(ones: u64) -> Self
pub const fn from_binary(ones: u64) -> Self
从二进制平面构造:ones 的位就是 True,unknowns = 0。
这是二进制与三值之间的零开销桥:不复制、不分配。
Sourcepub const fn and_lattice(self, other: Self) -> Self
pub const fn and_lattice(self, other: Self) -> Self
按位与:格序 min(K3 / Ł3)。
Sourcepub const fn or_lattice(self, other: Self) -> Self
pub const fn or_lattice(self, other: Self) -> Self
按位或:格序 max(K3 / Ł3)。
Sourcepub const fn strong_add(self, other: Self, alg: Algebra) -> Self
pub const fn strong_add(self, other: Self, alg: Algebra) -> Self
按位强加法 ⊕,语义相关。
Sourcepub const fn strong_and(self, other: Self, alg: Algebra) -> Self
pub const fn strong_and(self, other: Self, alg: Algebra) -> Self
按位强合取 ⊗,语义相关。
Trait Implementations§
impl Copy for TriBit
impl Eq for TriBit
impl StructuralPartialEq for TriBit
Auto Trait Implementations§
impl Freeze for TriBit
impl RefUnwindSafe for TriBit
impl Send for TriBit
impl Sync for TriBit
impl Unpin for TriBit
impl UnsafeUnpin for TriBit
impl UnwindSafe for TriBit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more