Decision Properties of Regular Languages
Decision Properties of Regular Languages
Theory of Computation
TOPIC Decision Properties of Regular Languages
Pprfgfevppesented by
PRESENTED BY
Group 14
GUIDED BY
CONTENT
Regular Languages
Decision problem
• Membership problem
• Emptiness problem
• Finiteness problem
• Equivalence problem
References
REGULAR LANGUAGES
1. Membership problem
2. Emptiness problem
3. Finiteness problem
4. Equivalence problem
DECISION PROBLEM
Yes
Decision
Input
Problem
(generally a
Solver
question) No
What is Problem?
Decidable
Solvable
Not
Problem
decidable
Not
Solvable
MEMBERSHIP PROBLEM
Membership is a property to verify an arbitrary string is accepted by a finite automata or not i.e. it is
a member of the language or not.
Let L is a finite automata that accepts some strings over an alphabet, and let ‘w’ be any string
defined over the alphabet
Approach :
1. Construct a DFA for L
2. Run w on DFA(L)
3. If there exist a transition path in L, which starts at initial state & ends in anyone of the final
state, then string ‘w’ is a member of L
4. Else ‘w’ is not a member of L
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
Next
Symbol
0 0,1
Start 1 1
A B C
Current
State
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
Next
Symbol
0 0,1
Start 1 1
A B C
Current
State
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
Next
Symbol
0 0,1
Start 1 1
A B C
Current
State
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
Next
Symbol
0 0,1
Start 1 1
A B C
Current
State
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
Next
Symbol
0 0,1
Start 1 1
A B C
Current
State
MEMBERSHIP PROBLEM
Example :
0 1 0 1 1
0 0,1
Start 1 1
A B C
Current
State
As binary string doesn’t ends in final state, given string is not member of given language
EMPTINESS PROBLEM
Emptiness is a property to check whether finite automata accepts empty language or non-empty
language.
Decision problem : Does finite automata accepts empty language or not? i.e. L = Ø ?
Approach :
1. Construct a DFA for L
2. Select the state that cannot be reached from the initial states & delete them
(remove unreachable states)
3. If there exists at least one final state that is reachable from start state, then the finite
automata accepts the non-empty language
4. Otherwise, finite automata accepts the empty language
EMPTINESS PROBLEM
Example :
1
0
q1 1
0,1
Start
q0 1
q3
0
q2
As there exists path from start state to final state, finite automata accepts non-empty language
FINITENESS PROBLEM
Finiteness is a property to check whether finite automata accepts finite language or not i.e. is
language finite or infinite.
Approach :
1. Construct a DFA for L
2. select the state that cannot be reached from the initial state & delete them (remove
unreachable states)
3. select the state from which final states are not reachable & delete them (remove dead
states)
4. In the resultant finite automata if there exist any loop, then language is infinite
5. Otherwise, Language is finite
FINITENESS PROBLEM
Example 1: Is the language of this DFA finite or infinite?
0
q2 0
0,1
0 1 0,1
q3
q6 1
FINITE
FINITENESS PROBLEM
Example 2: Is the language of this DFA finite or infinite?
0
q2 0
0,1
1 0
q3
1 due to this
INFINITE
EQUIVALENCE PROBLEM
Equivalence is a property to check whether two finite automata accepts same language or not.
Approach :
1. Construct a DFA(L1) and DFA(L2)
2. Make pair of every final states and every non-final states
3. Make a comparison table and look 1-hop away for every state
4. If output of all the final states and all non-final states is equal, then two finite automata
accepts same language
5. Otherwise, it accepts different languages
EQUIVALENCE PROBLEM
Example : Are two languages equal ?
2 0 2
1 C D 0
2 2
0 A B 1 0
1
1
2
0 E
Non-final state : A Non-final states : C, D
Final state : B Final state : E
1
Both languages are same, as output for pair of every non-final state is equal
EQUIVALENCE PROBLEM
Another Approach :
1. Construct a DFA(L1) and DFA(L2)
2. Reduce them to their minimal DFAs, MinDFA(L1) and MinDFA(L2)
3. If MinDFA(L1) = MinDFA(L2), then L1 = L2
4. Else L1 ≠ L2
HOW TO MINIMIZE DFA?
Approach :
1. Construct a DFA(L1)
2. Eliminate states that are unreachable from the start state
3. Identify and remove equivalent states using Table filling algorithm
4. Output is the minimal DFA
TABLE FILLING ALGORITHM
A =
B =
C =
D =
E X X X X =
F X =
G X =
1. Mark X between accepting vs. non-accepting state H X =
A B C D E F G H
TABLE FILLING ALGORITHM
A =
B =
C X =
D X =
E X X X X =
F X X =
G X X =
1. Mark X between accepting vs. non-accepting state H X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B =
C X X =
D X X =
E X X X X =
F X X X =
G X X X =
1. Mark X between accepting vs. non-accepting state H X X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B =
C X X =
D X X X =
E X X X X =
F X X X X =
G X X X X =
1. Mark X between accepting vs. non-accepting state H X X = X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B =
C X X =
D X X X =
E X X X X =
F X X X X X =
G X X X = X =
1. Mark X between accepting vs. non-accepting state H X X = X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B =
C X X =
D X X X =
E X X X X =
F X X X X X =
G X X X = X X =
1. Mark X between accepting vs. non-accepting state H X X = X X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B =
C X X =
D X X X =
E X X X X =
F X X X X X =
G X X X = X X =
1. Mark X between accepting vs. non-accepting state H X X = X X X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
TABLE FILLING ALGORITHM
A =
B = =
C X X =
D X X X =
E X X X X =
F X X X X X =
G X X X = X X =
1. Mark X between accepting vs. non-accepting state H X X = X X X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
A =
B = =
C X X =
D X X X =
E X X X X =
F X X X X X =
G X X X = X X =
1. Mark X between accepting vs. non-accepting state H X X = X X X X =
A B C D E F G H
2. Look 1- hop away for distinguishing states or strings
(Minimal DFA)
Equivalences :
•A=B
•C=H
•D=G
REFERENCES
• http://infolab.stanford.edu/~ullman/ialc/spr10/slides/rs1.pdf
• https://swaminathanj.github.io/fsm/rlproperties.html
• https://www.youtube.com/watch?v=9B0i9GuFFwk
• https://www.geeksforgeeks.org/closure-properties-of-regular-languages/
• https://eecs.wsu.edu/~ananth/CptS317/Lectures/RegularLanguageProperties.pdf
THANK
YOU