aboutsummaryrefslogtreecommitdiff
path: root/sample/ack_3_5.in
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sample/ack_3_5.in22
1 files changed, 9 insertions, 13 deletions
diff --git a/sample/ack_3_5.in b/sample/ack_3_5.in
index 87057a2..7b6e0bd 100644
--- a/sample/ack_3_5.in
+++ b/sample/ack_3_5.in
@@ -4,25 +4,21 @@
// | ack(m,0) = ack(m-1,1)
// | ack(m,n) = ack(m-1,ack(m,n-1));
-// The below rule is wrong because there is no gurantee that
-// the 'cnt' is an integer agent when ack(r)~(m-1,cnt) is evaluated.
+// The following rule is wrong because there is no gurantee that
+// the 'cnt' is connected to an integer agent
+// when ack(r)~(m-1,cnt) is evaluated.
//
// ack(r) >< (int m, int n)
// | m==0 => r~(n+1)
// | n==0 => ack(r) ~ (m-1,1)
// | _ => ack(cnt)~(m,n-1), ack(r)~(m-1,cnt);
+//
+// So, the `cnt' should be connected as an element of connections.
-
-ack(ret, n) >< (int m)
-| m==0 => inc(ret)~n
-| _ => ackn(ret, m)~n;
-
-ackn(ret, int m) >< (int n)
-| n==0 => ack(ret,1) ~ (m-1)
-| _ => ack(cnt,n-1)~m, ack(ret,cnt)~(m-1);
-
-inc(ret)><(int n) => ret~(n+1);
-
+ack(ret, int m) >< (int n)
+| m==0 => ret~(n+1)
+| n==0 => ack(ret, m-1)~1
+| _ => ack(cnt, m)~(n-1), ack(ret, m-1)~cnt;
ackMain(ret)><(int m, int n) => ack(ret,n)~m;