But can app ear on arcs, and means the empt y string - - PDF document

but can app ear on arcs and means the empt y string i e
SMART_READER_LITE
LIVE PREVIEW

But can app ear on arcs, and means the empt y string - - PDF document

Finite Automata With -T ransition s Allo w to b e a lab el on arcs. Nothing else c hanges: acceptance of w is still the existence of a path from the start state to an accepting state with lab el


slide-1
SLIDE 1 Finite Automata With
  • T
ransition s Allo w
  • to
b e a lab el
  • n
arcs.
  • Nothing
else c hanges: acceptance
  • f
w is still the existence
  • f
a path from the start state to an accepting state with lab el w .

But
  • can
app ear
  • n
arcs, and means the empt y string (i.e., no visible con tribution to w ). Example Start q r s 1 1
  • 001
is accepted b y the path q ; s; r ; q ; r ; s, with lab el 001 = 001. Eliminati
  • n
  • f
  • T
ransitions
  • transitions
are a con v enience, but do not increase the p
  • w
er
  • f
F A's. T
  • eliminate
  • transitions:
1. Compute the transitiv e closure
  • f
the
  • arcs
  • nly
.

Example: q r s
  • q
! fq g; r ! fr ; sg; s ! fr ; sg. 2. If a state p can reac h state q b y
  • arcs,
and there is a transition from q to r
  • n
input a (not ), then add a transition from p to r
  • n
input a. 3. Mak e state p an accepting state if p can reac h some accepting state q b y
  • arcs.
4. Remo v e all
  • transitions.
1
slide-2
SLIDE 2 Example Start q r s 1 0,1 0,1 Regular Expressions An algebraic equiv alen t to nite automata.
  • Used
in man y places as a language for describing simple but useful patterns in text. Op erators and Op erands If E is a regular expression, then L(E ) denotes the language that E stands for. Expressions are built as follo ws:
  • An
  • p
erand can b e: 1. A v ariable, standing for a language. 2. A sym b
  • l,
standing for itself as a set
  • f
strings, i.e., a stands for the language fag (formally , L(a) = fag). 3. , standing for fg (a language). 4. ;, standing for ; (the empt y language).
  • The
  • p
erators are: 1. +, standing for union. L(E + F ) = L(E ) [ L(F ). 2. Juxtap
  • sition
(i.e., no
  • p
erator sym b
  • l,
as in xy to mean x
  • y
) to stand for c
  • nc
atenation. L(E F ) = L(E )L(F ), where the concatenation
  • f
languages L and M is fxy j x is in L and y is in M g. 3.
  • to
represen t closur e. L(E
  • )
=
  • L(E
)
  • ,
where L
  • =
fg [ L [ LL [ LLL [
  • .
  • P
aren theses ma y b e used to alter grouping, whic h b y default is
  • (highest
precedence), then concatenation, then union (lo w est precedence). 2
slide-3
SLIDE 3 Examples
  • L(001)
= f001g.
  • L
  • +
10
  • )
= f0; 1; 10; 100; 100 0; : : : g.
  • L
  • 0(0
+ 1)
  • =
the set
  • f
strings
  • f
0's and 1's,
  • f
ev en length, suc h that ev ery
  • dd
p
  • sition
has a 0. Equiv alence
  • f
F A Languages and RE Languages
  • W
e'll sho w an NF A with
  • transitions
can accept the language for a RE.
  • Then,
w e sho w a RE can describ e the language
  • f
a DF A (same construction w
  • rks
for an NF A).
  • The
languages accepted b y DF A, NF A,
  • NF
A, RE are called the r e gular languages. RE to
  • NF
A
  • Key
idea: construction
  • f
an
  • NF
A with
  • ne
accepting state is b y induction
  • n
the heigh t
  • f
the expression tree for the RE.
  • Pictures
  • f
the basis and inductiv e constructions are in the course reader. Example W e'll go
  • v
er the general construction in class and w
  • rk
the example
  • f
  • 0(0
+ 1 )
  • .
F A-to-RE Construction Tw
  • algorithms:
1. State elimination : giv es smaller expression, in general, and easier to apply . Co v ered in course reader. 2. A simple, inductiv e construction, whic h w e'll do here (also in reader).
  • Let
A b e a F A with states 1; 2; : : : ; n.
  • Let
R (k ) ij b e a RE whose language is the set
  • f
lab els
  • f
paths that go from state i to state j without p assing thr
  • ugh
an y state n um b ered ab
  • v
e k .
  • Construction,
and the pro
  • f
that the expressions for these RE's are correct, are inductions
  • n
k . Basis : k = 0. P ath can't go through any states. 3
slide-4
SLIDE 4
  • Th
us, path is either an arc
  • r
the n ull path (a single no de).
  • If
i 6= j , then R (0) ij is the sum
  • f
all sym b
  • ls
a suc h that A has a transition from i to j
  • n
sym b
  • l
a (; if none).
  • If
i = j , then add
  • to
ab
  • v
e. Induction : Assume w e ha v e correctly dev elop ed expressions for the R (k 1) 's. Then for the R (k ) 's:
  • R
(k ) ij = R (k 1) ij + R (k 1) ik (R (k 1) k k )
  • R
(k 1) k j Pr
  • f
it works : A path from i to j that go es through no state higher than k either: 1. Nev er go es through k , in whic h case the path's lab el is (b y the IH) in the language
  • f
R (k 1) ij ,
  • r
2. Go es through k
  • ne
  • r
more times. In this case:

R (k 1) ik con tains the p
  • rtion
  • f
the path that go es from i to k for the rst time.

(R (k 1) k k )
  • con
tains the p
  • rtion
  • f
the path (p
  • ssibly
empt y) from the rst k visit to the last.

R (k 1) k j con tains the p
  • rtion
  • f
the path from the last k visit to j . Final step : The RE for the en tire F A is the sum (union)
  • f
the RE's R (n) ij , where i is the start state and j is
  • ne
  • f
the accepting states.
  • Note
that sup erscript (n) represen ts no restriction
  • n
the path at all, since n is the highest-n um b ered state. Example The follo wing is the \clamping" automaton, with states named b y in tegers: 1 1 0,1 Start 3 1 2 Some basis expressions:
  • R
(0) 11 = . 4
slide-5
SLIDE 5
  • R
(0) 12 = 1.
  • R
(0) 22 =
  • +
+ 1.
  • R
(0) 31 = 1.
  • R
(0) 32 = R (0) 21 = ;. Tw
  • inductiv
e examples:
  • R
(1) 32 = R (0) 32 + R (0) 31 (R (0) 11 )
  • R
(0) 12 = ; + 1
  • 1
= 11.

Uses algebr aic laws:
  • =
; R = R = R ( is the iden tit y for con tatenation); ; + R = R + ; = R (; is the iden tit y for union).
  • R
(1) 22 = R (0) 22 + R (0) 21 (R (0) 11 )
  • R
(0) 12 =
  • +
+ 1 + ;
  • 1
=
  • +
+ 1.

Additional algebraic la w used: ;R = R; = ; (; is the annihilator for concatenation). 5