| 〈build_rec#(i + 1; x2, to2)〉 (x2 = x1 ∧ to2 = some(t)), ∀ 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 → x0 = depths(to .t, i0) + x)), x2 = d ' + y, to2 = fail, d ' + y = depths(t, i + 1) + x1, 0 ≠ i1, x1 ≠ [], d ∈ depths(t, i + 1), max(d ' + y) ≤ i1 + i, i < d, 0 < i1, i1 + i < max(x1), max(d ' + y) < max(x1), x1 = d0 + y0 ⊦ 〈if d0 ≤ i then to := fail else if d0 = i + 1 then { x1 := pop(x1) ; to := some(Leaf) } else let to0 = fail, to1 = fail in { build_rec#(2 + i; x1, to0) ; if to0 = fail then to := fail else { build_rec#(2 + i; x1, to1) ; if to1 = fail then to := fail else to := some(Node(to0 .t, to1 .t)) } }〉 〈to2 := to ; if to2 = fail then to0 := fail else to0 := some(Node(t, to2 .t))〉 (to0 ≠ fail → d ' + y = depths(to0 .t, i) + x1) |
〈build_rec#(i + 1; x2, to2)〉 (x2 = d0 ' + y0 ∧ to2 = some(t)), ∀ 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 → x0 = depths(to .t, i0) + x)), x1 = d0 ' + y0, d ' + y = depths(t, i + 1) + d0 ' + y0, to2 = fail, x2 = d ' + y, 0 ≠ i1, max(d ' + y) < max(d0 ' + y0), i1 + i < max(d0 ' + y0), 0 < i1, i < d, max(d ' + y) ≤ i1 + i, d ∈ depths(t, i + 1) ⊦ 〈if d0 ≤ i then to := fail else if d0 = i + 1 then { x1 := pop(x1) ; to := some(Leaf) } else let to0 = fail, to1 = fail in { build_rec#(2 + i; x1, to0) ; if to0 = fail then to := fail else { build_rec#(2 + i; x1, to1) ; if to1 = fail then to := fail else to := some(Node(to0 .t, to1 .t)) } }〉 〈to2 := to ; if to2 = fail then to0 := fail else to0 := some(Node(t, to2 .t))〉 (to0 ≠ fail → d ' + y = depths(to0 .t, i) + x1)
[[CONCRETESIMPRULES : ([CSIMPSEQ : ⊦ d ∈ d0 ' ↔ d = d0], [CSIMPSEQ : ⊦ d ∈ x + y ↔ ¬ ¬ (d ∈ x ∨ d ∈ y)], [CSIMPSEQ : ⊦ d ∈ x → d ∈ x + y], [CSIMPFORWARD : ⊦ i ≤ j ∧ j < j0 → i < j0], [CSIMPFORWARD : ⊦ d ' + x = y → d ∈ y], [CSIMPSEQ : ⊦ i + j = j + i], [CSIMPSEQ : ⊦ (x + y) + z = x + y + z], [CSIMPSEQ : ⊦ d ' + x ≠ []], [CSIMPSEQ : ⊦ d + x = d ' + x])]]