0% found this document useful (0 votes)
2 views

Automata Lectuee1

The document is a lecture on Formal Languages and Automata Theory, introducing the concept of automata as abstract self-propelled computing devices that follow predetermined operations. It discusses the importance of studying automata theory for understanding computation limits, including decidability and intractability, and highlights applications in software design, compilers, and text processing. Additionally, it covers types of proofs and reasoning methods essential for logical deductions in computer science.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Automata Lectuee1

The document is a lecture on Formal Languages and Automata Theory, introducing the concept of automata as abstract self-propelled computing devices that follow predetermined operations. It discusses the importance of studying automata theory for understanding computation limits, including decidability and intractability, and highlights applications in software design, compilers, and text processing. Additionally, it covers types of proofs and reasoning methods essential for logical deductions in computer science.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

MENOUFIAUNIVERSITY

FACULTYOFCOMPUTERSANDINFORMATION

‫جامعة المنوفية‬

Third Level (Second Semester)


Software Engineering, CS Dept., (CS314)

FORMAL LANGUAGES AND


AUTOMATA THEORY
Lecture One

Dr. Hamdy M. Mousa

Today Proverb
‫العلم نور‬
Knowledge is power
Automata
• What is it?
• The term "Automata" is derived from the
Greek word "αὐτόματα" which means
"self-acting".

• An automaton (Automata in plural) is an


abstract self-propelled computing device
which follows a predetermined sequence
of operations automatically.
• Automatons are abstract models of machines
that perform computations on an input by
moving through a series of states or
configurations.
Automata
• Automata theory is the study of abstract computing
devices.
• Turing’s goal was to describe precisely the
boundary between what a computing machine
could do and what it could not do his conclusions
apply not only to his abstract Turing machines
• These automata originally proposed to model brain
function
• These grammars have close relationships to
abstract automata and serve today as the basis of
some important software components.
Finite Automata
• Finite automata are a useful model for many
important kinds of hardware and software.

• What a finite automaton is and does?


• A finite Automata (FA) is the most restricted model of
automatic machine.
• A finite automata is an abstract model of a computer
system.
Why Study Automata Theory
• There are several reasons to study of
automata and complexity is an important
part of the core of computer science.

1. Introduction to Finite Automata


2. Structural Representation
3. Automata and Complexity
Why Study Automata Theory?
• Finite Automata are a useful model for many important kinds of
hardware and software.

1. Software for designing and checking the behavior of digital circuits.


2. The “Lexical analyzer” of a typical compiler, that is , the compiler
component that breaks the input text into logical units, such as
identifiers, keywords, and punctuation.
3. Software for scanning large bodies of text, such as collections of
Web pages, to find occurrences of words, phrases, or other
patterns.
4. 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
information.
Why Study Automata Theory?
• Structural Representations:
• There are two important notations, there are not
automation-like, but play an important role in the
study of automata and their applications:

1. Grammars are useful models when


software that processes data with a
recursive structure.
2. Regular Expressions are denoted the
structure of data, especially text strings.
Why Study Automata Theory?
• Automata are essential for the study of the limits
of computation.
• There are two important issues.
1. What can a computer do at all?
This study is called “decidability”, and the
problems that can be solved by computer are
called “decidable.”.

Undecidability ➔ what cannot be computed at all.


Why Study Automata Theory?
There are two important issues.
2. What can a computer do efficiently?
This study is called “intractability,” and the problems
that can be solved by a computer using no more time
than some slowly growing function of the size of the
input are called ” tractable.”

• Intractable problems are problems for which there exist


no efficient algorithms to solve them.
• NP (non-deterministic polynomial-time)- hardness
Why Study Automata Theory
• Automata theory is important because, it allows
scientists to understand how machines solve
problems.
• An automaton is any machine that uses a
specific, repeatable process to convert information
into different forms.
• Modern computers are a common example of an
automaton.
• If scientists didn't study automata theory, they would
have a much more difficult time designing systems that
could perform repeatable actions based on specific
inputs and outputs.

• Automata are used in text processing, compilers,


and hardware design.
• Context-free grammar (CFGs) are used in
programming languages and artificial intelligence.
• Originally, CFGs were used in the study of the human
languages
Finite automata
• Finite automata are a useful model for many
important kinds of hardware and software.
• Example:
• Finite Automata : On/Off switch
Finite automata
• Example:
Finite Automata: part of a lexical analyzer
• (modeling recognition of then)
Structural expressions
• There are two important notations that are
not automaton like but play an important
role in the study of automata and their
applications:
1. Grammars are useful models when
designing software that processes data
with a recursive structure.
• For instance, a grammatical rule like E → E + E
• states that an expression can be formed by taking
any two expressions and connecting them by a
plus sign
Structural expressions
2. Regular expressions also denote the structure
of data especially text Strings.
Example:
The UNIX style regular expression represents
capitalized words followed by a space and two
capital letters:

• The symbol * represents any number of the


preceding expression.
Types of Proofs
• Proofs are all about logic, but there are
different types of logic.
• Three different methods for proving:
• Deductive Reasoning
• Inductive Reasoning,
• Proof By Contradiction.

• Logic is a science that studies the principles of correct reasoning.


• Logic is the systematic study of the forms of inference, the
relations that lead to the acceptance of one proposition, the
conclusion, on the basis of a set of other propositions, the
premises.
Types of Proofs
• Deductive proofs are all about using a
general theory to prove something
specific.
• Inductive proofs flip this around: we
use a specific example to prove a
general theory.
• Proofs by contradiction are their own
weird thing: we prove something by
showing that its opposite can't
possibly be true.
Reasoning
• In deductive reasoning a case and a rule imply a
result.
• “Aly is a student” and “students are human” imply
• “Aly is a human”.
• In inductive reasoning a case and a result (or
many similar cases associated with many similar
results) lead to a rule.
• “Aly is a student” and “Aly is a human” lead to
• “students are human”.
• In abductive reasoning a result and a rule led to
a case.
• “Aly is a human” and “students are human” lead to
• “Aly is a student”.
Proof by Deduction
• Prove that: there are an infinite number of
primes.
• Prove that: If x2 is odd then x must be odd.

• Theorem: If x is even then x2 is even.


• Therefore, by proof of the contrapositive,
if x2 is odd then x must be odd.

• Contraposition is conversion of a proposition from all A is


B to all not-B is not-A.
Proof by Contradiction
• Steps to proving a theorem by contradiction:
1. Assume P is true.
2. Assume ¬Q is true.
3. Demonstrate a contradiction.

Theorem: If n is an even perfect square with both m and n


integers and n=m2, then m is even.

Proof: Suppose n is even, but assume for contradiction


that m is not.
Let: m=2k+1 for some integer k.
Then,
n=m2=(2k+1)2=4k2+4k+1=2(2k2+2k)+1
Since k is an integer, we see that n is odd
Formal Proof
• Deductive proofs: where you showed the truth
of a statement by a detailed sequence of steps
and reasons.
• know the rule for computing the area of a rectangle
• In the USA of the 1990s, it became popular to
teach proof as a matter of personal feelings
about the statement.
• Some computer scientists take the extreme view
that a formal proof of the correctness of a
program should go hand in hand with the writing
of the program itself.
• if your program is complex say a tricky recursion or
iteration
Deductive Proofs
• Deductive Proof consists of a sequence of
statements whose truth leads us from some initial
statement called the hypothesis or the given
statements to a conclusion statement.
• From the given statement(s) to a conclusion
statement (what we want to prove)
• Logical progression by direct implications

Example for parsing a statement:


• “If y≥4, then 2y≥y2.”

given conclusion

(there are other ways of writing this).

You might also like