
< previous page page_136 next page >
Page 136
(2)
Let be two disjoint subsets of our alphabet A, and let and be two local
languages. Then L
1
L
2
is a local language
.
Let A1=
(Q
1
, A
1
, i
1
, δ
1
, T
1
)
be a standard local automaton recognising
L
1 and let A2=
(Q
2
, A
2
, i
2
, δ
2
,
T
2
)
be a standard local automaton recognising
L
2. We construct a standard local automaton A=
(Q, A, i,
δ, T)
recognising
L
1
L
2 as follows. The set of states is the set (
Q
1+
Q
2)\
{i
2
}
and the initial state is
i
1.
The transitions consist of all the transitions of A1, all the transitions of A2 that do not begin at
i
2
,
together with the following new transitions: if and if is a transition of A2. The
set of terminal states is
T
2 if and is if . It is easy to check that A is a
standard local automaton accepting
L
1
L
2. This construction is simply a variant of the construction used
to prove Proposition 3.3.4.
(3)
Let L be a local language. Then L
*
is a local language
.
Let A=
(Q, A, i, δ, T)
be a standard local automaton recognising
L
. Define as
follows: the transitions of A′ consist of all the transitions of A together with the transitions
where
and where is a transition in A. Then A′ is a standard local automaton recognising
L
*. This
construction is simply a variant of the one used to prove Proposition 3.3.6.
We can now prove our claim that if
r
is linear then
L(r)
is local. We do so by induction on the number of
operators in
r
. The languages
, ε,
and
a
where are each local. Suppose that all linear regular
expressions with at most
n
operators represent local languages. Let
r
be a regular linear expression with
n
+1 operators. We prove that
L(r)
is local. The expression
r
has one of three possible forms:
r
=
s
+
t,
r
=
st,
or
r
=
s
*. Clearly
s
and
t
are both linear regular expressions with at most
n
operators apiece. Let
B
be the set of letters occurring in
s
and
C
be the set of letters occurring in
t
. Then since
r
is linear
B
and
C
are disjoint. It follows from results (1) and (2) above that
L(r)
=
L(s)
+
L(t)
and
L(r)
=
L(s)L(t)
are both
local. The fact that
L(r)
=
L(s)
* is local follows by result (3).
The above theorem suggests the following algorithm.
Algorithm 6.2.2 This algorithm takes as input a regular expression
r,
and produces as output a non-
deterministic automaton A recognising
L(r)
. First, linearise
r
to obtain a linear regular expression
r′
.
Then construct a standard local automaton A′ recognising
L(r′)
. Finally, convert A′ into a non-
deterministic automaton A by relabelling the edges of A′.
This algorithm will be complete if we can find an algorithm for constructing the automaton described in
Theorem 6.1.4 from a linear regular expression
r
. This requires that we construct the sets
P(L(r)),
S(L(r)),
and
F(L(r));
in addition, we need to know whether . To do this we shall use the
following definitions. Let
A
be an alphabet and let
r
be a regular expression over
A
. We make the
following definitions:
< previous page page_136 next page >