def nat.go
import bend-kit-property@0.4.0.0/shrink.bend as Shrinkimport Base
28def nat.go(f: Nat, stop: Bool, +n: Nat, +d: Nat) -> List<&1, Nat>:
29 match f stop:
30 case 0n _:
31 Nil{}
32 case 1n+p True{}:
33 Nil{}
34 case 1n+p False{}:
35 +h = Nat.div(d, 2n)
36 (n - d : Nat) <> nat.go(p, Nat.is_eq(h, 0n), n, h)