# Introduction to Automata Theory, Languages, and Computation, John Hopcroft etc. 1.Automata a.Why study automata? b.Important structural representations other than automata c.Automata and complexity 2.Formal proof for theorem a.Why discuss formal proof?

Ηλεκτρονική - Συσκευές

10 Οκτ 2013 (πριν από 4 χρόνια και 9 μήνες)

74 εμφανίσεις

Introduction to Automata Theory, Languages, and Computation, John Hopcroft etc.

1.

Automata

a.

Why study automata?

b.

Important structural representations other than automata

c.

Automata and complexity

2.

Formal proof for theorem

a.

Why discuss formal proof?

b.

Deductive pro
ofs for theorem “If
Hypothesis

then
Conclusion

c.

Reduction to definitions

d.

Other form for “If
Hypothesis

then
Conclusion

e.

Theorems that appear not to be If
-
Then statements

3.

Forms of proof in additional to deductive

a.

b.

Proved by contr

c.

Proved by counterexamples

4.

Inductive proof

5.

Central Concepts of Automata theory

1.

Automata

a.

Why study automata?

Automata theory is the study of abstract computing devices or “machines.”

A. Turing in the 1930’s studied an abstract machine that had
all the
capabilities of today’s computers, at least as far as in what they could compute.

Turing’s goal was to describe precisely the boundary between what a
computing machine could do and what it couldn’t.

His conclusions apply not only to his abstrac
t Turing machine, but also to
today’s real machine.

(Why study automata?)

“Turing machine”, which is an automata, help us understand what the
computer can do, and what we can expect from our software.

Simpler kinds of machines i
n the 1940’s and 1950’s, which we call today
“finite automata”, were studied by a number of researchers.

Finite automata turned out to be extremely useful for a variety of other
purposes.

Application 1
: Linguist N. Chomsky, in the 1950’s, began the study

of formal
“grammar,” which is the grammar for language applied to machines. These
grammars have close relationships to finite automata and serve today as the
basis of some important software components, including parts of compilers.

C language, coded wit
h grammar for C

ParserⰠ,h楣栠愠iin楴i

Application 2
: Software for designing and checking the behavior of digital
circuit (in fact, sequential digital circuit).

Circuit behavior

F楮楴i⁳瑡 e m慣h楮e

F楮楴i⁳瑡 e 瑡扬e

䍩Ccu楴i
S祮瑨t獩s

Application 3
: The “lexical analyzer” of a typical compiler, that is, the
compiler component that breaks the input text into logical units, such as
identifier, keywords, and punctuation.

X=2+3;

Le硩捡氠䅮慬祺er

䥤en瑩t楥i
_

ber

P慲ser

X

†††††††††††††††††††††††††††††††††††††††††††††††††††††
+

†††††††††††††††††††††††††††††††††††††††††††††††††††
⼠†/
\

†††††††††††
†††††††††††††††††††††††††††††††††††††††
㈠††″

Application 4
: Software for scanning large bodies of text, such as collections
of webpages, to find occurrences of words, phrases, or other patterns.

Linguistic Analy
sis

(check grammar, recognize string)

F楮楴i⁓瑡te
䅵瑯Aa瑡

Application 5
: (In general) Software for verifying systems of all types that
have a finite number of distinct states, such as communications protocols or
protocols for secure exchange of informa
tion.

Recognize the content of the protocol, which is composed of header, payload.

TV broadcast station , ATSC or DVB protocol

T嘬⁡畴潭慴愠a漠
rec潧o楺i 瑨t⁰r潴潣潬

(Why study automata?)

A lot of applications to designing or verifying systems with different states.

|
\

Circuit Design

Compiler to verify langu
age

FSM, an instrument to describe syst
em with finite number of states

There are many systems that may be viewed as being at all times
in one of a
finite numbers of states.

The purpose of a state is to remember

the relevant
portion of the
system’s history
. For the same input, different state responds
differently.

It is often necessary to indicate one or more states as “final” or “accepting”
states. Entering one of these states after a sequence of inputs ind
icates that the
input sequence is good in some way. It is conventional to designate accepting
states by a double circle.

More complicated FSM has more than one accepting state. Other
features are automatic transition, current transition.

b.

Important str
uctural representations other than automata

There are two important notations that are not automata
-
like, but play an
important role in the study of automata and their applications.

Grammar specifies the structure of the document composed of data.

Regula
r expression specifies the structure of data element.

Language generated by grammar
language generated by regular
expression.

Grammar
: For describing data with a
recursive structure
. The language
applied to a machine has a gramm
ar. The parser of a compiler will deal with
the recursive features of the typical programming language, such as
expression. A grammatical rule like

.

Regular expression
: For describing the structure of data, like number,
identif
ier and key words …etc. Especially, for text strings. The UNIX
-
style
regular expression ‘[A
-
Z][a
-
z]*[][A
-
Z][A
-
Z]’ represents capitalized words
followed by a space and two capital letters. This expression represents
patterns in text that could be a city a
nd state, e.g., Ithaca NY.

Exercise: How to use regular expression to represent multiword city names,
such as Palo Alto CA?

‘([A
-
Z][a
-
z]*[])*[][A
-
Z][A
-
Z]’

‘[A
-
Z][a
-
z]*([][A
-
Z][a
-
z]*)*[] [A
-
Z][A
-
Z]’

Grammar

-
> sentence. Regular expression
-
> word.

c.

Automata and complexity

Automata are
essential

for the study of the limit of computation.

Or, Turing machines, extension of Automata.

Two important issues,
decidability and intractability
, involved in the stud
y
of the limit of computation.

What can computer do at all?

Decidability:

the study of what computer can do. Those problems that
computer can do are called “decidable.”

What can computer do efficiently?

Intractability
: the study of what computer can’
t do efficiently. Those
problems that can be solved by a computer using no more than some
slowly growing function of the input size are called “tractable.”

2.

Formal proof for theorem

a.

Why discuss formal proof?

Before the property, rules or theorem can be u
sed in the algorithm, codes or
computation, a proof is a must to make sure they work all the time.

Does a
n
+b
n
=c
n

has solution for integer a, b and c, when n>2 ?

b.

Deductive proofs for theorem “If
h
ypothesis

then
c
onclusion

Deductive
: a sequence of justif
ied steps.

Given X
2
-
4=96, prove X=10.

X
2
=100

X=10

Inductive
: recursive proofs of a
parameterized statement
,

that use the
statement itself with “lower” values of the parameter, assuming it is true.

Parameterized statement:

1+2+…+n = (1+n)n/2

Statement

with lower values of the parameter
:

1+2+…+(n
-
1) = (1+(n
-
1))(n
-
1)/2

To prove “If
h
ypothesis

then
c
onclusion
” deductively, the proof consists of a
sequence of statements

whose truth leads us from hypothesis to the
conclusion.

To prove “If H then C” deduc
tively, C is deduced from H.

Modus ponens: H is true and if H
-
>C => C is true.

c.

Reduction to definitions

In many other theorems, including many from automata theory, the terms used
in the statement may have implications that are less obvious.

If you

are not sure how to start a proof,
convert all terms

in the hypothesis
to

their definitions
.

Example: Theorem 1.5:

Let S be a finite subset of some infinite set U. Let T be the complement of S
with respect to U. Then, T is infinite.

Proof:

Intuitivel
y,

without reduction to definition
:
wordy
.

To prove p
-
>q, you prove “p and not q” is false.

not “p and not q” is true.

not p or q is true.

p
-
>q is true.

Exercise: Study the proof without reduction to definition.

Proof by cont
with

reduction to definition
: concise.

Reduction to definition:

Original Statement

New Statement

S is finite.

There is an integer n such that ||S||=n.

U is infinite.

For no integer p is ||U||=p.

T is the complement of S.

S
T=U and S
T=

We know that S
T=U and S and T are disjoint, so ||S||+||T||=||U||.

Since S is finite, ||S||=n for some integer n, and

since U is infinite, there is no integer p such tha
t ||U||=p.

So,
assume that T is finite
, i.e. ||T||=m for some integer m,

then ||U||=||S||+||T||=n+m.

Contradict with the statement that there is no integer p equal to ||U||.

d.

Other form for “If
h
ypothesis

then
c
onclusion

The “If
-
Then” form of theorem
is most common in typical areas of
mathematics. However, other forms denoting the same thing exists.

Ways of saying “If
-
Then”, H
-
>C.

1.

H implies C.

2.

H only if C.

3.

C if H.

4.

Whenever H holds, C follows.

Exercise: Why “H only if C” is equivalent to H
-
>C ?

Mor
ning

Sun rises in dawn. Morning, only if sun rises in dawn.

If
-
And
-
Only
-
If Statements

A iff B

A is equivalent to B.

A exactly when B.

This statement is actually two if
-
then statements: “If A then B.” and “If B then
A.”.

We prove “A iff B” by provin
g these two statements:

1.

The if part: “if B then A”.

2.

The only
-
if part: “if A then B”, which is often stated in the equivalent
form “
A only if B
.”

A
B A
B same as “A if and only if B.”

Sometimes you will find

it helpful to break an if
-
and
-
only
-
if into a succession
of several equivalences. That is to prove “A if and only if B.” You might
first prove “A if and only if C,” and then “C if and only if B.”

Example
: Perfect Graph Theorem

This is a theorem about th
e equivalence of three properties P1, P2 and P3.

To prove P2
P3, we prove P1
P2 first, then P1
P3.

The following is an example of a simple if
-
and
-
only
-
if proof. It uses notion:

, the floor of real number x, is the greatest integer equal to or less than x.

, the ceiling of real number x, is the least integer equal to or greater than x.

Example
:

Theorem 1.7 Let x be a real number. Then
=

if and only if x is an
integer.

Proof:

(if part) If x is an integer
=x,
=x. So,
=
.

(only
-
if part) In this part , assume
=

is true, and try to prove x is an
integer.

Using the definitions of the floor and ceiling, we notice that

and
. However
, we are given that
=
.

Thus, we may substitute the floor for the ceiling in the first inequality to
conclude
.

Since both

and

hold, we may conclude by properties of
arithmetic i
nequality that
.
Since

is always an integer, x must
also be an integer in this case.

Q.E.D.

e.

Theorems that appear not to be If
-
Then statements

Theorem 1.8

If

is an angle, and, sin, cos usual meaning, then
.

3.

Forms of proof in additional to deductive

f.

To prove set E is equal to set F, one needs to prove:

Every element in E is in F, and e
very element in F is in E.

Or, if
-
and
-
only
-
if An element x is in E if and only if x is in F.

g.

Proved by contradiction (See Example: Theorem 1.5)

h.

Proved by counterexamples

a
n
+b
n
=c
n

does not have

solution for integer a, b and c, when n
=2.

If

a
n
+b
n
=c
n

for some integers a, b and c, then n
2.

Homework:

1. Explain the following terms: Finite automata, Regular expression, Turing
machine, Deductive proof, Inductive proof, Proof by contradiction, Counterexample.

2. (Inductive

proof)

Given a parameterized statement S:
, write the
statement of lower size in parameter S’. (S’ is assumed to be true in the inductive
proof.)