MAXCUTMAXCUT(x; ; cut)
{cut := 0 + [];
let m = 0, n = 1
in {while n < # x
do {/* _:invariant cutseq(cut, x) ∧ n = m + 1 ∧ m ≤ # x ∧ cut.last = m ∧ cut.head = 0 ∧ in-range(cut, 0, # x) wfbound # x - m; */;
let inc = x[m] < x[n]
in while n < # x ∧ (x[n - 1] < x[n] ↔ inc)
do {/* _:invariant cutseq(cut + n ', x, inc) ∧ m < n ∧ n ≤ # x wfbound # x - n; */; n := n + 1};
cut := cut + n; m := n; n := m + 1};
if m < # x then cut := cut + # x}
}

00MAXCUT-proofMAXCUT-proof-info

The proof is valid.

MAXCUT-thm