| ∀ j0, i0, x, x0, to. i→n(j0 - i0) < i→n(i1) → (x = x0 ∧ x0 ≠ [] ∧ i0 ≤ j0 ∧ max(x0) ≤ j0 → 〈build_rec#(i0; x, to)〉 (to = fail → (∀ t, x1. x0 ≠ depths(t, i0) + x1))), x = x0, x0 ≠ [], max(x0) ≤ i1 + i, 0 ≤ i1 ⊦ 〈if is_empty(x) then to0 := fail else let h = head(x) in if h < i then to0 := fail else if h = i then { x := pop(x) ; to0 := some(Leaf) } else let to2 = fail, to1 = fail in { build_rec#(i + 1; x, to2) ; if to2 = fail then to0 := fail else { build_rec#(i + 1; x, to1) ; if to1 = fail then to0 := fail else to0 := some(Node(to2 .t, to1 .t)) } }〉 (to0 = fail → (∀ t, x1. x0 ≠ depths(t, i) + x1)) |
∀ j0, i0, x, x0, to. i→n(j0 - i0) < i→n(i1) → (x = x0 ∧ x0 ≠ [] ∧ i0 ≤ j0 ∧ max(x0) ≤ j0 → 〈build_rec#(i0; x, to)〉 (to = fail → (∀ t, x1. x0 ≠ depths(t, i0) + x1))), x = x0, x0 ≠ [], max(x0) ≤ i1 + i, 0 ≤ i1 ⊦ 〈let h = head(x) in if h < i then to0 := fail else if h = i then { x := pop(x) ; to0 := some(Leaf) } else let to2 = fail, to1 = fail in { build_rec#(i + 1; x, to2) ; if to2 = fail then to0 := fail else { build_rec#(i + 1; x, to1) ; if to1 = fail then to0 := fail else to0 := some(Node(to2 .t, to1 .t)) } }〉 (to0 = fail → (∀ t, x1. x0 ≠ depths(t, i) + x1))
[[CONCRETESIMPRULES : ([CSIMPSEQ : ⊦ is_empty(x) ↔ x = []])]]