Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

  1. {| 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

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 And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

Reassure employees that there are no current plans for more cuts.

Answered: 1 week ago