-
Notifications
You must be signed in to change notification settings - Fork 0
/
outpout2
25 lines (25 loc) · 1.26 KB
/
outpout2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Right (
Machine {
name = "unary_sub",
alphabet = "1.-=",
blank = '.',
states = ["scanright","eraseone","subone","skip","HALT"],
initial = "scanright", finals = ["HALT"],
transitions = [
("eraseone",[
Transition {read = '1', to_state = "subone", write = '=', action = "LEFT"},
Transition {read = '-', to_state = "HALT", write = '.', action = "LEFT"}]),
("skip",[
Transition {read = '.', to_state = "skip", write = '.', action = "LEFT"},
Transition {read = '1', to_state = "scanright", write = '.', action = "RIGHT"}]),
("scanright",[
Transition {read = '.', to_state = "scanright", write = '.', action = "RIGHT"},
Transition {read = '1', to_state = "scanright", write = '1', action = "RIGHT"},
Transition {read = '-', to_state = "scanright", write = '-', action = "RIGHT"},
Transition {read = '=', to_state = "eraseone", write = '.', action = "LEFT"}]),
("subone",[
Transition {read = '1', to_state = "subone", write = '1', action = "LEFT"},
Transition {read = '-', to_state = "skip", write = '-', action = "LEFT"}])
]
}
)