| # buf = # ns1 * ENCODED_NAT_SIZE, # buf = # ns0 * ENCODED_NAT_SIZE, is-encoded(ns1, buf), ∃ n, buf0, buf1. n ∈ ns0 ∧ buf = buf0 + buf1 ∧ is-encoded(n, buf0) ∧ is-encoded(ns0 -- n, buf1), ∀ ns, buf, ns1. # ns < # ns0 → # buf = # ns1 * ENCODED_NAT_SIZE ∧ # buf = # ns * ENCODED_NAT_SIZE ∧ is-encoded(ns, buf) ∧ is-encoded(ns1, buf) → ns = ns1 ⊦ ns0 = ns1, ns0 = ∅ |
# buf0 = (# ns0 - 1) * ENCODED_NAT_SIZE, # buf1 = ENCODED_NAT_SIZE, # ns1 * ENCODED_NAT_SIZE = # ns0 * ENCODED_NAT_SIZE, ENCODED_NAT_SIZE + # buf0 = # ns0 * ENCODED_NAT_SIZE, is-encoded(n, buf1), is-encoded(ns0 -- n, buf0), is-encoded(ns1, buf1 + buf0), n ∈ ns0, ∀ ns, buf, ns1. # ns < # ns0 → # buf = # ns1 * ENCODED_NAT_SIZE ∧ # buf = # ns * ENCODED_NAT_SIZE ∧ is-encoded(ns, buf) ∧ is-encoded(ns1, buf) → ns = ns1 ⊦ # ns0 = 0, ns0 = ∅, ns0 = ns1
Used simplifier rules: is-encoded-size: ⊦ is-encoded(ns, buf) → # buf = # ns * ENCODED_NAT_SIZE;% ⊦ n ∈ ns → #(ns -- n) = # ns - 1; (s)%size-zero-01: ⊦ ns ≠ ∅ → # ns ≠ 0; (forward) from specification set-basic[nat-set]%ne-01: ⊦ n ∈ ns → ns ≠ ∅; (forward) from specification set-basic[nat-set]%is-encoded-size: ⊦ is-encoded(n, buf) → # buf = ENCODED_NAT_SIZE; (forward) from specification encoding-fixed-size[encoding-nat]%append-a: ⊦ (buf + buf0) + buf1 = buf + buf0 + buf1; from specification array-splice[buffer]% ⊦ #(buf + buf0) = # buf + # buf0; (s)