Course Outline Chapter 1: Introduction Chapter 2: Finite Automata Chapter 3: Regular Language and Regular Grammar Chapter 4: Properties of Regular Language Chapter 5: Context-Fr
Trang 1Automata and Formal Language
Quan Thanh Tho qttho@dit.hcmut.edu.vn
Trang 2Course Overview
An introduction to the fundamental theories and algorithms for computing on digital computer.
acceptable output based on self-made
decision
programming language syntax.
Trang 3Course Outline
Chapter 1: Introduction
Chapter 2: Finite Automata
Chapter 3: Regular Language and Regular Grammar
Chapter 4: Properties of Regular Language
Chapter 5: Context-Free Grammar
Chapter 6: Simplification of Context-Free Grammar
Chapter 7: Pushdown Automata
Trang 5 Assignment: 30%
Final Exam: 70%
Trang 6Related Issues
Digital Circuit Design
Compiler
Programming Languages
Trang 7Required Background
Set and Graph Theory
Induction and Contradiction-based Methods
Trang 8Three Basic Concepts
Languages
Grammars
Automata
Trang 12Language Concatenation
L1L2 = {xy | x∈L1, y∈L2}
Ln = L L L (n times)
L0 = {λ}
Trang 13Language Concatenation (cont’d)
• Example 1.4:
L = {anbn | n ≥ 0}
L2 = {anbnambm | n ≥ 0, m ≥ 0}
Trang 14Closure Operators
Star-Closure: L* = L0 ∪ L1 ∪ L2
Positive-Closure: L+ = L1 ∪ L2
Trang 15<noun> → boy | dog
<verb> → runs | walks
Trang 16Hands-on Exercise 1.1:
Find all of possible sentences of the grammar given in Example 1.5
Trang 17Formal Grammar
• Formal grammar:
G = (V, T, S, P) V: finite set of variables
T: finite set of terminal symbols
S∈V: start variable
P: finite set of productions
Trang 18Formal Grammar (cont’d)
• Productions: x → y, x∈(V ∪T )+, y∈(V ∪T )*
• Example 1.6:
G = ({S}, {a, b}, S, P) P: S → aSb
S → λ
Trang 19Directly Derive
• w = uxv derives z = uyv if xy is a production
w ⇒ z w1 ⇒* wn (w1 ⇒ w2 ⇒ ⇒ wn | w1 = wn) w1 ⇒+ wn
Trang 20Directly Derive (cont’d)
Trang 21Generated Language
G = (V, T, S, P) L(G) = {w∈T* | S ⇒* w}
• Example 1.8:
Take into consideration the grammar given in Example 1.6:
L(G) = {anbn | n ≥ 0}
Trang 23Sequential Forms
• S , w1 , w2 , , wn (containing variables) with S ⇒ w1 ⇒ w2 ⇒ ⇒ wn
⇒ w is a derivation
• Example 1.10: S ⇒ aSb ⇒ aaSbb ⇒ aabb
aabb: sentence aaSbb: sentential form
Trang 24 “An automaton (plural: automata) is a self-operating
machine The word is sometimes used to describe a robot, more specifically an autonomous robot Used colloquially, it refers to a mindless follower.” (Wiki)
An abstract model of digital computer:
Trang 25Automaton Structure
Control unit Input file
Output
Storage
Trang 26Input File
Input file: is
Divided into squares or cells, each of which holds a symbol of the alphabet
The symbols are to be read from left to right.
The end of input file is detectable
The automaton cannot change the contents of the input file.
Trang 27 A device consisting of unlimited cells.
Each cell hold a symbol from an alphabet (it is not necessary
to be the same alphabet as the input one)
The automaton can read and change the storage cells
Trang 28Control Unit
Having a finite set of infernal states
Can be any one of its infernal states
Can change from one infernal state to other.
Trang 29Automation Operations
• Transition function:
current state × input symbol × storage info → next state
Output may be produced Info in the storage may be changed
• Configuration: current state × input symbol × storage info
• Move: current configuration → next configuration
Trang 30Automaton Types
• Accepter: yes/no output
Transducer: string of symbols as output
• Deterministic: single possible move at one point Non-deterministic: multiple possible moves
Trang 31• Exercise 4, 5, 6, 8, 9, 12, 15, 17 of Section 1.2 - Linz’s book.