| x = d ' + y, d < 0, max(d ' + y) < 0, d ≤ max(d ' + y), x2 = x ∧ d1 = 0 ⊦ 〈let h = head(x2) in if h < d1 then to0 := fail else if h = d1 then { x2 := pop(x2) ; to0 := some(Leaf) } else let to2 = fail, to1 = fail in { build_rec#(d1 + 1; x2, to2) ; if to2 = fail then to0 := fail else { build_rec#(d1 + 1; x2, to1) ; if to1 = fail then to0 := fail else to0 := some(Node(to2 .t, to1 .t)) } }〉 〈to1 := to0, x1 := x2 ; if x1 ≠ [] then to1 := fail〉 (to1 ≠ fail → d ' + y = depths(to1 .t, 0)) |
x = d ' + y, d < 0, max(d ' + y) < 0, d ≤ max(d ' + y), x2 = x ∧ d1 = 0, h0 = head(x2) ⊦ 〈if h0 < d1 then to0 := fail else if h0 = d1 then { x2 := pop(x2) ; to0 := some(Leaf) } else let to2 = fail, to1 = fail in { build_rec#(d1 + 1; x2, to2) ; if to2 = fail then to0 := fail else { build_rec#(d1 + 1; x2, to1) ; if to1 = fail then to0 := fail else to0 := some(Node(to2 .t, to1 .t)) } }〉 〈to1 := to0, x1 := x2 ; if x1 ≠ [] then to1 := fail〉 (to1 ≠ fail → d ' + y = depths(to1 .t, 0))
[[CONCRETESIMPRULES : ()]]