Finite automaton
Formal definition
5-tuple
- is a finite set called the states,
- is a finite set called the alphabet,
- is the transition function,
- is the start state, and
- is the set of accept states.
Strings and language
-
A string is a finite sequence of symbols in Σ
-
A language is a set of strings (finte or infinite)
-
The empty string is the string of length 0
-
The empty language is the set with no strings
-
= {w| M accepts w}
-
L(M) is the language of M
-
M recognizes L(M)
Regular language
DefA language is regular if some finite automaton recognizes it.
Regular Expressions
Regular operations. Let A, B be languages
- Union:
- Concatenation:
- Star:
Example. Let A = {good, bad} and Let B = {boy, girl}.
- = {good, bad, boy, girl}
- = = {goodboy, goodgirl, badboy, badgirl}
- = {ε, good, bad, goodgood, goodbad, badgood, badbad, goodgoodgood, goodgoodbad, … }
Regular expressions
- Build from Σ, Members are [Atomic]
- By using [Composite]
Examples
- =
- = a
- = a
Closure properties for Regular Expressions
If are regular languages, so is (closure under )
The class of regular languages is closed under the union operations.