Question: Purpose: To model a DFA (Deterministic Finite Automaton) and use it to accept strings of the associated language. Input: The program should take the DFA

Purpose: To model a DFA (Deterministic Finite Automaton) and use it to accept strings of the associated language.

Input: The program should take the DFA description from a text file that is specified as a command line parameter. If this parameter is missing, the user should be prompted for the data file. Strings to be tested for inclusion in the language should be entered interactively by the user.

Output: For each string being tested, the program should indicate whether or not the string is accepted.

Line 1 speci?es the number of states.

Line 2 speci?es the states (i.e., just a list of the names of the states, separated by spaces).

Line 3 speci?es the size of the alphabet.

Line 4 speci?es the alphabet.

Lines 5-7 give the transition function, each row corresponding to a state (in order speci?ed on line 2) and each column corresponding to a symbol from the alphabet (in order speci?ed on line 4).

Line 8 speci?es the start state.

Line 9 speci?es the number of ?nal/accept states.

Line 10 speci?es the ?nal states.

For example:

2 A B 2 a b B A A B A 1 A

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!