Problem Solving in Automata, Languages, and Complexity

(Dana P.) #1
1.2 Regular Languages 9

To further reduce the number of parentheses in a regular expression, we

apply the following preference rules to a non-fully parenthesized regular ex-

pression:

(1) Kleene closure has the higher preference over union and concatenation.

(2) Concatenation has the higher preference over union.

In other words, we interpret a regular expression like an arithmetic ex-

pression, treating union like addition, concatenation like multiplication, and

Kleene closure like exponentiation. (This is exactly why we use the symbol

+ for union, the symbol l for concatenation, and the symbol * for Kleene

closure.) Using these rules, we can simplify the above two regular expressions

to rA = 0 and rg = (OO) +O, respectively. The regular expression (1.1) can

also be simplified to

(0" +100)10(01 +l).


In addition, like the operations + and l in an arithmetic expression, the

operations + and. in a regular expression satisfy the distributive Zuw: For any

regular expressions T, s and t,

r(s + t) = 7-s + rt,


(r + s)t = 7-t + st.

(See Exercises 5(c), 5(d) of Section 1.1.)

A regular language may have several regular expressions. For example,

both 0 1 + 8 and Ol represent the same regular set {O}*{ 1). The following


are some examples of identities about regular expressions. (When there is no

risk of confusion, we use the Roman letter a to denote both the symbol a in

the alphabet of the language and the regular expression representing the set

w l >


Example 1.12 ~(a+ b) = (u+ bu).


Proof. We show that both sides are equal to (a + b)*.

Clearly, both sides are subsets of (a + b) since (a + b) contains all strings

over alphabet {a, b). Thus, it suffices to show that both sides contain (u+ b)‘.

Since E E u, we have u (a + b) 3 (a + b)“. Also, b E bu and it follows that

(u+ b) c - (u+ bu)*. -^0

For convenience, we define an additional notation: r+ = rr*.

Example 1.13 (bu)+(ub + a) = (bu)bu+b*.


Proof. (bu)+(ub + a) = (bu)(bu)u(b +E) = (bu)bu+b. Cl

Regular expressions can be a convenient notation to represent regular lan-

guages, if one knows how to construct them. The following examples demon-

strate some ideas.
Free download pdf