diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2024-03-16 20:20:09 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2024-03-16 20:20:09 +0900 |
| commit | 8cbadb4fe54a9fc0e631ff688e423839f74e27df (patch) | |
| tree | f702efc82bac987577fd4cd4ba7da5c6e734d987 /sample/unary_numbers/GCM2023/AckSZ-3_10.in | |
| parent | cc7d7841935652c0906c2d863e9b71119167ece6 (diff) | |
| download | inpla-8cbadb4fe54a9fc0e631ff688e423839f74e27df.tar.gz inpla-8cbadb4fe54a9fc0e631ff688e423839f74e27df.zip | |
v0.12.2
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; |
