Automata and Formal language docx

34 575 0
Automata and Formal language docx

Đ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 Dr. Huỳnh Trung Hiếu Faculty of Information Technology HoChiMinh City University of Industry Welcome to ATM&NNHT  GV: TS. Huỳnh Trung Hiếu  Khoa CNTT  Email: hthieu@gmail.com  Thông tin môn học:  Số tín chỉ: 3  Lên lớp: 45 tiết  Tự học: 90 tiết  Yêu cầu:  Dự lớp trên 75%  Làm bài tập trên lớp và ở nhà  Thảo luận theo nhóm  Làm tiểu luận  Thi giữa học phần  Thi kết thúc học phần 3 Formal Languages & Automata A formal language:  Is an abstraction of the general characteristics of programming languages.  Consists of a set of symbols and some formation rules by which these symbols can be combined into sentences. 4 Formal Languages & Automata An automaton:  Is a construction that possesses all the indispensable features of a digital computer.  Accepts input, produces output, may have some temporary storage, and can make decisions in transforming the input into the output. 5 Formal Languages & Automata  Digital design  Programming languages  Compilers Some immediate and important applications. Tài liệu  Giáo trình lý thuyết automat và ngôn ngữ hình thức. Hồ Văn Quân  An introduction to formal languages and automata. Peter Linz  Introduction to automata theory, languages, and computation. John Hopcroft & Jeffrey Ullman Mục tiêu môn học  Xây dựng mô hình trừu tượng cho máy tính.  Lý thuyết cung cấp cho chúng ta những khái niệm giúp ta đi đến những ứng dụng như :  Thiết kế kỹ thuật số.  Ngôn ngữ lập trình.  Trình biên dịch.  Nhận dạng ngôn ngữ,…. Nội dung môn học  Phần 1:Giới thiệu khái niệm, dẫn nhập.  Phần 2: Automat hữu hạn.  Phần 3: Ngôn ngữ và văn phạm chính quy.  Phần 4: Các tính chất của ngôn ngữ chính quy  Phần 5: Ngôn ngữ phi ngữ cảnh  Phần 6: Đơn giản văn phạm vi ngữ cảnh  Phần 7: Automat đẩy xống  Phần 9: Máy Turing GiỚI THIỆU KHÁI NiỆM, DẪN NHẬP 10 Three Basic Concepts  Languages  Grammars  Automata [...]...Languages  Là một hệ thống thích hợp nhằm để diễn tả những ý kiến, sự kiện, khái niệm chắc chắn Chúng bao gồm tập hợp các ký hiệu và quy luật 11 Languages  Alphabet: a finte and nonempty set of symbols Σ = {a, b}  String: finite sequence of symbols from Σ w = abaaa Độ dài chuỗi |w|, chính là số ký tự trong chuỗi λ: empty string * + * Σ : the set of all strings on Σ (Σ = Σ − {λ}) 12 Languages  Language: ... Σ*  Word or Sentence: a string in L 13 Languages  Example 1: Σ = {a, b} * Σ = {λ, a, b, aa, ab, ba, aaa, } L1 = {a, aa, aab} (finite language) n n L2 = {a b | n ≥ 0} = {λ, ab, aabb, } Các chuỗi aabb, aaaabbbb là các từ trên ngôn ngữ L2, nhưng chuỗi abb thì không 14 Languages  Language concatenation: L1L2 = {xy | x∈L1, y∈L2} n L = L L L (n times) 0 L = {λ} 15 Languages  Example 2: n n L = {a b |... S → bSa =>L(G2) = {w | na(w) = nb(w)} 28 Automata An abstract model of digital computer: Input file Control unit Storage Output 29 Automata Input file: is divided into squares  Input is a string over a given alphabet  Each input square holds a symbol  The symbols are read from left to right, one at a time  The end of the input string can be detected 30 Automata Storage: consists of an unlimited... symbol from an alphabet (which can be different from the input alphabet)  The contents of the storage cells can be read and changed 31 Automata Control unit: has a finite number of internal states  Can be in any one of the internal states  Can change state in some defined manner 32 Automata  Transition function: current state × input symbol × storage info → next state Output may be produced Info in... {xy | x∈L1, y∈L2} n L = L L L (n times) 0 L = {λ} 15 Languages  Example 2: n n L = {a b | n ≥ 0} 2 n n m m L = {a b a b | n ≥ 0, m ≥ 0} 16 Languages  Star-closure: * 0 1 2 L = L ∪ L ∪ L  Positive closure: L + 1 2 = L ∪ L 17 Grammars  A grammar for a natural language tells us whether a particular sentence is well-formed or not → → ... | n ≥ 0} 23 Grammars  Example 4: G1 = ({A, S}, {a, b}, S, P1) P1: S → aAb | λ A → aAb | λ 24 Grammars  Example 4: G1 = ({A, S}, {a, b}, S, P1) P1: S → aAb | λ A → aAb | λ n n L(G1) = {a b | n ≥ 0} G and G1 are equivalent 25 Grammars  Để chỉ ra một ngôn ngữ L được sinh ra bởi một văn phạm G Chúng ta cần chỉ ra: a) b) mỗi w ∈ L được dẫn ra từ S bằng các luật sinh của văn phạm G mỗi w như ở (a) phải... → a | the → boy | dog → runs | walks khi đó ta có những câu như: "a boy runs" và "the dog walks" là có "dạng đúng" có nghĩa là được sinh ra từ văn phạm trên 18 Grammars  Formal grammar: G = (V, T, S, P) V: finite set of variables (tập biến) T: finite set of terminal symbols (tập ký hiệu kết thúc) S∈V: start variable (tập biến bắt đầu) P: finite set of productions (luật... y∈(V∪T) *  w = uxv derives (dẫn xuất ra) z = uyv w⇒z * w1 ⇒ wn (w1 ⇒ w2 ⇒ ⇒ wn | w1 = wn) + w1 ⇒ wn kí hiệu * cho biết dẫn xuất đến wn thì qua một số bước (số bước có thể = 0) 20 Grammars  Generated language: Cho G = (V, T, S, P) là 1 văn phạm thì tập: * * L(G) = {w∈T | S ⇒ w} là ngôn ngữ được sinh ra bởi G  Derivation: nếu w∈L(G) thì tồn tại dẫn xuất: S ⇒ w1 ⇒ w2 ⇒ ⇒ wn ⇒ w  Sentential forms:... × 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 33 Automata  Có các dạng:  Automat tất định   Xác định cấu hình hiện tại duy nhất Automat không tất định  Tại mỗi thời điểm có nhiều sự duy chuyển hơn  Accepter: yes/no output Transducer: string of . thúc học phần 3 Formal Languages & Automata A formal language:  Is an abstraction of the general characteristics of programming languages.  Consists of a set of symbols and some formation. ngôn ngữ hình thức. Hồ Văn Quân  An introduction to formal languages and automata. Peter Linz  Introduction to automata theory, languages, and computation. John Hopcroft & Jeffrey Ullman Mục. temporary storage, and can make decisions in transforming the input into the output. 5 Formal Languages & Automata  Digital design  Programming languages  Compilers Some immediate and important

Ngày đăng: 11/07/2014, 19:20

Từ khóa liên quan

Mục lục

  • Automata and formal language

  • Welcome to ATM&NNHT

  • Formal Languages & Automata

  • Slide 4

  • Slide 5

  • Tài liệu

  • Mục tiêu môn học

  • Nội dung môn học

  • Slide 9

  • Three Basic Concepts

  • Languages

  • Slide 12

  • Slide 13

  • Slide 14

  • Slide 15

  • Slide 16

  • Slide 17

  • Grammars

  • Slide 19

  • Slide 20

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

Tài liệu liên quan