; (Basis) is; and a are not. (Induction) E + F is i - - PDF document

basis is and a are not induction e f is i b oth e and f
SMART_READER_LITE
LIVE PREVIEW

; (Basis) is; and a are not. (Induction) E + F is i - - PDF document

Decision Prop erties of Regular Languages Giv en a (represen tation, e.g., RE, F A, of a) regular language L , what can w e tell ab out L ? Since there are algorithms to con v ert b et w een an y t w o


slide-1
SLIDE 1 Decision Prop erties
  • f
Regular Languages Giv en a (represen tation, e.g., RE, F A,
  • f
a) regular language L, what can w e tell ab
  • ut
L?
  • Since
there are algorithms to con v ert b et w een an y t w
  • represen
tations, w e can c ho
  • se
the rep that mak es the test easiest. Mem b ership Is string w in regular language L?
  • Cho
  • se
DF A represen tation for L.
  • Sim
ulate the DF A
  • n
input w . Emptiness Is L = ;?
  • Use
DF A represen tation.
  • Use
a graph-reac habilit y algorithm to test if at least
  • ne
accepting state is reac hable from the start state. Finiteness Is L a nite language?
  • Note
ev ery nite language is regular (wh y?), but a regular language is not necessarily nite. DF A metho d:
  • Giv
en a DF A for L, eliminate all states that are not reac hable from the start state and all states that do not reac h an accepting state.
  • T
est if there are an y cycles in the remaining DF A; if so, L is innite, if not, then L is nite. RE metho d: Almost, w e can lo
  • k
for a
  • in
the RE and sa y its language is innite if there is
  • ne,
nite if not. Ho w ev er, there are exceptions, e.g.
  • 1
  • r
  • ;.
Th us: 1. Find sub expressions equiv alen t to ; b y:

(Basis) ; is;
  • and
a are not.

(Induction) E + F is i b
  • th
E and F are; E F is if either E
  • r
F are; E
  • nev
er is. 2. Eliminate sub expressions equiv alen t to ; b y:

Replace E + F
  • r
F + E b y F whenev er E is and F isn't.

Replace E
  • b
y
  • whenev
er E is equiv alen t to ;. 1
slide-2
SLIDE 2 3. No w, nd sub expressions that are equiv alen t to
  • b
y:

(Basis)
  • is;
a isn't.

(Induction) E + F is i b
  • th
E and F are; ditto E F ; E
  • is
i E is. 4. No w, w e can tell if L(R) is innite b y lo
  • king
for a sub expression E
  • suc
h that E is not equiv alen t to . Example Consider (0 + 1;)
  • +
1;
  • .
  • Step
1: ; (t wice) and 1; are sub expressions equiv alen t to ;.
  • Step
2:
  • +
1 remains.
  • Step
3:
  • nly
sub expression
  • is
equiv alen t to .
  • Since
is starred, language is innite. Minimization
  • f
States
  • Real
goal is testing equiv alence
  • f
(reps
  • f
) t w
  • regular
languages.
  • In
teresting fact: DF A's ha v e unique (up to state names) minim um
  • state
equiv alen ts.

But pro
  • f
in course reader do esn't quite get to that p
  • in
t. Distingu ish abl e States Key idea: nd states p and q that are distinguishable b ecause there is some input w that tak es exactly
  • ne
  • f
p and q to an accepting state.
  • Basis:
an y nonaccepting state is distinguishable from an y accepting state (w = ).
  • Induction:
p and q are distinguishable if there is some input sym b
  • l
a suc h that
  • (p;
a) is distinguishable from
  • (q
; a).

All
  • ther
pairs
  • f
states are indistinguishable, and can b e merged in to
  • ne
state. Example (V ery Simple) Consider: 2
slide-3
SLIDE 3 1 1 1 Start p q r
  • p
is distinguishable from q and r b y basis. Can w e distinguish q from r ?
  • No
string b eginning with w
  • rks,
b ecause b
  • th
states go to p, and therefore an y string
  • f
the form 0x tak es q and r to the same state.
  • No
string b eginning with 1 w
  • rks.

T ec hnically ,
  • (q
; 1) = r and
  • (r
; 1) = q are not distinguishable. Th us, induction do es not tell us q and r are distinguishable.

What happ ens is that, starting in either q
  • r
r , as long as w e ha v e inputs 1, w e are in
  • ne
  • f
the accepting states, and when a is read, w e go to the same state forev er after. Constructing the Minim um-S tat e DF A
  • F
  • r
eac h group
  • f
indistinguishable states, pic k a \represen tativ e."

Note a group can b e large, e.g., q 1 ; q 2 ; : : : ; q k , if all pairs are indistinguishable.

Indistinguishabilit y is transitiv e (wh y?) so indistinguishabilit y partitions states.
  • If
p is a represen tativ e, and
  • (p;
a) = q , in minim um
  • state
DF A the transition from p
  • n
a is to the represen tativ e
  • f
q 's group (to q itself if q is either alone in a group
  • r
a represen tativ e).
  • State
state is represen tativ e
  • f
the
  • riginal
start state.
  • Accepting
states are represen tativ es
  • f
groups
  • f
accepting states.

Notice w e could not ha v e a \mixed" (accepting + nonaccepting) group (wh y?). 3
slide-4
SLIDE 4
  • Delete
an y state that is not reac hable from the start state. Example F
  • r
the DF A ab
  • v
e, p is in a group b y itself; fq ; r g is the
  • ther
group. Start p 0,1 q r 1 Wh y Ab
  • v
e Minimizati
  • n
Can't b e Beaten Supp
  • se
w e ha v e a DF A A, and w e minim ize it to construct a DF A M . Y et there is another DF A N that accepts the same language as A and M , y et has few er states than M . Pro
  • f
con tradiction that this can't happ en:
  • Run
the state-distinguishabilit y pro cess
  • n
the states
  • f
M and N together.
  • Start
states
  • f
M and N are indistinguishable b ecause L(M ) = L(N ).
  • If
fp; q g are indistinguishable, then their successors
  • n
an y
  • ne
input sym b
  • l
are also indistinguishable.
  • Th
us, since neither M not N could ha v e an inaccessible state, ev ery state
  • f
M is indistinguishable from at least
  • ne
state
  • f
N .
  • Since
N has few er states than M , there are t w
  • states
  • f
M that are indistinguishable from the same state
  • f
N , and therefore indistinguishable from eac h
  • ther.
  • But
M w as designed so that all its states ar e distinguishable from eac h
  • ther.
  • W
e ha v e a con tradiction, so the assumption that N exists is wrong, and M in fact has as few states as an y equiv alen t DF A for A.
  • In
fact (stronger), there m ust b e a 1-1 corresp
  • ndence
b et w een the states
  • f
an y
  • ther
minim um
  • state
N and the DF A M , sho wing that the minim um
  • state
DF A for A is unique up to renaming
  • f
the states. 4