| b2i(by) < 0, 0 ≤ bytes2int(by ' + bytes) + 2 ^ (8 * n→i(# bytes)), ∀ by, bytes0. # bytes0 < # bytes → 0 ≤ bytes2int(by ' + bytes0) + 2 ^ (8 * n→i(# bytes0)) ∧ b2i(by) < 0 → b2i(by) = ~1 ⊦ b2i(by) = ~1 |
⊦ 1 < # bytes → bytes2int(bytes) = bytes2int(bytes.butlast) * 256 + band(b2i(bytes.last), 255)
1 < #(by ' + bytes), b2i(by) < 0, 0 ≤ (bytes2int((by ' + bytes).butlast) * 256 + band(b2i((by ' + bytes).last), 255)) + 2 ^ (8 * n→i(# bytes)), ∀ by, bytes0. # bytes0 < # bytes → 0 ≤ bytes2int(by ' + bytes0) + 2 ^ (8 * n→i(# bytes0)) ∧ b2i(by) < 0 → b2i(by) = ~1 ⊦ b2i(by) = ~1
Used simplifier rules: bytes2int-one: ⊦ bytes2int(by ') = b2i(by);% ⊦ #(bytes + bytes0) = # bytes + # bytes0;% ⊦ # by ' = 0 +1;% ⊦ (bytes + bytes0) + bytes1 = bytes + bytes0 + bytes1;% ⊦ 1 < m ↔ ¬(m = 0 ∨ m = 1);% ⊦ m + 1 ≠ 0;% ⊦ (m + n0) + n1 = m + n0 + n1;% ⊦ m + n = n + m;% ⊦ 1 = m + 1 ↔ m = 0;% ⊦ # bytes = 0 ↔ bytes = [];% ⊦ # [] = 0;% ⊦ bytes + [] = bytes;% ⊦ (* j) ≤ i0 + (* j0) ↔ j - j0 ≤ i0;% ⊦ i < 0 → (~1 ≤ i ↔ i = ~1);% ⊦ i + j + i0 = (i + j) + i0;% ⊦ i + j = j + i; Used terms: by ' + bytes