Contents
1
1
2
I WORDS AND LANGUAGES
4
4
5
9
10
12
13
15
16
II REGULAR LANGUAGES
1.1 Words and Alphabets
1.2 Languages
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
Regular Expressions and Languages
Finite Automata
Separation of Words. Pumping
Nondeterministic Finite A
iii
addition, surveys of Lindenmayer system theory and the mathematical theory of codes are
given. As a somewhat uncommon topic, an overview of formal power series is included.
Apart from being a nice algebraic alternative formalism, they give a mechanism
ii
68
68
68
71
VIII LINDENMAYERS SYSTEMS
73
73
73
75
78
83
85
85
85
87
88
89
IX FORMAL POWER SERIES
8.1 Introduction
8.2 Context-Free L-Systems
8.3 Context-Sensitive L-Systems or L-Systems with Interaction
9.1 Language as a Formal Power Series
9.2 Semirin
Chapter 1
WORDS AND LANGUAGES
1.1
Words and Alphabets
A word (or string) is a nite sequence of items, so-called symbols or letters chosen from a
specied nite set called the alphabet. Examples of common alphabets are e.g. letters in
the Finnish alphabet (+
CHAPTER 1. WORDS AND LANGUAGES
2
Especially w 1 = w and w 0 = , and always n = .
The mirror image (or reversal) of the word w = a1 a2 an is the word
w = an a2 a1 ,
especially = . Clearly we have w1 w2 = w2 w1 . A word u is a prex (resp. sux) of the
word
3
CHAPTER 1. WORDS AND LANGUAGES
and especially L1 = L and L0 = cfw_. In particular 0 = cfw_! The concatenation closure
or Kleenean star of the language L is
L =
Ln ,
n=0
i.e., the set obtained by concatenating words of L in all possible ways, including t
Some people, when confronted with
a problem, think I know, Ill use
regular expressions. Now they
have two problems.
(Jamie Zawinski)
Chapter 2
REGULAR LANGUAGES
2.1
Regular Expressions and Languages
A regular expression is a formula which denes a language
CHAPTER 2. REGULAR LANGUAGES
5
is agreed on, then a lot of parentheses can be omitted, and for example a+b c can be used
instead of the full expression (a+(b )c). It is also often customary to identify a regular
expression with the language it denes, e.g.
6
CHAPTER 2. REGULAR LANGUAGES
where always qji+1 = (qji , ai+1 ). In a similar fashion the transition function can be
extended to a function for words recursively as follows:
1. (qi , ) = qi
2. For the word w = ua, where a is a symbol, (qi , w) = (qi , u