LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.

Slides:



Advertisements
Similar presentations
LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong. Administrivia Homework 3 graded.
Advertisements

Lecture 9,10 Theory of AUTOMATA
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 13: 10/9.
LING/C SC/PSYC 438/538 Lecture 12 Sandiway Fong. Administrivia We'll postpone Homework 4 review until next week …
YES-NO machines Finite State Automata as language recognizers.
LING 388: Language and Computers Sandiway Fong Lecture 9: 9/27.
LING 388: Language and Computers Sandiway Fong 9/29 Lecture 11.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/19.
CS21 Decidability and Tractability
LING 438/538 Computational Linguistics Sandiway Fong Lecture 8: 9/29.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/4.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING 388: Language and Computers Sandiway Fong Lecture 21: 11/7.
LING 388: Language and Computers Sandiway Fong Lecture 12: 10/5.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
LING 388 Language and Computers Lecture 8 9/25/03 Sandiway FONG.
LING 388 Language and Computers Lecture 4 9/11/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 11: 10/3.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/3.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
LING 388 Language and Computers Lecture 11 10/7/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 10: 9/26.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Topics Automata Theory Grammars and Languages Complexities
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
LING 388 Language and Computers Lecture 6 9/18/03 Sandiway FONG.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Does not Compute 4: Finite Automata In which we temporarily admit defeat with cellular automata (we will face them again, in the epic final “Does Not Compute”
LING/C SC/PSYC 438/538 Lecture 7 9/15 Sandiway Fong.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Closure.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
LING 388: Language and Computers Sandiway Fong 9/27 Lecture 10.
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong. Administrivia Reading Homework – Chapter 3 of JM: Words and Transducers.
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Homework 6 graded.
CS355 - Theory of Computation Regular Expressions.
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
CS 203: Introduction to Formal Languages and Automata
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Pumping Lemma.
CSE 3813 Introduction to Formal Languages and Automata
PDAs Accept Context-Free Languages
Language Recognition (12.4)
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
Pumping Lemma.
Chapter 4 Properties of Regular Languages
CS21 Decidability and Tractability
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong.
Language Recognition (12.4)
LING/C SC/PSYC 438/538 Lecture 17 Sandiway Fong.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
CHAPTER 1 Regular Languages
Presentation transcript:

LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5

2 Administrivia homework #2 –sorry: still not done with grading those yet homework #3 –out today –usual rules apply –due next Thursday

3 Last Time FSA and closure properties –concatenation, union, intersection, etc. Limits on FSA –some informal discussion –problem: shoehorn an infinite set into a machine with finite number of states and loops –for any given # states, if the (accepted) input string is long enough, you’ll need to loop –not all kinds of infinity can be encoded using just finite state loops: hard sometimes to see which ones can and cannot be

4 The Limits of Finite State Technology from last lecture example –L = a + b + = { ab, abb, aab, aabb, aaab, abbb, … } –“ one or more a ’ s followed by one or more b ’ s ” Note: –can be divided into two independent halves –each half can be replaced by iteration s1s1 s2s2 s3s3 ba s1s1 s2s2 s3s3 aa s4s4 b s1s1 s2s2 s3s3 ba s4s4 b s1s1 s2s2 s3s3 aa s4s4 b s5s5 b s1s1 s2s2 s3s3 aa s4s4 a s5s5 b s1s1 s2s2 s3s3 ba s4s4 b s5s5 b s1s1 s2s2 s3s3 ba s4s4 b s1s1 s2s2 s3s3 aa s4s4 b s5s5 b s0s0 ε ε s1s1 s2s2 s3s3 aa s4s4 a s5s5 b s6s6 b s0s0 ε ε s1s1 s2s2 s3s3 aa s4s4 a s5s5 b s6s6 bb s7s7 s1s1 s2s2 s3s3 aa s4s4 a s5s5 b b s3s3 s4s4 a s5s5 b b a

5 A Formal Tool: The Pumping Lemma A tool used to prove languages are NOT regular –based on the intuition that if a language is regular, it “pumps” (iterates) –Recall: for any given # states, if the (accepted) input string is long enough, you’ll need to loop Note: –can’t be used to prove a language is regular –to show something is regular: proof by exhibition describe a FSA (or regular expression or regular grammar)

6 A Formal Tool: The Pumping Lemma If a language L is regular, then there exists a number p > 0 –(sometimes called a magic number) such that every string w in L with |w| ≥ p can be written in the following form, where p is a pumping length: w = xyz with strings x, y and z such that |xy| ≤ p, |y| > 0 and xy i z is in L for every integer i ≥ 0.

7 A Formal Tool: The Pumping Lemma Example: –show that a n b n is not regular Proof (by contradiction): –pick a sufficiently long string in the language –e.g. a..aab..bb (#a’s = #b’s) –Partition it according to w = xyz –then show xy i z is not in L –i.e. string does not pump

8 A Formal Tool: The Pumping Lemma aaaa..aabbbb..bb Case 1: w = xyz, y straddles the ab boundary what happens when we pump y? Case 2: w = xyz, y is wholly within the a’s what happens when we pump y? Case 3: w = xyz, y is wholly within the b’s what happens when we pump y? yyy

9 Question 1 438/538 (4pts) Give the minimum size regular expression for the FSA below (2pt) Give an equivalent FSA without the ε-transition (2pts) –answer in the form of a diagram or formal definition or Prolog definition are all ok sxy a a b ε

10 Question 2 438/538 (8pts) convert the NDFSA into a deterministic FSA (3pts) implement both the NDFSA and the equivalent FSA in Prolog using the “one predicate per state” encoding (5pts) –submit your code –run both machines on the strings abab and abaaba, –how many steps (transitions + final stop) does each machine make? from figure 2.27 in the textbook

11 Question 3 438/538 (8pts) (5pts) Give a FSA in Prolog that accepts a binary string (made up of 0’s and 1’s) if and only if it begins with a 1 and contains exactly one 0 –examples: – –10 –* (3pts) Given the regular expression equivalent of the FSA

12 Summary Total: 20pts Question 1: 4pts Question 2: 8pts Question 3: 8pts