Cis 262 SL 1
Cis 262 SL 1
Jean Gallier
Introduction
3
4 CHAPTER 1. INTRODUCTION
Remember:
• An automaton recognizes (or accepts) a language,
• a grammar generates a language.
• grammar is spelled with an “a” (not with an “e”).
• The plural of automaton is automata
(not automatons).
Inductive closures.
N, Z, Q, R, C.
The integers,
Z = {. . . , −2, −1, 0, 1, 2, . . .}.
The rationals,
! "
p
Q= | p, q ∈ Z, q ̸= 0 .
q
The reals, R.
11
12 CHAPTER 2. BASICS OF FORMAL LANGUAGE THEORY
The notation
f: X →Y
denotes a function with domain X and range
(or codomain) Y .
If B ⊆ Y , then
f −1(B) = {x ∈ X | f (x) ∈ B} ⊆ X
is the inverse image (or pullback ) of B.
Note: r is surjective.
Note: s is injective.
16 CHAPTER 2. BASICS OF FORMAL LANGUAGE THEORY
dom(R) = {x ∈ X | ∃y ∈ Y, (x, y) ∈ R} ⊆ X
is the domain of R.
range(R) = {y ∈ Y | ∃x ∈ X, (x, y) ∈ R} ⊆ Y
is the range of R.
IX = {(x, x) | x ∈ X}
is the identity relation on X.
A relation R ⊆ X × X is transitive iff R ◦ R ⊆ R.
2.1. REVIEW OF SOME BASIC MATH NOTATION AND DEFINITIONS 19
A relation R ⊆ X × X is reflexive iff IX ⊆ R.
Examples:
Σ = {a}
Σ = {a, b, c}
Σ = {0, 1}
Σ = {α, β, γ, δ, ϵ, λ, ϕ, ψ, ω, µ, ν, ρ, σ, η, ξ, ζ}
2.2. ALPHABETS, STRINGS, LANGUAGES 23
u : [n] → Σ.
u = u1 u2 · · · un ,
with each ui ∈ Σ.
u0 = ϵ
un+1 = unu (n ≥ 0).
2.2. ALPHABETS, STRINGS, LANGUAGES 27
For example
ab ≼ b, gallhager ≼ gallier.
For example
reillag = gallierR.
Similarly
ϵ,
0
a, b,
1, 2,
aa, ab, ba, bb,
3, 4, 5, 6,
aaa, aab, aba, abb, baa, bab, bba, bbb
7, 8, 9, 10, 11, 12, 13, 14
ν(bab) = 2 · 22 + 1 · 21 + 2 = 8 + 2 + 2 = 12.
It works!
∗
On the other hand, if Σ ̸= ∅, the set 2Σ of all subsets of
Σ∗ (all languages) is uncountable.
2.2. ALPHABETS, STRINGS, LANGUAGES 39
L = {w ∈ Σ∗ | w ∈
/ L}.
L0 = {ϵ},
Ln+1 = LnL (n ≥ 0).
L∅ = ∅,
∅L = ∅,
L{ϵ} = L,
{ϵ}L = L,
(L1 ∪ {ϵ})L2 = L1L2 ∪ L2,
L1(L2 ∪ {ϵ}) = L1L2 ∪ L1,
LnL = LLn.
L∗ = L0 ∪ L1 ∪ L2 ∪ . . . ∪ Ln ∪ . . . ,
L+ = L1 ∪ L2 ∪ . . . ∪ Ln ∪ . . . .
In fact,
L+ = {w ∈ Σ∗, ∃n ≥ 1,
∃u1 ∈ L · · · ∃un ∈ L, w = u1 · · · un},
L∗ = {ϵ} ∪ {w ∈ Σ∗, ∃n ≥ 1,
∃u1 ∈ L · · · ∃un ∈ L, w = u1 · · · un}.
L∗ = L+ ∪ {ϵ}.
2.3. OPERATIONS ON LANGUAGES 47
∅∗ = {ϵ},
L+ = L∗L,
L∗ ∗ = L∗ ,
L∗ L∗ = L∗ .
Letting u = v = ϵ, we get
h(ϵ) = h(ϵ)h(ϵ),
h(ϵ) = ϵ.
For example
h(abbc) = 010110110111.
2.3. OPERATIONS ON LANGUAGES 49