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