diff options
Diffstat (limited to 'sample/unary_numbers/GCM2023/AckSZ-3_10.in')
| -rw-r--r-- | sample/unary_numbers/GCM2023/AckSZ-3_10.in | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sample/unary_numbers/GCM2023/AckSZ-3_10.in b/sample/unary_numbers/GCM2023/AckSZ-3_10.in new file mode 100644 index 0000000..6dec0ab --- /dev/null +++ b/sample/unary_numbers/GCM2023/AckSZ-3_10.in @@ -0,0 +1,13 @@ +// Ackermann function on unary natural numbers + +ack(r,y)>< Z => r~S(y); +ack(r,y)>< S(x) => ack_Sx(r, x)~y; +ack_Sx(r,x)>< Z => ack(r, S(Z))~x; +ack_Sx(r,x)>< S(y) => Dup(x1,x2)~x, ack(r,cnt)~x1, ack_Sx(cnt,x2)~y; + +// ack 3 10 +// 1 2 3 4 5 6 7 8 9 0 +ack(result, S(S(S(S(S(S(S(S(S(S(Z)))))))))))~S(S(S(Z))); + +prnat result; +exit; |
