Re and Finite Automata Examples
Re and Finite Automata Examples
Re and Finite Automata Examples
Regular Expression:
A pattern that generates (only) the strings of a desired language. It is made up of
letters of the language’s alphabet, as well as of the following special characters:
More examples
yes
text
“recognizer” no
aaba
current input F a b
s0 s0 s2
current
s1 s1 s0
state
s2 s0 s0
gives the next state <
• Complete
(no undefined
transitions)
• Deterministic
(no choices)
start s0 a, b
2. Accepts ë only.
a, b a, b
start s1
s0
a a, b
start s1
s0
s0 start b
s1 a found at begin. s2 a, b
s2 starting b
a a a, b
start s0 s1 s2
b
b
a a a, b
start s0 s1 s2
b b
a a b
start s0 s1 s2
b b a
s0 no ‘a’ found s3
s1 one ‘a’ found
s2 two ‘a’ found
s3 too many ‘a’ a, b
1. For every regular expression “R”, defining a language “L”, there is a FSA “M”
recognizing exactly L.
2. For every FSA “M”, recognizing a language “L”, there is a regular expression
“R” matching all the strings of L and no others.
(we will prove this later)