Created
June 2, 2015 01:41
-
-
Save copumpkin/6677ba1bb6353b51c543 to your computer and use it in GitHub Desktop.
Revisions
-
copumpkin created this gist
Jun 2, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ module Ack where -- http://en.wikipedia.org/wiki/Ackermann_function#Definition_and_properties data Nat : Set where zero : Nat suc : Nat → Nat {-# BUILTIN NATURAL Nat #-} iterate : (Nat → Nat) → Nat → Nat iterate f zero = f (suc zero) iterate f (suc n) = f (iterate f n) ackermann : Nat → Nat → Nat ackermann zero = suc ackermann (suc n) = iterate (ackermann n)