| b2i(by) = 0, b2i(by0) < 0, ∀ by0, by, bytes1. # bytes1 < #(bytes0 + by1 ') → b2i(by) = 0 ∧ b2i(by0) < 0 → bits2bytes(sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes1))) = by ' + by0 ' + bytes1 ⊦ bits2bytes(sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1)) = by ' + by0 ' + bytes0 + by1 ', ¬ true ∈ byte2bits(by) ∧ ¬ true ∈ byte2bits(by0) ∧ ¬ true ∈ bytes2bits(bytes0), ¬ false ∈ byte2bits(by) ∧ ¬ false ∈ byte2bits(by0) ∧ ¬ false ∈ bytes2bits(bytes0) |
⊦ 8 < # bits → bits2bytes(bits) = bits2bytes(firstn(# bits - 8, bits)) + i2b(bits2int(lastn(8, bits)))
8 < #(sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1)), b2i(by) = 0, b2i(by0) < 0, ∀ by0, by, bytes1. # bytes1 < #(bytes0 + by1 ') → b2i(by) = 0 ∧ b2i(by0) < 0 → bits2bytes(sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes1))) = by ' + by0 ' + bytes1 ⊦ bits2bytes (firstn (#(sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1)) - 8, sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1))) + i2b(bits2int(lastn(8, sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1)))) = by ' + by0 ' + bytes0 + by1 ', ¬ true ∈ byte2bits(by) ∧ ¬ true ∈ byte2bits(by0) ∧ ¬ true ∈ bytes2bits(bytes0), ¬ false ∈ byte2bits(by) ∧ ¬ false ∈ byte2bits(by0) ∧ ¬ false ∈ bytes2bits(bytes0)
Used simplifier rules: byte2bits-length: ⊦ # byte2bits(by) = 8;%byte2bits-empty: ⊦ byte2bits(by) ≠ [];% ⊦ #(bits + bits0) = # bits + # bits0;% ⊦ (bits + bits0) + bits1 = bits + bits0 + bits1;% ⊦ ¬ m < n ↔ n ≤ m;% ⊦ m + n ≤ m ↔ n = 0;% ⊦ # bits = 0 ↔ bits = [];% ⊦ sgn(bits) = [] ↔ bits = [];% ⊦ ¬ bits + bits0 ≠ [] ↔ bits = [] ∧ bits0 = [];% ⊦ (m + n0) + n1 = m + n0 + n1;% ⊦ m + n = n + m; Used terms: sgn(byte2bits(by) + byte2bits(by0) + bytes2bits(bytes0)) + byte2bits(by1)