Given these languages, what string w would you select if you wanted to apply the pumping lemma to prove the language is not regular:

Similar documents
Language properties and Grammar of Parallel and Series Parallel Languages

A General Class of Noncontext Free Grammars Generating Context Free Languages

A R "! I,,, !~ii ii! A ow ' r.-ii ' i ' JA' V5, 9. MiN, ;

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

Erkki Mäkinen State change languages as homomorphic images of Szilard languages

Grammars & Parsing, Part 1:

Proof Theory for Syntacticians

Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

RANKING AND UNRANKING LEFT SZILARD LANGUAGES. Erkki Mäkinen DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TAMPERE REPORT A ER E P S I M S

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

Natural Language Processing. George Konidaris

A Version Space Approach to Learning Context-free Grammars

systems have been developed that are well-suited to phenomena in but is properly contained in the indexed languages. We give a

GRAMMAR IN CONTEXT 2 PDF

CS 598 Natural Language Processing

On the Polynomial Degree of Minterm-Cyclic Functions

Spring 2016 Stony Brook University Instructor: Dr. Paul Fodor

Stochastic Calculus for Finance I (46-944) Spring 2008 Syllabus

Context Free Grammars. Many slides from Michael Collins

Enumeration of Context-Free Languages and Related Structures

Morphotactics as Tier-Based Strictly Local Dependencies

Computer Science 1015F ~ 2016 ~ Notes to Students

Evolution of Collective Commitment during Teamwork

B. How to write a research paper

(Sub)Gradient Descent

EECS 700: Computer Modeling, Simulation, and Visualization Fall 2014

AP Calculus AB. Nevada Academic Standards that are assessable at the local level only.

INTERMEDIATE ALGEBRA PRODUCT GUIDE

Math 181, Calculus I

Parsing of part-of-speech tagged Assamese Texts

arxiv: v1 [math.at] 10 Jan 2016

We are strong in research and particularly noted in software engineering, information security and privacy, and humane gaming.

Computer Science 141: Computing Hardware Course Information Fall 2012

Grade 5 + DIGITAL. EL Strategies. DOK 1-4 RTI Tiers 1-3. Flexible Supplemental K-8 ELA & Math Online & Print

GERM 3040 GERMAN GRAMMAR AND COMPOSITION SPRING 2017

Language Evolution, Metasyntactically. First International Workshop on Bidirectional Transformations (BX 2012)

Stacks Teacher notes. Activity description. Suitability. Time. AMP resources. Equipment. Key mathematical language. Key processes

ACADEMIC AFFAIRS CALENDAR

A Grammar for Battle Management Language

CS 101 Computer Science I Fall Instructor Muller. Syllabus

Basic Parsing with Context-Free Grammars. Some slides adapted from Julia Hirschberg and Dan Jurafsky 1

Probability and Game Theory Course Syllabus

Developing a TT-MCTAG for German with an RCG-based Parser

Grade 6: Correlated to AGS Basic Math Skills

MTH 141 Calculus 1 Syllabus Spring 2017

Department of Anthropology ANTH 1027A/001: Introduction to Linguistics Dr. Olga Kharytonava Course Outline Fall 2017

Standard 1: Number and Computation

CS 3516: Computer Networks

Objectives. Chapter 2: The Representation of Knowledge. Expert Systems: Principles and Programming, Fourth Edition

EMPLOYEE CALENDAR NOTES

WSU Five-Year Program Review Self-Study Cover Page

University of Waterloo School of Accountancy. AFM 102: Introductory Management Accounting. Fall Term 2004: Section 4

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

Penn State University - University Park MATH 140 Instructor Syllabus, Calculus with Analytic Geometry I Fall 2010

Year 11 Banana Schedule 2017

Foothill College Summer 2016

THE UNIVERSITY OF SYDNEY Semester 2, Information Sheet for MATH2068/2988 Number Theory and Cryptography

Liquid Narrative Group Technical Report Number

CSC200: Lecture 4. Allan Borodin

GACE Computer Science Assessment Test at a Glance

GIS 5049: GIS for Non Majors Department of Environmental Science, Policy and Geography University of South Florida St. Petersburg Spring 2011

Answer Key Applied Calculus 4

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

"f TOPIC =T COMP COMP... OBJ

Backwards Numbers: A Study of Place Value. Catherine Perez

Efficient Normal-Form Parsing for Combinatory Categorial Grammar

TEACHING AND EXAMINATION REGULATIONS PART B: programme-specific section MASTER S PROGRAMME IN LOGIC

TCC Jim Bolen Math Competition Rules and Facts. Rules:

Introduction to Sociology SOCI 1101 (CRN 30025) Spring 2015

Course Syllabus for Math

CS 446: Machine Learning

TabletClass Math Geometry Course Guidebook

Specifying Logic Programs in Controlled Natural Language

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

Instructor. Darlene Diaz. Office SCC-SC-124. Phone (714) Course Information

Discriminative Learning of Beam-Search Heuristics for Planning

American Studies Ph.D. Timeline and Requirements

Schooling and Labour Market Impacts of Bolivia s Bono Juancito Pinto

Instructor Experience and Qualifications Professor of Business at NDNU; Over twenty-five years of experience in teaching undergraduate students.

Diagnostic Test. Middle School Mathematics

AGS THE GREAT REVIEW GAME FOR PRE-ALGEBRA (CD) CORRELATED TO CALIFORNIA CONTENT STANDARDS

Refining the Design of a Contracting Finite-State Dependency Parser

Please read this entire syllabus, keep it as reference and is subject to change by the instructor.

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

Introduction to Causal Inference. Problem Set 1. Required Problems

Enhancing Unlexicalized Parsing Performance using a Wide Coverage Lexicon, Fuzzy Tag-set Mapping, and EM-HMM-based Lexical Probabilities

ENME 605 Advanced Control Systems, Fall 2015 Department of Mechanical Engineering


Foothill College Fall 2014 Math My Way Math 230/235 MTWThF 10:00-11:50 (click on Math My Way tab) Math My Way Instructors:

Characterizing Mathematical Digital Literacy: A Preliminary Investigation. Todd Abel Appalachian State University

Fall Semester 2012 CHEM , General Chemistry I, 4.0 Credits

SPANISH 102, Basic Spanish, Second Semester, 4 Credit Hours Winter, 2013

A Neural Network GUI Tested on Text-To-Phoneme Mapping

Parallel Evaluation in Stratal OT * Adam Baker University of Arizona

CIS Introduction to Digital Forensics 12:30pm--1:50pm, Tuesday/Thursday, SERC 206, Fall 2015

Opening up Opportunities for year olds

Page 1 of 11. Curriculum Map: Grade 4 Math Course: Math 4 Sub-topic: General. Grade(s): None specified

Montana Content Standards for Mathematics Grade 3. Montana Content Standards for Mathematical Practices and Mathematics Content Adopted November 2011

Improving Fairness in Memory Scheduling

have to be modeled) or isolated words. Output of the system is a grapheme-tophoneme conversion system which takes as its input the spelling of words,

Transcription:

Given these languages, what string w would you select if you wanted to apply the pumping lemma to prove the language is not regular: L 1 = { a n b m : n 2 m n 3 } L 2 = {a n b m c p : n=p, and m is odd } L 3 = { (01) n 11 (01) m : n, m 0} 1

Announcements The midterm is in class on Wed. June 21. There is a tutorial on Tuesday June 13. No tutorial on Tuesday June 20. Midterm tutorial: Monday June 19, 6:30pm, ECS 123. Bring any questions you have about assignments 1-3, old midterms or any other class material. Assignment 3 is due on Friday at the beginning of class. The preliminary final exam schedule has CSC 320 at 2pm on Monday August 14. 2

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 ( s as ) s. 1. Write down all well-parenthesized strings of length six or less over the alphabet ={ (, ) }. 2. Let L= { w { (, ) } * : w is a wellparenthesized string}. Prove that L is not regular. 3

Let M 1 be this DFA: 1. Give a regular expression for L(M 1 ). Let M 2 be this DFA: 2. Is M 2 a NDFA that accepts L(M 1 )*? Justify your answer. 4

Outline: Chapter 3: Context-free grammars Context-free Grammars (CFG s)- used to specify valid syntax for programming languages, critical for compiling. Pushdown Automata (PDA s)- machine model corresponding to context-free grammars, DFA with one stack. All regular languages are context-free but not all context-free languages are regular. We will study closure properties, equivalence between languages specified by CFG s and PDA s, a pumping theorem and algorithmic questions. 5

Classes of Languages 6

Part of the CFG for Pascal 7

Example 1: L= { a n cc b n : n 0} Example 2: L= (aa aba)* bb (bb bab)* Example 3: L= a a* b b* c c* 8

Notation a, b, c lower case terminals A, B, S upper case non-terminals e often reserved for empty string Strings in the generated language consist of terminals only. Used to describe rules. Used for derivations. * Derives in zero or more steps. 9

Example: L= { w w R : w {a, b}*} Rules: Start symbol S S asa S bsb S ε A derivation: S b S b b b S b b b b a S a b b bbaabb Shorthand: S * b b a a b b 10

A context-free grammar G is a quadruple (V, Σ, R, S) where V is an alphabet, Σ (the set of terminals) is a subset of V, R (the set of rules) is a finite subset of (V- Σ) x V*, and S (the start symbol) is an element of (V-Σ). Elements of (V- Σ) are called non-terminals. 11

If (A, u) is in R, we write A u (A can be replaced by u). If u, v V*, then u v (u derives v) if and only if there are strings x, y and z in V* and a non-terminal A such that u= x A y, v= x z y, and A z is a rule of the grammar. L(G) = { w Σ* : S * w, S is the start symbol} Language L is context-free if it is L(G) for some context-free grammar G. 12

Prove the following language is context-free by designing a context-free grammar which generates it: L= {w in {a,b} * : the number of a's is even and the number of b's is even} Another example: L= { w {0,1}* : 11 is not a substring of w} 13

Context-free grammars and regular languages. More examples of context-free languages. All regular languages are context-free and a sub-class of context-free languages (those with regular context-free grammars) are regular. 14

Theorem: Not all context-free languages are regular. Proof: {a n b n : n 0} is context-free but not regular. Context-free grammar: Start symbol S. S a S b S ε 15

Definition: A regular context-free grammar is a context-free grammar where each rule has its righthand side equal to an element of Σ* ({ε} ( V - Σ ) ) [0 or more terminals] then [at most one non-terminal] 16

Which rules below are not in the correct form to correspond to a regular context-free grammar? 1. S A B 2. S B b 3. S a A 4. S aaaa 5. B b 6. B ε 7. S A S B 8. A a 9. A ε 10. A aaa bb [0 or more terminals] then [at most one non-terminal] 17

Theorem: If L is regular, then L is context-free. Proof: A context-free grammar can be constructed from a DFA for L. Definition: A regular context-free grammar is a context-free grammar where each rule has its righthand side equal to an element of Σ* ({ε} ( V - Σ ) ) [0 or more terminals] then [at most one non-terminal] Our proof constructs a regular context-free grammar. 18

Create a NDFA which accepts the language generated by this context-free grammar. Start symbol: S S aa S S ε S M M E E aa M bbb M ab M M b S 19

Given the regular context-free grammar G=(V, Σ, R, S) construct a NDFA M = (K, Σ, Δ, s, F) where K= (V Σ) { f }, s= S, F = { f } For each rule T u R with u Σ*, R V-Σ, add a transition (T, u, R) to Δ. For each rule T u with u in Σ*, add a transition (T, u, f) to Δ.