You are on page 1of 109

Informática Teórica

Andrés A. Aristizábal P.
aaaristizabal@icesi.edu.co

Departamento de Matemáticas y Estadística

2019-1

1 / 47
Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

2 / 47
Finite State Machines Previous Exercises

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

3 / 47
Finite State Machines Previous Exercises

Exercises

Exercise
Present a state table of a Moore machine that accepts just those
strings accepted by the following Mealy machine.

0 1
A A1 B1
B C1 D0
C B0 C0
D D1 A1

4 / 47
Finite State Machines Previous Exercises

Exercises

Exercise
Construct a Mealy machine similar to the following Moore machine.

0 1
A B C 0
B C B 1
C A C 0

5 / 47
Finite State Machines Aims

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

6 / 47
Finite State Machines Aims

Aims

Know when two states are equivalent.


Understand the implication of two states being equivalent.
Understand the concept of a reduced machine.
Know the meaning of an accessible state and a connected
automaton.
Understand the concepts of distinguishable states,
k −distinguishable, equivalent and k −equivalent.
Recognize and understand the partitioning algorithm, the
procedure for building reduced machines and the mechanism to
show equivalence between automata.

7 / 47
Finite State Machines Discussion

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

8 / 47
Finite State Machines Discussion

Discussion about the reading material

Concept map presentation

9 / 47
Finite State Machines Review of the previous topic

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

10 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
for each s ∈ S, g(q, s) = g(q 0 , s).

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
for each s ∈ S, g(q, s) = g(q 0 , s).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
for each s ∈ S, g(q, s) = g(q 0 , s).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
for each s ∈ S, g(q, s) = g(q 0 , s).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk
2 For each s ∈ S their s−successors f (q, s) and f (q 0 , s) are in the
same block of Pk .

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Mealy machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
for each s ∈ S, g(q, s) = g(q 0 , s).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk
2 For each s ∈ S their s−successors f (q, s) and f (q 0 , s) are in the
same block of Pk .
Step 3. Repeat step 2 until Pm+1 = Pm for some m. We call Pm the final
partition of Q.

11 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
h(q) = h(q 0 ).

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
h(q) = h(q 0 ).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
h(q) = h(q 0 ).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
h(q) = h(q 0 ).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk
2 For each s ∈ S their s−successors f (q, s) and f (q 0 , s) are in the
same block of Pk .

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is the partitioning algorithm for Moore machines?


Step 1. Form an initial partition P1 of Q by grouping together states that are
1−equivalent, that is, states that produce identical outputs for each
input symbol. States q and q 0 are in the same block of P1 if and only if,
h(q) = h(q 0 ).
Step 2. Obtain Pk +1 from Pk as follows: states q and q 0 are in the same block
of Pk +1 if and only if
1 They are in the same block of Pk
2 For each s ∈ S their s−successors f (q, s) and f (q 0 , s) are in the
same block of Pk .
Step 3. Repeat step 2 until Pm+1 = Pm for some m. We call Pm the final
partition of Q.

12 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Example
From the following state table of a Mealy machine, apply the partitioning procedure.

13 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Answer

14 / 47
Finite State Machines Review of the previous topic

Finite State Machines

How do we construct an equivalent reduced machine for a Mealy


automaton?

15 / 47
Finite State Machines Review of the previous topic

Finite State Machines

How do we construct an equivalent reduced machine for a Mealy


automaton?
Let M = (Q, R, S, f , g, q1 ) be a Mealy machine. We want to construct
an equivalent reduced machine M 0 = (Q 0 , S, R, f 0 , g 0 , q10 ). The states of
M 0 will represent the state equivalence classes of machine M; that is,
they will correspond to the blocks of the final partition Pf resulting from
applying the partitioning procedure to M. The initial state q10
corresponds to the block containing the initial state of M.

15 / 47
Finite State Machines Review of the previous topic

Finite State Machines

The state table of M 0 is obtained by applying two rules:

16 / 47
Finite State Machines Review of the previous topic

Finite State Machines

The state table of M 0 is obtained by applying two rules:


1 To find the s−successor of a state q 0 in M 0 select any state in the
block of the partition Pf corresponding to q 0 and find the block
containing its s−successor; the corresponding state of M 0 is the
s−successor of q 0 .

16 / 47
Finite State Machines Review of the previous topic

Finite State Machines

The state table of M 0 is obtained by applying two rules:


1 To find the s−successor of a state q 0 in M 0 select any state in the
block of the partition Pf corresponding to q 0 and find the block
containing its s−successor; the corresponding state of M 0 is the
s−successor of q 0 .
2 The output for an s−transition from state q 0 of M 0 is the output for
an s−transition from any state in the block corresponding to q 0 .

16 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Example
From the following state table of a Mealy machine, find its equivalent reduced
automaton.

17 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Answer
The first step is to apply the partitioning procedure on M.

18 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Answer
Each block belonging to the final partition Pf of M is a state of M 0 . That
is why we have to rename them.

19 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Answer
To find the s−successor of a state q 0 in M 0 , select any state in the block of the partition Pf
corresponding to q 0 and find the block containing its s−successor; the corresponding state of M 0
is the s−successor of q 0 . The output for an s−transition from state q 0 of M 0 is the output for an
s−transition from any state in the block corresponding to q 0 .

20 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Answer
Taking into account the new state table, we assign the new names to the blocks.

21 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is an isomorphism of equivalent machines?

22 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is an isomorphism of equivalent machines?


Definition
Let M1 and M2 be reduced, connected finite state machines. Then the
state graphs of M1 and M2 are isomorphic if and only if M1 and M2 are
equivalent.

22 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is a direct-sum machine?

23 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is a direct-sum machine?


Definition
Let M1 and M2 be finite state machines, and assume the state are so
named that Q1 ∩ Q2 = ∅. The direct-sum machine for M1 and M2 is the
result of considering the state graphs of M1 and M2 as constituting a
single machine with state set Q = Q1 ∪ Q2 . The initial state of the
direct-sum machine is unspecified. A state q in M1 is equivalent to a
state q 0 in M2 just if q and q 0 are equivalent in the direct-sum machine.

23 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is machine containment?

24 / 47
Finite State Machines Review of the previous topic

Finite State Machines

What is machine containment?


Definition
Let M1 and M2 be finite state machines. If each state in M1 is
equivalent to a state in M2 we say that M2 contains M1 .

24 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Procedure for deciding whether M1 ∼ M2 and, if so, for obtaining a


reduced machine M equivalent to M1 and M2 .

25 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Procedure for deciding whether M1 ∼ M2 and, if so, for obtaining a


reduced machine M equivalent to M1 and M2 .
Step 1. Eliminate states of M1 and M2 inaccessible from their
respective initial states.

25 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Procedure for deciding whether M1 ∼ M2 and, if so, for obtaining a


reduced machine M equivalent to M1 and M2 .
Step 1. Eliminate states of M1 and M2 inaccessible from their
respective initial states.
Step 2. Partition the state set of the direct-sum machine. Let Pf
denote the final partition.

25 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Procedure for deciding whether M1 ∼ M2 and, if so, for obtaining a


reduced machine M equivalent to M1 and M2 .
Step 1. Eliminate states of M1 and M2 inaccessible from their
respective initial states.
Step 2. Partition the state set of the direct-sum machine. Let Pf
denote the final partition.
Step 3. Ascertain whether each block of Pf contains at least one
state from each of M1 and M2 . If so, M1 ∼ M2 just if the
initial states of M1 and M2 are in the same block of Pf .

25 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Procedure for deciding whether M1 ∼ M2 and, if so, for obtaining a


reduced machine M equivalent to M1 and M2 .
Step 1. Eliminate states of M1 and M2 inaccessible from their
respective initial states.
Step 2. Partition the state set of the direct-sum machine. Let Pf
denote the final partition.
Step 3. Ascertain whether each block of Pf contains at least one
state from each of M1 and M2 . If so, M1 ∼ M2 just if the
initial states of M1 and M2 are in the same block of Pf .
Step 4. If M1 ∼ M2 , an equivalent reduced machine M, whose
states correspond to the blocks of Pf is given.

25 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Example
Prove the equivalence of the following Mealy machines.

26 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Example
We apply the direct sum between the automata

27 / 47
Finite State Machines Review of the previous topic

Finite State Machines

Example
We apply the partitioning algorithm on the direct sum result.

28 / 47
Finite State Machines Exercises

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

29 / 47
Finite State Machines Exercises

Exercises

Exercise
Consider the following machines M1 and M2 .

a) Reduce M1 . Find the minimum distinguishable sequence for states A and B in M1 .

30 / 47
Finite State Machines Exercises

Exercises

Exercise
Consider the following machines M1 and M2 .

b) Reduce M2 . Find the minimum distinguishable sequence for states A and B in M2 .

31 / 47
Finite State Machines Exercises

Exercises

Exercise
Consider the following machines M1 and M2 .

c) A is the initial for M1 and M2 Verify if these two are equivalent. If they are not find the
minimum distinguishable sequence for them.

32 / 47
Finite State Machines Exercises

Exercises

Exercise
Let M be the following automaton with state A as its initial state:

Give the state table representation for the reduced Moore machine equivalent to M.

33 / 47
Regular languages and finite automata Presentation of the following topic

Agenda

1 Finite State Machines


Previous Exercises
Aims
Discussion
Review of the previous topic
Exercises

2 Regular languages and finite automata


Presentation of the following topic

34 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is an alphabet?

35 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is an alphabet?
Definition
An alphabet is a non empty finite set whose elements are called
symbols. We denote an arbitrary alphabet with the letter Σ.

35 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is an alphabet?
Definition
An alphabet is a non empty finite set whose elements are called
symbols. We denote an arbitrary alphabet with the letter Σ.

What is a string or word?

35 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is an alphabet?
Definition
An alphabet is a non empty finite set whose elements are called
symbols. We denote an arbitrary alphabet with the letter Σ.

What is a string or word?


Definition
A string or word over an alphabet Σ is any finite sequence of elements
from Σ. We admit a string without any symbols, which is called the
empty string and is denoted by λ.

35 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
Let Σ = {a, b} be the alphabet which includes symbols a and b.

36 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
Let Σ = {a, b} be the alphabet which includes symbols a and b.
The following sequences are strings over Σ :

aba
ababaaa
aaaab

36 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
Let Σ = {a, b} be the alphabet which includes symbols a and b.
The following sequences are strings over Σ :

aba
ababaaa
aaaab

Since strings are defined as sequences, the order matters, therefore


we can see that aba 6= aab.

36 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?


Definition
Given an alphabet Σ and two strings such that u, v ∈ Σ∗ , we denote
the concatenation of u and v as u · v or simply uv .

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?


Definition
Given an alphabet Σ and two strings such that u, v ∈ Σ∗ , we denote
the concatenation of u and v as u · v or simply uv . We define this
operation in the following way:

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?


Definition
Given an alphabet Σ and two strings such that u, v ∈ Σ∗ , we denote
the concatenation of u and v as u · v or simply uv . We define this
operation in the following way: If u, v ∈ Σ∗ , a ∈ Σ, then

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?


Definition
Given an alphabet Σ and two strings such that u, v ∈ Σ∗ , we denote
the concatenation of u and v as u · v or simply uv . We define this
operation in the following way: If u, v ∈ Σ∗ , a ∈ Σ, then
1 u·λ=λ·u =u

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is string concatenation?


Definition
Given an alphabet Σ and two strings such that u, v ∈ Σ∗ , we denote
the concatenation of u and v as u · v or simply uv . We define this
operation in the following way: If u, v ∈ Σ∗ , a ∈ Σ, then
1 u·λ=λ·u =u
2 u · (va) = (u · v )a

37 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the length of a string?

38 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the length of a string?

Definition
We denote the length of a string u ∈ Σ∗ as |u| and we define it as the number of
symbols in u (counting any repetitions). That is,

38 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the length of a string?

Definition
We denote the length of a string u ∈ Σ∗ as |u| and we define it as the number of
symbols in u (counting any repetitions). That is,


0 if u = λ
|u| =
n if u = a1 a2 · · · an .

38 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the length of a string?

Definition
We denote the length of a string u ∈ Σ∗ as |u| and we define it as the number of
symbols in u (counting any repetitions). That is,


0 if u = λ
|u| =
n if u = a1 a2 · · · an .

Example
|aba| = 3, |baaa| = 4

38 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the reflexion or inverse of a string?

39 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the reflexion or inverse of a string?


Definition
We denote the reflexion or inverse of a string u ∈ Σ∗ as u R and we
define it as:

39 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the reflexion or inverse of a string?


Definition
We denote the reflexion or inverse of a string u ∈ Σ∗ as u R and we
define it as:


R λ if u = λ
u =
an · · · a2 a1 si u = a1 a2 · · · an .

39 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

Definition
We say that v is a substring or subword of u if there exist x, y such that u = xvy . Note
that x or y can be λ therefore the empty string is a substring of any string and also any
string is a substring of itself.

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

Definition
We say that v is a substring or subword of u if there exist x, y such that u = xvy . Note
that x or y can be λ therefore the empty string is a substring of any string and also any
string is a substring of itself.

What is a prefix?

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

Definition
We say that v is a substring or subword of u if there exist x, y such that u = xvy . Note
that x or y can be λ therefore the empty string is a substring of any string and also any
string is a substring of itself.

What is a prefix?

Definition
A prefix of u is a string v such that u = vw for any string w ∈ Σ∗ . We say that v is a
proper prefix if v 6= u.

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

Definition
We say that v is a substring or subword of u if there exist x, y such that u = xvy . Note
that x or y can be λ therefore the empty string is a substring of any string and also any
string is a substring of itself.

What is a prefix?

Definition
A prefix of u is a string v such that u = vw for any string w ∈ Σ∗ . We say that v is a
proper prefix if v 6= u.

What is a suffix?

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a substring?

Definition
We say that v is a substring or subword of u if there exist x, y such that u = xvy . Note
that x or y can be λ therefore the empty string is a substring of any string and also any
string is a substring of itself.

What is a prefix?

Definition
A prefix of u is a string v such that u = vw for any string w ∈ Σ∗ . We say that v is a
proper prefix if v 6= u.

What is a suffix?
Definition
A suffix of u is a string v such u = wv for any string w ∈ Σ∗ . We say that v is a
proper suffix if v 6= u.

40 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Note that λ is a prefix and suffix of any string u since uλ = λu = u. Using the same
reasoning, u is a prefix and suffix of itself.

41 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Note that λ is a prefix and suffix of any string u since uλ = λu = u. Using the same
reasoning, u is a prefix and suffix of itself.

Example
Let Σ = {a, d, c, d} and u = bcbaadb.

Prefixes of u : Suffixes of u :
λ λ
b b
bc db
bcb adb
bcba aadb
bcbaa baadb
bcbaaad cbaadb
bcbaadb bcbaadb

41 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a language?

42 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a language?
Definition
A language L over an alphabet Σ is a subset of Σ∗ , that is L ⊆ Σ∗

42 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a language?
Definition
A language L over an alphabet Σ is a subset of Σ∗ , that is L ⊆ Σ∗
Special cases:
L = ∅, empty language.
L = Σ∗ , language of all strings over Σ.

42 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is a language?
Definition
A language L over an alphabet Σ is a subset of Σ∗ , that is L ⊆ Σ∗
Special cases:
L = ∅, empty language.
L = Σ∗ , language of all strings over Σ.

Every language L satisfies ∅ ⊆ L ⊆ Σ∗ , and can be finite or infinite. We


denote languages by means of capital letters A, B, C, ..., L, M, N, ...

42 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
The following are examples of languages over specific alphabets.

43 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
The following are examples of languages over specific alphabets.
Σ = {a, b, c}. L = {a, aba, aca}.

43 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
The following are examples of languages over specific alphabets.
Σ = {a, b, c}. L = {a, aba, aca}.
Σ = {a, b, c}. L = {a, aa, aaa, ...} = {an | n ≥ 1}.

43 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Example
The following are examples of languages over specific alphabets.
Σ = {a, b, c}. L = {a, aba, aca}.
Σ = {a, b, c}. L = {a, aa, aaa, ...} = {an | n ≥ 1}.
Σ = {a, b, c}. L = {λ, aa, aba, ab2 a, ab3 a, ...} =
{abn a | n ≥ 0} ∪ {λ}.

43 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

A∪B Union

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

A∪B Union
A∩B Intersecction

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

A∪B Union
A∩B Intersecction
A−B Difference

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

A∪B Union
A∩B Intersecction
A−B Difference
A = Σ∗ − A Complement

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What are the operations for languages?

Definition
Since languages over Σ are subsets of Σ∗ , the basic operations for sets are also valid
for languages. Therefore, if A y B are languages over Σ (that is A, B ⊆ Σ∗ ), then the
following are also languages over Σ :

A∪B Union
A∩B Intersecction
A−B Difference
A = Σ∗ − A Complement

These operations for languages are called set or boolean operations in order to
distinguish them from the linguistic ones which are those that extend the operations
over strings but for languages.

44 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the concatenation for languages?

45 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the concatenation for languages?


Definition
The concatenation of languages A and B over Σ, denoted by A · B or
simply AB is defined as:

45 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the concatenation for languages?


Definition
The concatenation of languages A and B over Σ, denoted by A · B or
simply AB is defined as:

AB = {uv | u ∈ A, v ∈ B}

45 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

What is the concatenation for languages?


Definition
The concatenation of languages A and B over Σ, denoted by A · B or
simply AB is defined as:

AB = {uv | u ∈ A, v ∈ B}

In general, AB 6= BA

45 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then
1 A · ∅ = ∅ · A = ∅.

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then
1 A · ∅ = ∅ · A = ∅.
2 A · {λ} = {λ} · A = A.

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then
1 A · ∅ = ∅ · A = ∅.
2 A · {λ} = {λ} · A = A.
3 Associative property,
A · (B · C) = (A · B) · C.

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then
1 A · ∅ = ∅ · A = ∅.
2 A · {λ} = {λ} · A = A.
3 Associative property,
A · (B · C) = (A · B) · C.
4 Distributivity of concatenation over the union,
A · (B ∪ C) = A · B ∪ A · C.
(B ∪ C) · A = B · A ∪ C · A.

46 / 47
Regular languages and finite automata Presentation of the following topic

Regular languages and finite automata

Which are the properties for concatenation for languages?

Definition
Let A, B, C be languages over Σ, that is A, B, C ⊆ Σ∗ . Then
1 A · ∅ = ∅ · A = ∅.
2 A · {λ} = {λ} · A = A.
3 Associative property,
A · (B · C) = (A · B) · C.
4 Distributivity of concatenation over the union,
A · (B ∪ C) = A · B ∪ A · C.
(B ∪ C) · A = B · A ∪ C · A.
5 Generalized distributivity property. If {Bi }i ∈ I is any language family over Σ, then
S S
A· Bi = (A · Bi ),
 S  i ∈ I i ∈I
S
Bi · A = (Bi · A).
i ∈I i ∈I

46 / 47
Regular languages and finite automata Presentation of the following topic

Next class

Exercises and section


Reading material: Sections 1.1-1.9
Exercises:
Section 1.5: 1
Section 1.9: 1
Teoría de la computación: 1.1,1.4,1.5

47 / 47

You might also like