Question: To prove that regular languages are closed under f ( L ) , where f ( L ) = { w in L | no
To prove that regular languages are closed under f L where
f Lw in L no proper prefix of w is in L
we can use existing closure properties, build a DFA and prove it does recognize
the language.
Let P be the language which consists of proper prefixes of all strings in Le
P w in L all proper prefixes of w
P
w in L
prefixesw
Here, prefixesw represents the set of all proper prefixes of w
f L can be expressed as the set difference of L and P
f L LP
Construct a DFA, M for P :
For each string w in L modify the DFA for L to accept all proper prefixes
of w This can be achieved by marking the states that correspond to
proper prefixes as accepting states.
The resulting DFA recognizes the set of all strings with a proper prefix in
L
Construction of M :
States: Q
Initial State:
Accepting States:
Transition Function:
since L and P are regular, fL is also regular since regular languages are closed under set difference
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
