Context Sensitive Grammars

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

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

A General Class of Noncontext Free Grammars Generating Context Free Languages

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

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

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

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

Proof Theory for Syntacticians

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

Self Study Report Computer Science

A Version Space Approach to Learning Context-free Grammars

Classroom Connections Examining the Intersection of the Standards for Mathematical Content and the Standards for Mathematical Practice

CS 598 Natural Language Processing

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

IT Students Workshop within Strategic Partnership of Leibniz University and Peter the Great St. Petersburg Polytechnic University

Grammars & Parsing, Part 1:

Morphotactics as Tier-Based Strictly Local Dependencies

Hyperedge Replacement and Nonprojective Dependency Structures

Enumeration of Context-Free Languages and Related Structures

"f TOPIC =T COMP COMP... OBJ

Efficient Normal-Form Parsing for Combinatory Categorial Grammar

Improving Fairness in Memory Scheduling

Detecting English-French Cognates Using Orthographic Edit Distance

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

Refining the Design of a Contracting Finite-State Dependency Parser

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

Parsing of part-of-speech tagged Assamese Texts

Discriminative Learning of Beam-Search Heuristics for Planning

Natural Language Processing. George Konidaris

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

Reinforcement Learning by Comparing Immediate Reward

The Strong Minimalist Thesis and Bounded Optimality

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

GCSE Mathematics B (Linear) Mark Scheme for November Component J567/04: Mathematics Paper 4 (Higher) General Certificate of Secondary Education

A Grammar for Battle Management Language

Statewide Framework Document for:

PESIT SOUTH CAMPUS 10CS71-OBJECT-ORIENTED MODELING AND DESIGN. Faculty: Mrs.Sumana Sinha No. Of Hours: 52. Outcomes

GUIDE TO THE CUNY ASSESSMENT TESTS

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

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

Factoring - Grouping

Digital Fabrication and Aunt Sarah: Enabling Quadratic Explorations via Technology. Michael L. Connell University of Houston - Downtown

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

TabletClass Math Geometry Course Guidebook

BAUM-WELCH TRAINING FOR SEGMENT-BASED SPEECH RECOGNITION. Han Shu, I. Lee Hetherington, and James Glass

Introduction to Causal Inference. Problem Set 1. Required Problems

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

Liquid Narrative Group Technical Report Number

Lecture 1: Machine Learning Basics

Cal s Dinner Card Deals

Math 098 Intermediate Algebra Spring 2018

Edexcel GCSE. Statistics 1389 Paper 1H. June Mark Scheme. Statistics Edexcel GCSE

WSU Five-Year Program Review Self-Study Cover Page

Probability and Game Theory Course Syllabus

This scope and sequence assumes 160 days for instruction, divided among 15 units.

Carter M. Mast. Participants: Peter Mackenzie-Helnwein, Pedro Arduino, and Greg Miller. 6 th MPM Workshop Albuquerque, New Mexico August 9-10, 2010

Radius STEM Readiness TM

School of Innovative Technologies and Engineering

On the Polynomial Degree of Minterm-Cyclic Functions

Parsing natural language

Multimedia Application Effective Support of Education

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

Language Model and Grammar Extraction Variation in Machine Translation

GRAMMAR IN CONTEXT 2 PDF

Generating Test Cases From Use Cases

Standard 1: Number and Computation

Given a directed graph G =(N A), where N is a set of m nodes and A. destination node, implying a direction for ow to follow. Arcs have limitations

Abstractions and the Brain

Artificial Neural Networks written examination

Introduction to HPSG. Introduction. Historical Overview. The HPSG architecture. Signature. Linguistic Objects. Descriptions.

GACE Computer Science Assessment Test at a Glance

Update on Soar-based language processing

BMBF Project ROBUKOM: Robust Communication Networks

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

STA 225: Introductory Statistics (CT)

Improved Reordering for Shallow-n Grammar based Hierarchical Phrase-based Translation

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

Massachusetts Institute of Technology Tel: Massachusetts Avenue Room 32-D558 MA 02139

ISFA2008U_120 A SCHEDULING REINFORCEMENT LEARNING ALGORITHM

An Introduction to the Minimalist Program

Evolution of Collective Commitment during Teamwork

7. Stepping Back. 7.1 Related Work Systems that Generate Folding Nets. The problem of unfolding three-dimensional models is not a new one (c.f.

IAT 888: Metacreation Machines endowed with creative behavior. Philippe Pasquier Office 565 (floor 14)

Speech Segmentation Using Probabilistic Phonetic Feature Hierarchy and Support Vector Machines

MTH 141 Calculus 1 Syllabus Spring 2017

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

How Does Physical Space Influence the Novices' and Experts' Algebraic Reasoning?

1/20 idea. We ll spend an extra hour on 1/21. based on assigned readings. so you ll be ready to discuss them in class

Using Calculators for Students in Grades 9-12: Geometry. Re-published with permission from American Institutes for Research

Comparison of network inference packages and methods for multiple networks inference

UCLA UCLA Electronic Theses and Dissertations

OFFICE SUPPORT SPECIALIST Technical Diploma

Introduction and Motivation

SANTIAGO CANYON COLLEGE Reading & English Placement Testing Information

Lecture 10: Reinforcement Learning

FF+FPG: Guiding a Policy-Gradient Planner

11/29/2010. Statistical Parsing. Statistical Parsing. Simple PCFG for ATIS English. Syntactic Disambiguation

Rendezvous with Comet Halley Next Generation of Science Standards

Toward Probabilistic Natural Logic for Syllogistic Reasoning

MELANIE J. GREENE. Faculty of Education Ph. (709) / (709) Blog:

Transcription:

Context Sensitive Grammars Rajaguru K CSA, IISc Automata Seminar, Dec,2016 Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 1 / 17

Overview 1 Introduction 2 Formal definition 3 Context Sensitive Language 4 Closure properties 5 Relation Between Recursive and CSL 6 Summary Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 2 / 17

Definition A context sensitive grammar (CSG) is a grammar where all productions are of the form αaβ αγβ where γ ɛ During derivation non-terminal A will be changed to γ only when it is present in context of α and β. Note the constraint that the replacement string γ ɛ; as a consequence we have α β implies α β CSG is a Noncontracting grammar. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 3 / 17

Table: Chomsky Hierarchy (1956) Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 4 / 17 Chomsky Hierarchy REL CSL CFL RL Type Language Automaton Production rules Type 0 Unrestricted Type 1 Context-sensitive Type 2 Context-free Type 3 Regular Recursively enumerable Turing Machine α β Context-sensitive Linear-bounded automaton αaβ αγβ Context-free Pushdown automaton A γ Regular Finite state automaton A a and A ab

Formal definition A context sensitive grammar G = (N, Σ, P, S), where N is a set of nonterminal symbols Σ is a set of terminal symbols S is the start symbol, and P is a set of production rules, of the form αaβ αγβ where A in N, α, β (N Σ) and γ (N Σ) + The production S ɛ is also allowed if S is the start symbol and it does not appear on the right side of any production. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 5 / 17

Context Sensitive Language The language generated by the Context Sensitive Grammar is called context sensitive language. If G is a Context Sensitive Grammar then, L(G) = {w (w Σ ) (S + G w)} Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 6 / 17

Context Sensitive Language The language generated by the Context Sensitive Grammar is called context sensitive language. If G is a Context Sensitive Grammar then, L(G) = {w (w Σ ) (S + G w)} Example. The following grammar(g) is context-sensitive. S atb ab at aatb ac L(G) = {ab} {a n cb n n > 0} Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 6 / 17

Context Sensitive Language L(G) = {ab} {a n cb n n > 0} This language is also a context-free. For example, Context free grammar(g1) for this. S atb ab T atb c Any context-free language is context sensitive. Not all Context-sensitive but not context-free. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 7 / 17

Context Sensitive Language Example L = {1 n 2 n 3 n n > 0} Context sensitive grammar(g) N = {S, B, C}, Σ = {1, 2, 3}, S = S and P: S 1SBC 123 Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 8 / 17

Context Sensitive Language Example L = {1 n 2 n 3 n n > 0} Context sensitive grammar(g) N = {S, B, C}, Σ = {1, 2, 3}, S = S and P: S 1SBC 123 1B 12 2B 22 2C 23 3C 33 CB BC Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 8 / 17

Context Sensitive Language Example L = {1 n 2 n 3 n n > 0} Context sensitive grammar(g) N = {S, B, C}, Σ = {1, 2, 3}, S = S and P: S 1SBC 123 1B 12 2B 22 2C 23 3C 33 CB HB, HB HC, HC BC Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 8 / 17

Context Sensitive Language Example L = {x {a, b, c} # a x = # b x = # c x, # a x 1} Context sensitive grammar(g) N = {S, A, B, C}, Σ = {a, b, c}, S = S and P: S ABCS ABC XY YX for all X, Y {A, B, C} A a B b C c Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 9 / 17

Closure properties Context Sensitive Languages are closed under Union Intersection Complement Concatenation Kleene closure Reversal Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 10 / 17

Closure properties Union L(CS) closed under union Let G 1 = (N 1, T 1, P 1, S 1 ) and G 2 = (N 2, T 2, P 2, S 2 ), s.t L(G 1 ) = L 1 and L(G 2 ) = L 2. Construct G = (S N 1 N 2, T 1 T 2, {S S 1, S S 2 } P 1 P 2, S), s.t N 1 N 2 = and S / {N 1 N 2 }. G also CSG and any derivation has the form S S i G i w L(G i ) for some i {1, 2}. We cannot merge the productions of P 1 and P 2. We can derive only words and all words of L(G 1 ) L(G 2 ) = L 1 L 2. Therefore L 1 L 2 = L(G) L(CS). Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 11 / 17

Closure properties Concatenation L(CS) closed under concatenation Let G 1 = (N 1, T, P 1, S 1 ) and G 2 = (N 2, T, P 2, S 2 ), s.t L(G 1 ) = L 1 and L(G 2 ) = L 2. Construct G = (S N 1 N 2, T, {S S 1 S 2 } P 1 P 2, S), s.t N 1 N 2 = and S / {N 1 N 2 }. Any derivation in G has the form S S 1 S 2 G 1 w 1 S 2 G 2 w 1 w 2 for i {1, 2}, S i w i is a derivation in G i. i.e. the derivation only uses rules of P i. The derivations in G 1 and G 2 cannot be influenced by the contexts of the other part. So G is a context sensitive grammar, L(G) is a CSL. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 12 / 17

Relation Between Recursive and CSL Theorem Every context-sensitive language L is recursive. For CSL L, CSG G, Derivation of w S x 1 x 2 x 3 w has bound on no of steps.(bound on possible derivations). We know that x i x i+1 (G is non contracting). We can check whether w is in L(G) as follows Construct a transition graph whose vertices are the strings of length w. Paths correspond to derivation in grammars. Add edge from x to y if x y w L(G) iff thers is a path from S to w. Use path fining algorithm to find. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 13 / 17

Relation Between Recursive and CSL Theorem There exists a recursive language that is not context sensitive. Language L is recursive Create possible CSG G i = (N i, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, S i, P i ) which generates numbers. Now, define language L, which contains the numbers of the grammars which does not generate the number of its position in the list: L = {i i / L(G i )}. We can create a list of all context-sensitive generative grammars which generates numbers, and we can decide whether or not a context-sensitive grammar generates its position in the list. So language L is recursive. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 14 / 17

Relation Between Recursive and CSL Theorem There exists a recursive language that is not context sensitive. Language L is not context sensitive Assume, for contradiction, that L is a CSL So there is a CSG G k, s.t L(G k ) = L for some k. If k L(G k ), by the definition of L, we have k / L, but L = L(G k ). So a contradiction. If k / L(G k ), then k L is also a contradiction since L = L(G k ). So language L is not context sensitive. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 15 / 17

Summary Context sensitive languages are closed under union, intersection, complement, concatenation, kleene star, reversal. Every Context sensitive language is recursive. Further study Proof for other closure properties There is a recursive language that is not context-sensitive. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 16 / 17

References An Introduction to Formal Languages and Automata by Peter Linz Jones & Bartlett Publishers, 2011 Algebraic Properties of Language Families, by Prof. Dr. Jrgen Dassow http://theo.cs.ovgu.de/lehre/lehre09w/ti 1/ Context Sensitive Grammars Klaus Sutner,Carnegie Mellon University, Spring 2016 Theory of Automata, languages and computation by Rajendra Kumar Tata McGraw-Hill, 2010 and old seminars. Rajaguru K (CSA, IISc) Context Sensitive Grammars Automata Seminar, Dec,2016 17 / 17