LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 13: 10/9.

Slides:



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

LING 388: Language and Computers Sandiway Fong Lecture 5: 9/5.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
LING 388: Language and Computers Sandiway Fong Lecture 9: 9/27.
LING 388: Language and Computers Sandiway Fong 9/29 Lecture 11.
1 Module 20 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA (extra credit) and therefore.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
LING 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/19.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 8: 9/29.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 10: 9/27.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/4.
1 … NPDAs continued. 2 Pushing Strings Input symbol Pop symbol Push string.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
LING 388: Language and Computers Sandiway Fong Lecture 12: 10/5.
LING 388 Language and Computers Lecture 8 9/25/03 Sandiway FONG.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 6: 9/6.
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.
Lecture 18 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA and therefore a subset.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/3.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/23.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
LING 388: Language and Computers Sandiway Fong Lecture 10: 9/26.
LING 388 Language and Computers Lecture 7 9/23/03 Sandiway FONG.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 11: 10/2.
LING 388: Language and Computers Sandiway Fong Lecture 7: 9/12.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Finite State Machines Data Structures and Algorithms for Information Processing 1.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
LING 388: Language and Computers Sandiway Fong Lecture 6.
LING 388: Language and Computers Sandiway Fong Lecture 7 9/15.
LING/C SC/PSYC 438/538 Lecture 7 9/15 Sandiway Fong.
2. Regular Expressions and Automata 2007 년 3 월 31 일 인공지능 연구실 이경택 Text: Speech and Language Processing Page.33 ~ 56.
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.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Regular Expressions Fundamental Data Structures and Algorithms Peter Lee March 13, 2003.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Elimination Method - Systems. Elimination Method  With the elimination method, you create like terms that add to zero.
Formal Languages, Automata and Models of Computation
Non Deterministic Automata
Busch Complexity Lectures: Reductions
NPDAs Accept Context-Free Languages
Turing Machines Acceptors; Enumerators
Non-Deterministic Finite Automata
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
Intro to Data Structures
Non Deterministic Automata
LING/C SC/PSYC 438/538 Lecture 17 Sandiway Fong.
… NPDAs continued.
Instructor: Aaron Roth
Mealy and Moore Machines
NFAs accept the Regular Languages
Presentation transcript:

LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 13: 10/9

Administrivia Homework 2 –grade (to be) sent by today Upcoming midterm –this Thursday

NDFSA → (D)FSA: Recap set of states construction –new machine simulates in parallel all possible situations for the original machine procedure must terminate –4 states –2 4 -1=15 possible different states in the new machine sx z a a a b y b b a b

Practice Question convert the NDFSA into a deterministic FSA implement both the NDFSA and the equivalent FSA in Prolog using the “one predicate per state” encoding 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

Today’s Topics FSA to regexp FSA and complementation Regexp and complementation

FSA to Regexp Give a Perl regexp for this FSA

FSA to Regexp Let’s define E i to be the possible strings that can lead to an accepting computation from state i Then: –E1 = aE2 –E2 = bE3 | bE4 –E3 = aE2 | λ –E4 = aE3

FSA to Regexp Solve simultaneous equations –E1 = aE2 –E2 = bE3 | bE4 –E3 = aE2 | λ –E4 = aE3

FSA to Regexp Solve simultaneous equations –E1 = aE2 –E2 = bE3 | bE4 (eliminate) –E3 = aE2 | λ –E4 = aE3 Then –E1 = abE3 | abE4 –E3 = abE3 | abE4 | λ

FSA to Regexp Solve reduced equations –E1 = abE3 | abE4 –E3 = abE3 | abE4 | λ –E4 = aE3

FSA to Regexp Solve reduced equations –E1 = abE3 | abE4 –E3 = abE3 | abE4 | λ –E4 = aE3 (eliminate E4) Then –E1 = abE3 | abaE3 –E3 = abE3 | abaE3 | λ

FSA to Regexp Solve reduced equations –E1 = abE3 | abaE3 –E3 = abE3 | abaE3 | λ Solve recursive definition for E3 rewrite E3 as –E3 = (ab|aba)E3 | λ E3 ab|aba

FSA to Regexp Then –E1 = abE3 | abaE3 –E3 = (ab|aba)* E3 ab|aba Also –E1 = (ab|aba)E3 Substituting for E3 –E1 = (ab|aba)(ab|aba)*

FSA to Regexp –E1 = (ab|aba)(ab|aba)* We know –e+ = ee* = e*e Hence –E1 = (ab|aba)+ Note: the order of variable elimination matters

FSA and Complementation FSA are closed under complementation –i.e. make a new FSA’ accept strings rejected by FSA, and reject strings accepted by FSA over the alphabet –∑= {a,b} reject b a b b a,b

FSA and Complementation A Simple Idea: –make old accepting state(s) non-final states –make non-final and reject states accepting states Nearly correct, but why does this not work? –hint: consider aba reject b a b b a,b

FSA and Complementation Prolog 1.one([a|L]) :- two(L). 2.two([b|L]) :- three(L). 3.two([b|L]) :- four(L). 4.three([]). 5.three([a|L]) :- two(L). 6.four([a|L]) :- three(L). To construct the complement FSA in Prolog: –add a single line 7.fsab(L) :- \+ one(L). \+ is the Prolog operator for negation as failure to prove –i.e. –\+ one(L) is true if one(L) cannot be true –\+ one(L) is false if one(L) can be true weakness is that \+ can’t be used to generate

Regexps and Complementation Not part of basic regexps Formally, we can define: –complement of regexp e = ∑ * – e –where ∑ * = set of all possible strings over alphabet ∑ i.e. zero or more occurrences... Class Exercise –Let ∑= {a,b} –Give a Perl regexp equivalent to the complement regexp for (ab|aba)+