CS 311 Final Notes
CS 311 Final Notes
G =(V, T, S, P),
V is a finite set of objects called
variables,
T is a finite set of objects called
terminal symbols,
S V is a special symbol called the
start variable,
P is a finite set of productions.
Left linear: S Aa
Right linear: S aA
2.1 Deterministic Finite Accepters
deterministic finite accepter or dfa is
defined by the quintuple
M = (Q,,,q0, F),
Q is a finite set of internal states,
is a finite set of symbols called the
input alphabet,
:Q Q is a total function called
the transition function,
q0 Q is the initial state,
F Q is a set of final states.
Definition
The language L accepted by an nfa M
= (Q,,, q0,F) is defined as the set of
all strings accepted in the above
sense.
Definition
For an nfa, the extended transition
function is defined so that * (qi,w)
contains qj if and only if there is a walk
in the
transition graph from qi to qj labeled
w. This holds for all qi, qj Q, and w
*.
2.3 Equivalence of Deterministic and
Nondeterministic Finite Accepters
Regular Languages
Every finite automaton accepts some
language. If we consider all possible
finite automata, we get a set of
languages
associated with them. We will call such
a set of languages a family
Theorem
Le t L be the language accepted by a
nondeterministic finite accepter MN=
(QN, , N,q0,FN). Then there exists a
deterministic finite accepter MD= (QD,
,D,{q0},FD) such that
L= L (MD).
Definition
A language L is called regular if and
only if there exists some deterministic
finite accepter M such that
L= L(M).
Theorem
The procedure mark, applied to any
dfa M =(Q, ,,q0,F), terminates and
determines all pairs of distinguishable
states.
Theorem
Given any dfa M, application of the
procedure reduce yields another dfa
such that
L(M)= L(^M ).
Furthermore, is minimal in the sense
that there is no other dfa with a
smaller number of states that also
accepts L(M).
(q0, a) = q1,
if the dfa is in state q0 and the current
input symbol is a, the dfa will go into
state q1.
Theorem
A language L is regular if and only if
there exists a regular grammar G such
that L = L(G).
Theorem
The family of regular languages is
closed under reversal.
Closure under Other Operations
Definition
Suppose and are alphabets. Then a
function
is called a homomorphism.
Theorem
Let h be a homomorphism. If L is a
regular language, then its
homomorphic image h (L) is also
regular. The family of
regular languages is therefore closed
under arbitrary homomorphisms.
Definition
Order of Operations in Rex:
and
such that
is also in L for all i = 0, 1, 2,.
To paraphrase this, every sufficiently
long string in L can be broken into
three partsin such a way that an
arbitrary
number of repetitions ofthe middle
part yields another string in L. We say
that the middle string is pumped,
hence the
term pumping lemma for this result.
Example
Theorem
If L1 and L2 are regular languages,
then L1 /L2 is also regular. We say that
the family of regular languages is
closed under
right quotient with a regular language.
6 L ((r1)) = L (r1),
7.L () = (L (r1))*.
Ex:
L(01) = {01}
L(01+0) = {01, 0}
Theorem
There exists an algorithm for
determining whether a regular
language, given in standard
representation, is empty, finite, or
infinite.
Theorem
Given standard representations of two
regular languages L1 and L2, there
exists an algorithm to determine
whether or not L1 = L2.
4.3 Identifying Nonregular Languages