Write a program to simulate a machine known as the deterministic finite automata (dfa). Your program reads a description of a machine M (from an input file) which includes:
◦ A list of states
◦ A set of alphabet letters
◦ A set of transition functions
◦ A start state
◦ A set of final states
It then reads in a set of input strings (interactively) and determines whether or not a particular string is acceptable by the machine.
Test Data:
Test your simulator by designing 3 machines:
• A machines that accepts an even number of 0’s. {00, 0000, 000000, ….}
• A machine that accepts any integer. {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ……}
• A machine that accepts any legal C variable name. {index, xyz, name1, dept_2, ….}
First test each machine individually, then combine all three into one machine and test your program with all three together. Your program must be generic enough to accept any other machine.
Misc. Information
• You can design the format of your input file. Please include in the ReadMe file what the format is.
• Your program must be general enough to simulate ANY finite automata (not limiting to the three test cases).
• Your program must check for error conditions and invalid inputs.
• Your program will be graded on completeness and correctness.
• The program must be properly documented according the Code Style guide posted on my webpage.
A nice task that can be considered basically as an exercise of style, since the task offers no more difficulty than the aim of being as generic as possible. The challenge is to formulate the management of rules and states with so generic expressions that they cover all possible cases while still holding strictly the particular conditions for each case. Thanks to our extensive experience, we can solve this task in a robust and optimized way.
Another important point is to establish a powerful way for the user to specify rules in the control file. Would it be acceptable to use standard regular expressions?
Your webpage should also be specified in order to determine the coding style to be used.
Regards
The Bramfeld Team
Hello,
I am a software developer, having more than 10 years of programming experience in c, c++ and java languages. I have done several similar programs back in university, so it would be a simple task for me. Please contact me about the details.
Sincelery,
ikthefirst
Hi,
I can help you with this task, however I have a question regarding combined program functionality - how machines should be combined? Should it be some complex combination of states, letters and transitions or it simply checks whether the input is acceptable for each of these machines separately or by some other rule?
Andrei
Hello,
I am a compiler developer with 3 years of experience and I have also experience to build programs such as dfa. I am sure that I have understand the requirements of the project and able to start working on it. Also I would like to mention that I like to pay attention on the documentation and well commented and solid wrote code.
Best regards,
Arsen Hakobyan