Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.

Slides:



Advertisements
Similar presentations
Natural Language Processing - Formal Language - (formal) Language (formal) Grammar.
Advertisements

Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
Week 13 - Wednesday.  What did we talk about last time?  Exam 3  Before review:  Graphing functions  Rules for manipulating asymptotic bounds  Computing.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
Languages, grammars, and regular expressions
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 4 Updated by Marek Perkowski.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Normal forms for Context-Free Grammars
Chapter 3: Formal Translation Models
Fall 2006Costas Busch - RPI1 The Chomsky Hierarchy.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Week 14 - Friday.  What did we talk about last time?  Exam 3 post mortem  Finite state automata  Equivalence with regular expressions.
Week 15 - Friday.  What did we talk about last time?  Review second third of the course.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
CSE 3813 Introduction to Formal Languages and Automata Chapter 8 Properties of Context-free Languages These class notes are based on material from our.
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Week 15 - Monday.  What did we talk about last time?  Context free grammars.
Languages, Grammars, and Regular Expressions Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth.
Grammars CPSC 5135.
1 Introduction to Regular Expressions EELS Meeting, Dec Tom Horton Dept. of Computer Science Univ. of Virginia
1 Computability Five lectures. Slides available from my web page There is some formality, but it is gentle,
Week 14 - Wednesday.  What did we talk about last time?  Regular expressions  Introduction to finite state automata.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
9.7: Chomsky Hierarchy.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CS 203: Introduction to Formal Languages and Automata
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
Recursively Enumerable Languages
Discrete Structures ICS252 Chapter 5 Lecture 2. Languages and Grammars prepared By sabiha begum.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Lecture 6: Context-Free Languages
Week 13 - Wednesday.  What did we talk about last time?  Exam 3  Before review:  Graphing functions  Rules for manipulating asymptotic bounds  Computing.
Week 15 - Monday.  What did we talk about last time?  Context free grammars.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Theory of Languages and Automata By: Mojtaba Khezrian.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Week 14 - Wednesday.  What did we talk about last time?  Exam 3 post mortem  Finite state automata  Equivalence with regular expressions.
Week 13 - Friday.  What did we talk about last time?  Regular expressions.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesAlgebraic.
Lecture 1 Theory of Automata
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Linear Bounded Automata LBAs
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Natural Language Processing - Formal Language -
CSE322 The Chomsky Hierarchy
A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
The Chomsky Hierarchy Costas Busch - LSU.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

Week 14 - Friday

 What did we talk about last time?  Simplifying FSAs  Quotient automata

P RINCE His Royal Badness

 A sociologist named McSnurd gave a talk about a community that has clubs with the following attributes:  A person can belong to more than one club  Each club is named after a person  No two different clubs are named after the same person  Every person has a club named after him or her  A person may or may not belong to the club named after them ▪ If they do, that person is called sociable ▪ If they don't, that person is called unsociable  Perhaps surprisingly, there is a club that contains all of the unsociable people  Do you believe McSnurd's description?

 Another sociologist named McSnuff described a similar community:  As before, there is the same number of clubs as people, and each club is named after exactly one person  However, a person can be a member of a club openly or secretly ▪ If a person is not openly a member of the club named after them, they are suspicious ▪ If a person is secretly a member of the club named after them, they are a spy  Perhaps surprisingly, there is a club that contains all of the suspicious people  Do you believe McSnuff's description?  Do you know whether or not there is at least one spy in the community?

 Prove that the following two automata are equivalent by finding their quotient automata s0s0 s0s0 s2s2 s2s2 s1s1 s1s s3s3 s3s s0's0' s0's0' s1's1' s1's1' s2's2' s2's2' 0, s3's3' s3's3'

 A context free language is one that can be described by a context free grammar  Every regular language is context free, but there are context free languages that are not regular  Classic examples:  Strings of k 0's followed by k 1's  Palindromes made up of a's and b's  Legally nested parentheses  All of these involve counting arbitrary numbers of characters  Regular expressions can't count

 Instead of using regular expressions, a context free language is often described with a grammar  A grammar is a formal system of rewriting rules consisting of  Terminals: symbols of the alphabet  Non-terminals: symbols that produce other sequences of terminals and non-terminals  Grammars often start with the non-terminal starting symbol S  Any string that can be derived from S through some sequence of rule rewrites is a string in the language

 The following is a grammar that produces the language of strings of 1s and 0s that end in a 1 S  A1S  A1  A  ε | 1 | 0 | A1 | A0  This language is regular and is equivalent to (0 | 1)* 1  The following is a grammar that produces the language of a k b k where k ≥ 1 (which is not regular S  AS  A  A  ab | aAb

 Write a grammar that legal nesting of parentheses and braces in Java  Don't worry about the stuff that goes inside  Write a grammar for legal mathematical expressions in Java using variables and integers, +, -, *, /, and parentheses  Write a grammar that corresponds to the same language defined by the regular expression ab* (a | bb) (ba)*

 As you know, regular languages can be expressed by regular expressions and finite state automata  Thus, regular expressions are equal to FSAs in power  Context free languages can be expressed by context free grammars  There is also a class of automata called pushdown automata that correspond to context free languages

 To make the PDA for the language 0 k 1 k, k ≥ 1, we have the following:  In this case, the notation X/Y means that if X is on the top of the stack, replace it with Y  The top of the stack is Z  Notation is not well standardized for PDAs  It's awkward keeping track of the stack s1s1 s1s1 s2s2 s2s2 s0s0 s0s0 0: Z/AZ 0: A/AA 1: A/ε 1: A/A 1: Z/Z

 Noam Chomsky is a brilliant linguist who has recently focused mostly on political activism  Remember that a grammar consists of terminals (alphabet symbols), non-terminals, production rules, and a start symbol  He noted that grammars can be divided into four levels in terms of expressiveness:  Type-0 (Unrestricted grammars)  Type-1 (Context sensitive grammars)  Type-2 (Context free grammars)  Type-3 (Regular grammars)

 Each grammar has rules for what is a legal production rule  Let α, β, and γ be any combinations of terminals and non-terminals, where γ is non-empty 1. Unrestricted grammars  α  β (anything to anything) 2. Context-sensitive grammars  αAβ  αγβ (non-terminal in a particular context to anything) 3. Context-free grammars  A  γ (a single non-terminal to anything) 4. Regular grammars  A  a and A  aB (a single non-terminal to a single terminal or a terminal and a single non-terminal on the right side)

 Every kind of language has a particular kind of machine associated with it GrammarLanguagesAutomaton Production Rules Examples Type-0 Recursively enumerable Turing machine α  βα  β All languages, any computable functions Type-1 Context- sensitive Linear-bounded non- deterministic Turing machine αAβ  αγβ Most natural human languages Type-2Context-free Non-deterministic pushdown automaton A  γ Most programming languages Type-3RegularFinite state automaton A  a and A  aB Regular expressions

 Each set of languages in the hierarchy strictly contains the sets beneath it  Regular languages  Can be accepted by nondeterministic or deterministic finite automata (or a read-0nly Turing machine)  Are closed under union, intersection, complement, concatenation, and Kleene star  Context-free languages  Are defined by those languages accepted by nondeterministic pushdown automata  Are closed under union, concatenation, and Kleene star (but not under intersection or complement)  Deciding whether a string is in a context-free language can be determined in polynomial time  Deciding whether a language is empty is decidable  Context-sensitive languages  Are very rarely used  Are closed under union, intersection, complement, and Kleene star  Deciding whether a string is in a context-sensitive language is a PSPACE-complete problem Recursively enumerable Context- sensitive Context-free Regular

 A Turing machine is a mathematical model for computation  It consists of a head, an infinitely long tape, a set of possible states, and an alphabet of characters that can be written on the tape  A list of rules saying what it should write and should it move left or right given the current symbol and state A A

 You can specify a Turing machine with a table giving its behavior for a specific configuration  Turing's first example machine printed an infinite sequence of alternating 1s and 0s, separated by spaces: ConfigurationBehavior StateSymbolOperationResult State BBlankWrite 0, Move RightC CBlankMove RightE EBlankWrite 1, Move RightF FBlankMove RightB

 If an algorithm exists, a Turing machine can perform that algorithm  In essence, a Turing machine is the most powerful model we have of computation  Power, in this sense, means the ability to compute some function, not the speed associated with its computation  Do you own a Turing machine?

 Given a Turing machine and input x, does it reach the halt state?  As you know, there is no algorithm to determine this  If you had a Turing machine that could solve the halting problem, it would cause a logical contradiction

 Are two context-free languages the same?  Is the intersection of two context-free languages empty?  Is a context-free language equal to Σ *  Is a context-free language a subset of another context-free language?  Post correspondence problem:  You have lists a 1, a 2, … a n and b 1, b 2, … b n, where a i and b j are strings of some alphabet Σ with at least 2 symbols  Is there a value k ≥ 1 such that some sequence of k strings from the a list concatenated is equal to some sequence of k strings from the b list concatenated?  Is a given statement of first-order logic provable from a starting set of axioms?  Given a set of matrices, is there some sequence that they can be multiplied in (perhaps with repetitions) that will yield the zero matrix?

 Review first third of the course

 Review chapters  Finish Assignment 10  Due Monday before midnight