Pullen - Reversal of language.pptx

advertisement
Reversal of a
Language
By:
Travis Pullen
Paper
•
•
Reversal of regular languages and state complexity
By: Juraj Sebej
History
•
•
Goes back to the early 40’s and 50’s
• FA’s
• NFA’s
• DFA’s
Research has intensified in recent years
State Complexity
•
The state complexity of a regular language is the
number of states in its minimal dfa. A regular language
with deterministic state complexity n is called an n-state
dfa language.
DFA
•
•
Deterministic Finite Automata
Finite state machine
• accepts/rejects
• produces a unique computation
• must have an input symbol to transition from state to state
NFA
•
•
•
Non-Deterministic Finite Automata
Were introduced by Micheal O. Rabin and Dana Scott in 1958
An NFA can be converted into an equivalent DFA
• Does not have to follow the same rules as a DFA
Brief Review
•
Converting an NFA to a DFA
0
^
-0
1
0
1
0,1
2
1
State
0
1
Z1: 0
0,1 : Z2
empty
Z2: 0,1
0,1,2 : Z3
2 : Z4
Z3 : 0,1,2
0,1,2 : Z3
0,2 : Z5
Z4 : 2
empty
0,2 : Z5
Z5 : 0,2
1,0 : Z2
0,2 : Z5
Converted
Empty
0
1
Z1
0
Z2
1
Z4
0
0
Z5
1
Z6
1
Normal FA (DFA)
•
•
We normally read machines from left to right
For a reversal we are going to be reading the machines
from right to left
Example
•
DFA
1
—
0
0
0
0,1
1
+
1
Closed?
•
•
Now we know that languages are closed under union,
intersection, and complement
Is it closed under the reversal?
Closed Reversal
•
If a language can be recognized by a DFA that reads
strings from right to left, then there is a “normal” DFA
that accepts the same language.
Reversal of a Language
•
•
The reversal wR of a string w is defined as follows: εR = ε
and if w = a1a1 ···an with ai∈Σ, then wR=anan−1···a2a1. The
reversal of a language L is the language LR={wR|w∈L}.
The reversal of a dfa A = (Q,Σ,δ,s,F) is the nfa AR obtained
from A by reversing all transitions and by swapping the
role of starting and accept(-ing) states, that is AR = 􏰁Q, Σ,
δR, F, {s}􏰁, where δR(q,a)={p∈Q: δ(p,a)=q}.
How to get the Reversal
•
•
Assume that L is a regular language
• Let M be the DFA that recognizes the language L
So we need a DFA, MR that will accepts LR
Example
1
—
0
0
0
0,1
1
+
1
Example
0
1
+
0
1
0
0,1
1
—
Converted Reversal
•
Called the subset automaton
State
0
1
Z1
1 : Z1
1,2 : Z2
Z2
1,2,3 : Z3
1,2 : Z2
Z3
1,2,3,4 : Z4
1,2 : Z2
Z4
1,2,3,4 : Z4
1,2,3,4 : Z4
0
Z1
1
1
0,1
Z2
0
Z4
1
Z3
0
Sources
•
•
•
•
http://upload.wikimedia.org/wikipedia/commons/thumb/0
/0e/NFAexample.svg/250px-NFAexample.svg.png
http://upload.wikimedia.org/wikipedia/commons/thumb/9
/94/DFA_example_multiplies_of_3.svg/250pxDFA_example_multiplies_of_3.svg.png
Cohen, Daniel I. A. Introduction to Computer Theory.
2nd ed. New York: Wiley, 1986. Print.
Sebej, Juraj. "Reversal of Regular Languages and State
Complexity." Http://ceur-ws.org/Vol-683/paper8.pdf.
Theoretical Computer Science, 31 Aug. 2012. Web. 6
May 2015.
Questions?
Download