Debian Codegraph @

benchmarks.larceny/src/tak.sml

raw
1 (* TAK -- A vanilla version of the TAKeuchi function. *)
2
3 fun tak (x, y, z) =
4 if not (y < x)
5 then z
6 else tak (tak (x-1, y, z),
7 tak (y-1, z, x),
8 tak (z-1, x, y))
9
10 fun tak_benchmark (n) =
11 run_benchmark ("tak", n, fn () => tak (18, 12, 6), fn (x) => x = 7)
12
13 fun main () = tak_benchmark (tak_iters)