Inf2A: Turing Machines and Linear Bounded Automata. Lecture 26 Stuart Anderson

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

Language properties and Grammar of Parallel and Series Parallel Languages

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

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, ;

On the Polynomial Degree of Minterm-Cyclic Functions

A Version Space Approach to Learning Context-free Grammars

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

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

Proof Theory for Syntacticians

CS 598 Natural Language Processing

Grammars & Parsing, Part 1:

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

Enumeration of Context-Free Languages and Related Structures

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

Liquid Narrative Group Technical Report Number

Lecture 10: Reinforcement Learning

Natural Language Processing. George Konidaris

Improving Fairness in Memory Scheduling

"f TOPIC =T COMP COMP... OBJ

Refining the Design of a Contracting Finite-State Dependency Parser

Discriminative Learning of Beam-Search Heuristics for Planning

Backwards Numbers: A Study of Place Value. Catherine Perez

Morphotactics as Tier-Based Strictly Local Dependencies

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

Self Study Report Computer Science

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

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

Evolution of Collective Commitment during Teamwork

Reinforcement Learning by Comparing Immediate Reward

Lecture 1: Machine Learning Basics

CS 101 Computer Science I Fall Instructor Muller. Syllabus

A Grammar for Battle Management Language

Detecting English-French Cognates Using Orthographic Edit Distance

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

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

Physics 270: Experimental Physics

IS USE OF OPTIONAL ATTRIBUTES AND ASSOCIATIONS IN CONCEPTUAL MODELING ALWAYS PROBLEMATIC? THEORY AND EMPIRICAL TESTS

Learning to Think Mathematically With the Rekenrek

An Introduction to the Minimalist Program

Probability and Game Theory Course Syllabus

ISFA2008U_120 A SCHEDULING REINFORCEMENT LEARNING ALGORITHM

The Strong Minimalist Thesis and Bounded Optimality

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

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

University of Groningen. Systemen, planning, netwerken Bosman, Aart

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

A Minimalist Approach to Code-Switching. In the field of linguistics, the topic of bilingualism is a broad one. There are many

The Odd-Parity Parsing Problem 1 Brett Hyde Washington University May 2008

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

Lecture 2: Quantifiers and Approximation

arxiv: v1 [cs.cv] 10 May 2017

Computer Science 141: Computing Hardware Course Information Fall 2012

CS Machine Learning

Abstractions and the Brain

Lecture 1.1: What is a group?

Parsing of part-of-speech tagged Assamese Texts

Teachable Robots: Understanding Human Teaching Behavior to Build More Effective Robot Learners

OCR for Arabic using SIFT Descriptors With Online Failure Prediction

B.S/M.A in Mathematics

Ohio s Learning Standards-Clear Learning Targets

College Pricing. Ben Johnson. April 30, Abstract. Colleges in the United States price discriminate based on student characteristics

Hyperedge Replacement and Nonprojective Dependency Structures

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

Answer each question by placing an X over the appropriate answer. Select only one answer for each question.

WSU Five-Year Program Review Self-Study Cover Page

Cal s Dinner Card Deals

Radius STEM Readiness TM

Speech Segmentation Using Probabilistic Phonetic Feature Hierarchy and Support Vector Machines

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

Developing True/False Test Sheet Generating System with Diagnosing Basic Cognitive Ability

A Comparison of Annealing Techniques for Academic Course Scheduling

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

Detailed course syllabus

Course Content Concepts

Grade 2: Using a Number Line to Order and Compare Numbers Place Value Horizontal Content Strand

Blank Table Of Contents Template Interactive Notebook

1 NETWORKS VERSUS SYMBOL SYSTEMS: TWO APPROACHES TO MODELING COGNITION

A simulated annealing and hill-climbing algorithm for the traveling tournament problem

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

AMULTIAGENT system [1] can be defined as a group of

Tuesday 24th January Mr N Holmes Principal. Mr G Hughes Vice Principal (Curriculum) Mr P Galloway Vice Principal (Key Stage 3)

Learning to Schedule Straight-Line Code

Parsing natural language

GUIDE TO THE CUNY ASSESSMENT TESTS

A Comparison of Charter Schools and Traditional Public Schools in Idaho

Computer Organization I (Tietokoneen toiminta)

Mining Student Evolution Using Associative Classification and Clustering

Computer Science (CS)

Quantitative analysis with statistics (and ponies) (Some slides, pony-based examples from Blase Ur)

Multimedia Application Effective Support of Education

Standard 1: Number and Computation

ReinForest: Multi-Domain Dialogue Management Using Hierarchical Policies and Knowledge Ontology

Introduction to Causal Inference. Problem Set 1. Required Problems

Correspondence between the DRDP (2015) and the California Preschool Learning Foundations. Foundations (PLF) in Language and Literacy

TOPICS LEARNING OUTCOMES ACTIVITES ASSESSMENT Numbers and the number system

Listening and Speaking Skills of English Language of Adolescents of Government and Private Schools

Statewide Framework Document for:

Guide to the Uniform mark scale (UMS) Uniform marks in A-level and GCSE exams

Cross-Year Stability in Measures of Teachers and Teaching. Heather C. Hill Mark Chin Harvard Graduate School of Education

Transcription:

Inf2A: Turing Machines and Linear Bounded Automata Lecture 26 Stuart Anderson

Turing Machines Read/write head each tape cell contains a symbol from a finite alphabet Tape: unbounded in both directions Finite-state control Transitions determined by state and symbol being read, transitions labelled with symbol read, symbol written and direction of head movement

Turing Machines Unbounded state model: the tape has an unbounded number of cells each filled with a symbol drawn from some finite alphabet. The head reads the next input symbol, the head can move left one cell, right one cell, or remain stationary on each transition of the finite state control. The finite state control governs the manipulation of the tape. Final states in the control have no transitions leaving them one we enter a final state the machine has halted. p (a,b,d) q If we are in state p and the tape head is reading a, write b in the tape cell and move in direction d, d can be L(eft), R(ight) or meaning don t move

Languages Type 3: regular languages, recognised by FSMs Type 2: context-free languages, recognised by DPAs Type 1: context-sensitive languages, recognised by Linear-bounded automata (see later) Type 0: unrestricted L(M) the language recognised by M is those strings such that if we write them one symbol at a time into adjacent tape cells and start M with the tape head at the leftmost end of the string then eventually M reaches a final state. Tape cells that have never been used before are filled with a special symbol b representing a blank cell.

Recursive Enumerability Another name for Type 0 languages is the recursively enumerable languages. If M is a TM that recognises some language L there are three possibilities for what might happen if we run M on some string α: 1. M will halt in an accepting state so α is in L. 2. M will halt in some non accepting state and so α is not in L. 3. M will loop forever and so α is not a member of L but we have to wait an infinite amount of time to know it isn t So if a string a is not in L it may never be rejected explicitly by M.

Recursive Languages An important subclass of the Type 0 language is the recursive languages. A language L is recursive if there is a TM M which for any string α either halts accepting α or halts rejecting α. One interesting question is whether there are languages that are recursively enumerable but are not recursive (see later).

Recursively Enumerable Languages Any recursively enumerable language L whose complement ~L is also recursively enumerable is a recursive language. To see this: we know we have two machines M that accepts L and ~M that recognises ~L run M and ~M concurrently one or other of M and ~M will halt accepting eventually so we have a way of deciding whether or not a string is in the language. So, if there is a recursively enumerable language L that is not recursive, then the language ~L is not recursively enumerable and so there is no Turing machine that recognises ~L.

Example Consider the following two machines, M inc and M dec both of which use the alphabet {0,1,#}. M inc given a sequence of 1s and 0s with a # at the right-hand end adds one to the sequence of 1s and 0s if we read it as a binary number M dec given a sequence of 1s and 0s with a # at the right-hand end subtracts one from the sequence of 1s and 0s if we read it as a binary number. Once we have these two machines we can compose them to build an adder.

Example Final states are red. 5 (1,1,R) (0,0,R) 1 2 (#,#,L) (1,0,L) (0,1,R) (b,1,r) (1,1,R) (0,0,R) 1 (#,#,L) 2 (#,#,R) (0,1,L) (1,0,R) 4 (#,#,-) 3 M inc (0,0,R) (1,1,R) 4 (#,#,-) 3 M dec (0,0,R) (1,1,R)

Example: Composing Machines M dec 5 Input is n#m# with (0,0,L) The head initially anywhere (#,#,R) 4 (1,1,L) in the binary number m (#,#,-) The machine computes n+m M inc 4

More formally A Turing Machine M = (Q,Σ,Γ,δ,q 0,b,F) is a 7-tuple, where: Q is the stateset of the finite-state controller Σ is the finite input alphabet Γ is the finite tape alphabet Σ is a subset of Γ δ: is the transition function, mapping from state,tapealphabet pairs to state, tape alphabet, direction triples q 0 is the intitial state of the system b is the blank tape symbol that fills tape cells that have never been written by the machine F is the collection of final states

Definitions Continued For M, a configuration is a triple: (a 1 a m,q,a m+1 a n ) where the whole tape is a 1... a n, q is the current state and a m+1 is the currently read symbol. An initial configuration with input t is: (ε,q 0,t) We can define a computation relation for M in the following way: if δ(q,a) = (q,a,r) and a=a m+1 then we have (a 1 a m,q,a m+1 a n ) = (a 1 a m,a,q, a m+2 a n ), similarly for different directions of head movement, if we reach the end of either of the strings we extend them by adding b characters to the string (so configurations are always finite but may grow in an unbounded way). A string t is accepted by M iff (ε,q 0,t) = * (t,q,t ) where q is a final state of M. The language of M, L(M) is just {t t is accepted by M}

Context Sensitive Languages Type 1 languages in the Chomsky Hierarchy are also called Context-Sensitive languages. All productions in Context sensitive languages have the form α -> β where α β The acceptor corresponding to context-sensitive grammars is called a linear-bounded automaton which is a restriction of the Turing machine model. A Turing machine M is an LBA if: There is a linear function f such that for all inputs t, in accepting or rejecting t, M always uses fewer than f( t ) tape cells.

Linear-Bounded Automata What are the possibilities when we run an LBA M on some input t? Halt rejecting Halt accepting Use more space than is permitted by the linear function reject Loop in this case we know that we have a fixed amount of space we can use so that eventually the current configuration of the machine will be identical to some earlier configuration so we would loop forever and so the input is rejected. So, LBAs always either accept or reject the input. Caution: our machine could be non-deterministic

Question Closure Properties of LBAs Are LBAs closed under (don t just think about deterministic LBAs): Union? Concatenation? Intersection? Complement (tricky 1988)?

Question - Nondeterminism Is there a non-deterministic LBA M, such that for all deterministic LBAs D: L(D) L(M)?

Context-Sensitive Grammars - Recognising Given a context-sensitive grammar G with top symbol S, we know that because for each production of G, α -> β we have α β, then the lengths of the sentential forms in a derivation from S are nondecreasing. This means that if we want to decide whether some terminal string t is in L(G) then we just need to consider all derivations from S to strings of length t +1 or less. If t appears in that list then it is in L(G), otherwise it is not.

Constructing Context-Sensitive Grammars Consider the language L = {a n b m #b n c m m,n 0} How do we construct a Context-Sensitive Grammar for the language? L is not context-free (why? try the pumping lemma with string a k b k #b k c k ) We can use context-free rules to generate sentential forms with the right number of symbols in them: S -> A#C A -> aab ε C -> BCc ε In a sentential form the number of Bs to the left of the # is the same as the number of as, and right of the # the numbers of Bs and cs are equal. We use context sensitive rules to permute symbols: Bb -> bb bb -> Bb

Constructing Context-Sensitive Grammars Finally we want to get rid of remaining non-terminals using rules that make the Bs swap sides of the # (and convert them to bs so they can t swap back): B# -> #b #B -> b# Consider a derivation: S => A#C => aab#c => aaabb#c => aabb#c => aabb#bcc => aabb#bbccc => aabb#bbbcccc => aabb#bbbccc => aab#bbbbccc => aa#bbbbbccc => aa#bbbbbccc => aa#bbbbbccc => aab#bbbbccc => aab#bbbbccc => aab#bbbbccc => aabb#bbbccc => aabb#bbbccc => aabb#bbbccc => aabbb#bbccc For many context-sensitive languages, this approach to developing the production rules can be helpful.

Summary We have seen the definition of Turing Machine and Linear-Bounded Automaton. We have considered some basic results for Turing Machines, e.g. the undecidability of the Halting Problem. We have considered closure properties and issues on non-determinism for LBAs. We have seen that CSGs and LBAs are closely related but have not seen the proof of their equivalence.