Skip to content

Commit 070a63d

Browse files
committed
New example: checks if a unary number is the x'd power of 3
1 parent 05fe37a commit 070a63d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

examples/pow3.t

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Power of 3
2+
# ==========
3+
#
4+
# accepts for any member of the language:
5+
# L = { 1^x#1^y | x,y \in \mathbf{N} and y = 3^x }
6+
11
7+
q1
8+
q2
9+
q3
10+
q4
11+
q5
12+
q6
13+
q7
14+
q8
15+
qr
16+
q_accept A
17+
q_reject R
18+
q1 S -> q1 \ R
19+
q1 . -> q1 \ R
20+
q1 # -> q2 \ R
21+
q1 1 -> q4 . R
22+
q2 . -> q2 \ R
23+
q2 1 -> q3 \ R
24+
q3 _ -> q_accept \ L
25+
q4 1 -> q4 \ R
26+
q4 # -> q5 \ R
27+
q5 1 -> q6 . R
28+
q5 . -> q5 . R
29+
q6 1 -> q7 . R
30+
q6 . -> q6 \ R
31+
q7 1 -> q8 \ R
32+
q7 . -> q7 \ R
33+
q8 _ -> qr \ L
34+
q8 . -> q8 \ R
35+
q8 1 -> q6 . R
36+
qr 1 -> qr \ L
37+
qr . -> qr \ L
38+
qr # -> qr \ L
39+
qr _ -> qr \ L
40+
qr S -> q1 \ R

0 commit comments

Comments
 (0)