LAWS.zb_zero: law of lawful-words@0.1.0.0 Import: import lawful-words@0.1.0.0/LAWS.bend as LAWS Lines 456-461 of lawful-words@0.1.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-words@0.1.0.0/LAWS.bend&start_line=456&end_line=461 import Base import lawful-words@0.1.0.0/defs.bend as D # The zero-byte test: zb(v) is zero exactly when no byte of v is zero. (Only # this whole-word statement holds: a flag above a zero byte can be set even # though that byte is not zero, e.g. v = 0x01010100 flags all four bytes.) law zb_zero: for v: U32 {U32.is_zero(D.zb(v)) == (U32.is_ne(D.byte(v, 0n), 0) && (U32.is_ne(D.byte(v, 1n), 0) && (U32.is_ne(D.byte(v, 2n), 0) && U32.is_ne(D.byte(v, 3n), 0)))) : Bool} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_ne https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_zero https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/defs.bend&name=byte https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/defs.bend&name=zb https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_zb.bend&name=zb_zero