Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help on turning machines. Need to use and online simulator : provided an example on how the table should look like at the bottom: For
help on turning machines. Need to use and online simulator :
provided an example on how the table should look like at the bottom:
For this problem, you will design a language, a finite state machine (nondeterministic or deterministic) and a Turing Machine. You will implement a simplified parser for legal variable assignment expressions. To keep the number of inputs low, valid variable names are (p, q, r and valid variable values are f5, 7, 9). A valid variable assignment looks like this: 5; q=r; Note the spaces around the equal sign and the semicolon at the end. You may not assign a variable to an expression, so statements such as p qr; orr-5* 5; are illegal. A) Write the grammar that describes this language using the Backus-Naur form put the grammar here B) Design a finite state machine that accepts valid assignment statements. If you want to test your machine (which I strongly recommend), you can implement your machine here: http://automatonsimulator.com/ If you have any questions, ask me. I am more than happy to help you figure out how to create the FSM. C) Implement a Turing Machine that accepts the same language. State Sets: Input Alphabet: Transition Function (You may not need all of the cells): Simulation Code Screenshot of Passing Test: Screenshot of Rejecting Test: Table 5.2.3: Transition function for the Turing machine that recognizes powers of 2. rej' ' Qfirst (Jeven, X, R) (gfirst, X, R) (acc R) even odd, a, R) (leven, X, R) (ret L) Godd (geven, X, R) (odd, X, R) (Trej, *, L) gret (ret, a, L) (gret, X, L)(Hfirst *, R) For this problem, you will design a language, a finite state machine (nondeterministic or deterministic) and a Turing Machine. You will implement a simplified parser for legal variable assignment expressions. To keep the number of inputs low, valid variable names are (p, q, r and valid variable values are f5, 7, 9). A valid variable assignment looks like this: 5; q=r; Note the spaces around the equal sign and the semicolon at the end. You may not assign a variable to an expression, so statements such as p qr; orr-5* 5; are illegal. A) Write the grammar that describes this language using the Backus-Naur form put the grammar here B) Design a finite state machine that accepts valid assignment statements. If you want to test your machine (which I strongly recommend), you can implement your machine here: http://automatonsimulator.com/ If you have any questions, ask me. I am more than happy to help you figure out how to create the FSM. C) Implement a Turing Machine that accepts the same language. State Sets: Input Alphabet: Transition Function (You may not need all of the cells): Simulation Code Screenshot of Passing Test: Screenshot of Rejecting Test: Table 5.2.3: Transition function for the Turing machine that recognizes powers of 2. rej' ' Qfirst (Jeven, X, R) (gfirst, X, R) (acc R) even odd, a, R) (leven, X, R) (ret L) Godd (geven, X, R) (odd, X, R) (Trej, *, L) gret (ret, a, L) (gret, X, L)(Hfirst *, R)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started