Automata and Formal Language (chapter 1) pot

31 396 0
Automata and Formal Language (chapter 1) pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Automata and Formal Language Quan Thanh Tho qttho@dit.hcmut.edu.vn Course Overview  An introduction to the fundamental theories and algorithms for computing on digital computer – – Automation: A model producing input from acceptable output based on self-made decision Formal Language: An abstraction of programming language syntax Course Outline      Chapter 1: Introduction   Chapter 6: Simplification of Context-Free Grammar Chapter 2: Finite Automata Chapter 3: Regular Language and Regular Grammar Chapter 4: Properties of Regular Language Chapter 5: Context-Free Grammar Chapter 7: Pushdown Automata Reading Materials • Giáo trình lý thuyết automat ngơn ngữ hình thức • • Hồ Văn Qn An introduction to formal languages and automata Peter Linz Introduction to automata theory, languages, and computation John Hopcroft & Jeffrey Ullman Assessment  Assignment: 30%  Final Exam: 70% Related Issues  Digital Circuit Design  Compiler  Programming Languages Required Background  Set and Graph Theory  Induction and Contradiction-based Methods Three Basic Concepts  Languages  Grammars  Automata Languages • Alphabet: a finite and nonempty set of symbols Σ = {a, b} • Example 1.1 • • Roman Alphabet: A,B,C, ,Z Greek Alphabet: α,β,… Language (cont’d) • String: finite sequence of symbols from Σ λ: empty string Σ*: the set of all strings on Σ (Σ+ = Σ* − {λ})  Example 1.2: Given Σ = {a,b} => Σ* = {λ, a, b, aa, ab, ba, aaa, } w = abaaa is a string of Σ L = {anbn | n ≥ 0} = {λ, ab, aabb, } is a set of strings of Σ Formal 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 Formal 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→λ Directly Derive • w = uxv derives z = uyv if xy is a production w⇒z w ⇒* w (w ⇒ w ⇒ ⇒ w | w = w ) n n n w ⇒+ w n Directly Derive (cont’d) • Example 1.7: Take into consideration the grammar given in Example 1.6: S ⇒ aSb ⇒ aaSbb ⇒ aabb S ⇒* aabb Generated 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} Derivation  S ⇒ w1 ⇒ w2 ⇒ ⇒ wn ⇒ w∈L(G)  Example 1.9: The sequence of directly deriving given in Example 1.6 is a derivation S ⇒ aSb ⇒ aaSbb ⇒ aabb Sequential 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 Automata  “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: Automaton Structure Input file Control unit Output Storage Input 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 Storage  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 Control Unit  Having a finite set of infernal states  Can be any one of its infernal states  Can change from one infernal state to other Automation 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 Automaton Types • Accepter: yes/no output Transducer: string of symbols as output • Deterministic: single possible move at one point Non-deterministic: multiple possible moves Homework • Exercise 4, 5, 6, 8, 9, 12, 15, 17 of Section 1.2 - Linz’s book ... automat ngơn ngữ hình thức • • Hồ Văn Qn An introduction to formal languages and automata Peter Linz Introduction to automata theory, languages, and computation John Hopcroft & Jeffrey Ullman Assessment... Programming Languages Required Background  Set and Graph Theory  Induction and Contradiction-based Methods Three Basic Concepts  Languages  Grammars  Automata Languages • Alphabet: a finite and. .. Grammar Chapter 2: Finite Automata Chapter 3: Regular Language and Regular Grammar Chapter 4: Properties of Regular Language Chapter 5: Context-Free Grammar Chapter 7: Pushdown Automata Reading Materials

Ngày đăng: 14/07/2014, 02:20

Từ khóa liên quan

Mục lục

  • Automata and Formal Language

  • Course Overview

  • Course Outline

  • Reading Materials

  • Assessment

  • Related Issues

  • Required Background

  • Three Basic Concepts

  • Languages

  • Language (cont’d)

  • Slide 11

  • Language Concatenation

  • Language Concatenation (cont’d)

  • Closure Operators

  • Grammar

  • Hands-on Exercise 1.1:

  • Formal Grammar

  • Formal Grammar (cont’d)

  • Directly Derive

  • Directly Derive (cont’d)

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan