LAWS_checksum.bend open laws/TODOs
raw source on the hub · import bend-osdev-acpi@0.1.2.0/LAWS_checksum.bend as LAWS_checksum
The checksum (5.2.6), for every input: AcpiChecksum.fix(i, o), which writes the checksum byte at offset i, makes the bytes sum to zero modulo 256 whenever o has a byte i, whatever the other bytes are.
3 imports
import Base import bend-osdev-bytes@0.1.1.1/bytes.bend as B import ./checksum.bend as C
Laws
law fix_ok provedin PROOF_checksum.bendsource · line 8 · raw
@+i:Nat -> @+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> @+h:{Nat.is_lt(i, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets.len(o)) == True{} : Bool} -> {0x437a65a35fd0c02411bea19819f9b33f/checksum.AcpiChecksum.ok(0x437a65a35fd0c02411bea19819f9b33f/checksum.AcpiChecksum.fix(i, o)) == True{} : Bool}
law fix_example provedin PROOF_checksum.bendsource · line 15 · raw
{(Nat.is_lt(1n, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets.len(0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets.of_list([7, 200, 99]))), 0x437a65a35fd0c02411bea19819f9b33f/checksum.AcpiChecksum.ok(0x437a65a35fd0c02411bea19819f9b33f/checksum.AcpiChecksum.fix(1n, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets.of_list([7, 200, 99])))) == (True{}, True{}) : Pair(Bool, Bool)}the hypothesis holds, and the law with it, at an example