Question
There is a bug with the MachineModelNFA code, which is demonstarted with the following implementation of the language (()())((ab)(bb)). I know there is a bug
There is a bug with the MachineModelNFA code, which is demonstarted with the following implementation of the language (()())((ab)(bb)).
I know there is a bug after the second epslion move which is why the test can't be completed. But I am not sure how should I fix the bug. If someone can give an idea on to fix it, it would be great!
nfa_ec = { 'states': ['S0','S1','E0','E1','E2','E3','F0','F1','F2','F3',], 'alphabet': ['a','b'], 'transitions': { ('S0',':'):['S1'],('S1',':'):['E0','F0'], ('E0',':'):['E1'],('E1','a'):['E2'],('E2','b'):['E3'],('E3',':'):['S0'], ('F0',':'):['F1'],('F1','b'):['F2'],('F2','b'):['F3'],('F3',':'):['S0'] }, 'start': 'S0', 'accept': ['S0','E0','F0','E3','F3'] }
nfa_test = [None for i in range(5)]
nfa_test = [ ('',True), ('ab',True), ('bb',True), ('aa',False), ('ba',False), ('abab',True), ('abbb',True), ('bbab',True), ('bbbb',True), ('abaa',False), ('bbba',False), ('aaaa',False), ('aaab',False), ]
tm = TestMachineNFA(nfa_ec) tm.run(nfa_test)
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