Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

2. How will the team select a leader?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago