Skip to content

Instantly share code, notes, and snippets.

@ryuta-ito
Created March 11, 2017 15:09
Show Gist options
  • Save ryuta-ito/766662f40e689127916aa687ccaee44b to your computer and use it in GitHub Desktop.
Save ryuta-ito/766662f40e689127916aa687ccaee44b to your computer and use it in GitHub Desktop.
-- P(x, y) <=> x < y
-- f(x, y) = (μz < y)[P(x, z)]
p x y = x < y
f x 0 = 0
f x y = h x (y-1) (f x (y-1))
h x y g | g < y = f x y
| g == y && p x y = y
| otherwise = y + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment