Question: Will give thumbs up if the program is complete and no errors when compiling The program should do the following: read a NDFSM from the

Will give thumbs up if the program is complete and no errors when compiling

The program should do the following:

  1. read a NDFSM from the user specified file
  2. Convert to a DFSM
  3. repeat

ask the user to input a string which can be empty

output true if the string is accepted by the machine, false otherwise.

Until the user wants to stop

Format of the NDFSM file:

First row is alphabet separated by comma

Second row is the number of states of the NDFSM, implicitly the states are 0,1, 2.. where 0 is the initial state

Third row is the accepting states: one or more separated by comma.

The remaining rows are the transition relation, one row for each state. A transition is a triple (p, c, q), where p is the state, c is the alphabet, and q is the new state; for epsilon transition use (p, , q).

Will give thumbs up if the program is complete and no errors

File Example1

a, b

3

1

(0, a, 1)

(1, a, 1), (1, , 2)

(2, b, 0)

when compiling The program should do the following: read a NDFSM from

File Example2

a, b

7

2, 6

(0, , 3), (0, , 4)

(3, a, 3), (3, b, 3), (3, b, 1)

(1, b, 2)

(2, a, 2), (2, b, 2)

(4, a, 4), (4, b, 4), (4, a, 5)

(5, a, 6)

(6, a, 6,), (6, b, 6)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!