pub(crate) const BOUNDARY_VALUES: &[u32] = &[
0, 1, 2, 31, 32, 0x0001_0000, 0x7FFF_FFFF, 0x8000_0000, 0xFFFF_FFFE, u32::MAX, ];
pub(crate) mod binary;
pub(crate) mod complement;
pub(crate) mod custom;
pub(crate) mod demorgan;
pub(crate) mod distributive;
pub(crate) mod inverse;
pub(crate) mod lattice;
pub(crate) mod one_sided;
pub(crate) mod trichotomy;
pub struct FalsifiabilityEntry {
pub law_name: &'static str,
pub canonical_counterexample: &'static str,
pub catches_violator: bool,
pub passes_honest: bool,
}
const fn entry(
law_name: &'static str,
canonical_counterexample: &'static str,
) -> FalsifiabilityEntry {
FalsifiabilityEntry {
law_name,
canonical_counterexample,
catches_violator: true,
passes_honest: true,
}
}
pub static FALSIFIABILITY_MATRIX: &[FalsifiabilityEntry] = &[
entry("commutative", "sub: f(0,1)=4294967295 != f(1,0)=1"),
entry(
"associative",
"sub: f(f(1,1),2)=4294967294 != f(1,f(1,2))=2",
),
entry("identity(0)", "add with declared element 1: f(0,1)=1 != 0"),
entry(
"left-identity(0)",
"add with declared element 1: f(1,0)=1 != 0",
),
entry(
"right-identity(0)",
"add with declared element 1: f(0,1)=1 != 0",
),
entry("self-inverse(0)", "or with result 0: f(1,1)=1 != 0"),
entry("idempotent", "add: f(1,1)=2 != 1"),
entry("absorbing(0)", "or with element 0: f(1,0)=1 != 0"),
entry("left-absorbing(0)", "broken z=1 absorber: f(1,0)=0 != 1"),
entry("right-absorbing(0)", "broken z=1 absorber: f(0,1)=0 != 1"),
entry("involution", "clear-low-bit: f(f(1))=0 != 1"),
entry("monotone", "bitwise-not: 0 <= 1 but f(0) > f(1)"),
entry(
"bounded(0,4294967295)",
"popcount+1: f(4294967295)=33 outside [0,32]",
),
entry(
"zero-product(true)",
"wrapping-mul: f(2,2147483648)=0 with nonzero operands",
),
entry(
"de-morgan(and,or)",
"identity-not: f(and(0,1))=0 != or(f(0),f(1))=1",
),
entry(
"monotonic(NonDecreasing)",
"bitwise-not: 0 <= 1 but f(0) > f(1)",
),
entry(
"complement(not,4294967295)",
"popcount/not: f(0)+f(not(0))=33 != 32",
),
entry(
"distributive(add)",
"bad-mul: f(3,add(0,0))=1 != add(f(3,0),f(3,0))=2",
),
entry(
"lattice-absorption(min)",
"fake-max-add: f(1,min(1,1))=2 != 1",
),
entry("inverse-of(add)", "sub+1: f(add(1,1),1)=2 != 1"),
entry(
"trichotomy(lt,eq,gt)",
"lt-always-zero at (0,1): lt+eq+gt=0 != 1",
),
entry(
"custom(parity-even,1)",
"parity-even custom check rejects input 1",
),
];