Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An automaton is complete if for all states q and all letters a in the alphabet, there is a transition from q labeled a .

An automaton is complete if for all states q
and all letters a
in the alphabet, there is a transition from q
labeled a
. This may seem strange, given that \delta
is a function, so it should always map (q,a)
to some state; but in general, \delta
is what we call a partial function: there may be pairs mapped to nothing.
However, any incomplete automaton can be made complete by adding one state, usually called a sink state. All missing transitions will point to the sink state, and the sink state will have a self-loop on each letter.
In this bonus exercise, you should write the function complete that completes the automaton in place (that means that you are not allowed to create a new automaton from scratch in that function). You should add a state if and only if the automaton is not complete. Be careful when adding a new state, you should make sure that the state is actually new.
Hint: Have a close look at the documentation, in particular, have a look at the methods inherited. You may also gather some ideas from the testing code.

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 Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago