Question
This question are from the FSA machine. In these exercises, the alphabet is {,}{a,b}, and are take from the exercises to chapter 1 of Siper's
This question are from the FSA machine.
In these exercises, the alphabet is {,}{a,b}, and are take from the exercises to chapter 1 of Siper's book,
- {| contains at least three a's }
Here is the python code provided:
dfa_md = [None for i in range(13)]
dfa_md[1] = { 'states': [''], 'alphabet': [''], 'transitions': {('',''):''}, 'start': '', 'accept': [''] }
This is the test to be passed through the code:
dfa_test[1] = [ ('aaba',True), ('aabb',False) ]
def basic_test(): correct = 0 num_tests = len(dfa_test) for i in range(1,num_tests): print(" Exercise",i) try: tm = TestMachine(dfa_md[i]) if tm.run(dfa_test[i]): correct += 1 except Exception as exception: print(" *** exception thrown:", str(type(exception))) print("correct:",correct,"out of",num_tests-1)
basic_test()
If someone can show me how to do this question with the basic explanation is fine. Thank you!
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