| bytes2int(bytes) = 0, by ∈ bytes, ∀ by, bytes0. # bytes0 < # bytes → bytes2int(bytes0) = 0 ∧ by ∈ bytes0 → by = i2b(0) ⊦ by = i2b(0) |
⊦ 1 < # bytes → bytes2int(bytes) = bytes2int(bytes.butlast) * 256 + band(b2i(bytes.last), 255)
1 < # bytes, bytes2int(bytes.butlast) * 256 + band(b2i(bytes.last), 255) = 0, by ∈ bytes, ∀ by, bytes0. # bytes0 < # bytes → bytes2int(bytes0) = 0 ∧ by ∈ bytes0 → by = i2b(0) ⊦ by = i2b(0)
Used simplifier rules: bytes2int-one: ⊦ bytes2int(by ') = b2i(by);% ⊦ 1 < m ↔ ¬(m = 0 ∨ m = 1);% ⊦ # bytes = 0 ↔ bytes = [];% ⊦ ¬ by ∈ [];% ⊦ # bytes = 1 ∧ by ∈ bytes → bytes = by '; (forward)% ⊦ # by ' = 0 +1;% ⊦ by ' ≠ [];% ⊦ b2i(by) = i → (i2b(i) ≠ by ↔ false); Used terms: bytes