UNRESTRICTED GRAMMARS

Similar documents
Theory of Computation (IX) Yijia Chen Fudan University

Computability Theory. CS215, Lecture 6,

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

CSCE 551: Chin-Tser Huang. University of South Carolina

Chapter 8. Turing Machine (TMs)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Introduction to Turing Machines

Context Sensitive Grammar

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

Theory of Computation

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Variants of Turing Machine (intro)

The Church-Turing Thesis

CS21 Decidability and Tractability

Decidability: Church-Turing Thesis

Lecture 12: Mapping Reductions

CA320 - Computability & Complexity

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

DM17. Beregnelighed. Jacob Aae Mikkelsen

V Honors Theory of Computation

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 14 : Turing Machines

1 Showing Recognizability

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

Theory of Computation Turing Machine and Pushdown Automata

Computability and Complexity

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Undecidable Problems and Reducibility

CSCC63 Worksheet Turing Machines

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Theory of Computation - Module 4

4.2 The Halting Problem

Chapter 3: The Church-Turing Thesis

1 Unrestricted Computation

CSE 105 THEORY OF COMPUTATION

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

A Universal Turing Machine

MA/CSSE 474 Theory of Computation

UNIT-VIII COMPUTABILITY THEORY

Turing Machines Part III

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Non-emptiness Testing for TMs

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Computation Histories

Exam Computability and Complexity

Decidable Languages - relationship with other classes.

CS154, Lecture 10: Rice s Theorem, Oracle Machines

The Unsolvability of the Halting Problem. Chapter 19

CSCE 551: Chin-Tser Huang. University of South Carolina

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

Decidability (What, stuff is unsolvable?)

Reducability. Sipser, pages

CSE 105 THEORY OF COMPUTATION

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

TURING MAHINES

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

Turing machines and linear bounded automata

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Fundamentals of Computer Science

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Problems, and How Computer Scientists Solve Them Manas Thakur

Theory of Computation

Turing machines and linear bounded automata

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Chapter 6: Turing Machines

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Computability and Complexity

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

On Rice s theorem. Hans Hüttel. October 2001

Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not.

Decidability (intro.)

Decidability and Undecidability

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

The Turing machine model of computation

CS3719 Theory of Computation and Algorithms

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Automata Theory CS F-13 Unrestricted Grammars

TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON

Introduction to Languages and Computation

Lecture 13: Turing Machine

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10

CSE 105 Theory of Computation

Most General computer?

Part I: Definitions and Properties

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

Transcription:

136 UNRESTRICTED GRAMMARS Context-free grammar allows to substitute only variables with strings In an unrestricted grammar (or a rewriting system) one may substitute any non-empty string (containing variables and terminals) with another one (also with the empty string ) An unrestricted grammar is a 4-tuple G = (V,, R, S), where V is the set of variables, is the set of terminals, = V is the alphabet of G, R + * is the set of rules, and S V is the start variable (w, w') R is denoted as w w' 137 Let G = (V,, R, S), strings v + and u, w, x * as well as v x a rule in R uvw yields string uxw in grammar G, uvw G uxw String v derives string w in grammar G, v G w, if there exists a sequence v 1, v 2,, v k * (k 0) s.t. v G v 1 G v 2 G G v k G w k =0: v G v for any v * 1

138 u * is a sentential form of G if S G u A sentential form consisting only of terminal symbols w * is a sentence of G The language of the grammar G consists of sentences L(G) = { w * S G w } The language { a k b k c k k 0 } is not a context-free one; it can be generated with an unrestricted grammar, which 1. Generates the variable sequence L(ABC) k (or ) 2. Orders the variables lexicographically LA k B k C k 3. Replaces the variables with terminals 139 S LT T ABCT ABC BA AB CB BC CA AC LA a aa aa ab ab bb bb bc bc cc cc 2

140 For example, we can generate the sentence aabbcc as follows S LT LABCT LABCABC LABACBC LAABCBC LAABBCC aabbcc aabbcc aabbcc aabbcc aabbcc aabbcc 141 Theorem A formal language L generated by an unrestricted grammar can be recognized with a Turing machine. Proof. Let G = (V,, R, S) be the unrestricted grammar generating language L. We devise a two-tape nondeterministic Turing machine M G for recognizing L. M G maintains the input string on tape 1. On tape 2 there is some sentential form of G which we try to rewrite as the input string. At the beginning tape 2 contains the start variable S. The computation of M G repeats the following stages 3

142 1. The tape head of tape 2 is (non-deterministically) moved to some location on the tape; 2. we choose (non-deterministically) some rule of G and try to apply it to the chosen location of the tape; 3. if the symbols on the tape match the symbols on the left-hand side of the rule, M G replaces them on tape 2 with the symbols on the right-hand side of the rule; 4. we compare the strings in tapes 1 and 2 with each other; a) if they are equal, the Turing machine enters the accepting final state and halts, b) otherwise, we go back to step 1 143 Theorem If a formal language L can be recognized with a Turing machine, then it can be generated with an unrestricted grammar. Proof. Let M =(Q,,,, q 0, accept, reject) be a standard Turing machine recognizing language L. Let us compose an unrestricted grammar G M that generates L. As variables of the grammar we take symbols representing all states q Q of M. The configuration of the TM u q av is represented as string [uqav]. By the transition function of M we give G M rules so that [uqav] GM [u'q'a'v'] u q av M u q a'v' 4

144 Then x L(M) [q 0 x] GM [uacceptv], u, v * There are three types of rules in G M : 1. Those that generate any string x[q 0 x], x * and [, ], q 0 V from the start variable: S T[q 0 ] T T ata a A a [q 0 [q 0 A a A a b ba a A a ] a] 145 2. Those that simulate the transition function of the Turing machine: (q, a) = (q', b, R) (q, a) = (q', b, L) (q, ) = (q', b, R) (q, ) = (q', b, L) (q, ) = (q',, L) qa bq' cqa q'cb q] bq'] cq] q'cb] cq] q'c] 5

146 3. Those that replace a string of the form [uacceptv] to an empty string accept E L E R ae L E L [E L E R a E R E R ] Now a string x in L(M) can be generated as follows S 1 x[q 0 x] 2 x[uacceptv] 3 x 147 3.3 The Definition of Algorithm The formulations of computation by Alonzo Church and Alan Turing were given in response to Hilbert s tenth problem which he posed in 1900 in his list of 23 challenges for the new century What Hilbert essentially asked for was an algorithm for determining whether a polynomial has an integral root Today we know that this problem is algorithmically unsolvable It is possible to give algorithms without them being exactly defined, but it is not possible to show that such cannot exist without a proper definition In was not until 1970 that Matijasevi showed that no algorithm exists for testing whether a polynomial has integral roots 6

148 Expressed as a formal language Hilbert s tenth problem is D = { p p is a polynomial with an integral root } Concentrating on single variable polynomials we can see how the language D could be recognized In order to find the correct value of the only variable, we go through its possible integral values 0, 1, -1, 2, -2, 3, -3, If the polynomial attains value 0 with any examined value of the variable, then we accept the input A similar approach is possible when there are multiple variables in the polynomial 149 For a single variable polynomial the roots must lie within ±k(c max / c 1 ), where k is the number of terms in the polynomial, c max is the coefficient with largest absolute value, and c 1 is the coefficient of the highest order term If a root is not found within these bounds, the machine rejects Matijasevi s theorem shows that calculating such bounds for multivariable polynomials is impossible The language D can, thus, be recognized with a Turing machine, but cannot be decided with a Turing machine (may never halt) 7

150 Computability Theory We will examine the algorithmic solvability of problems I.e. solvability using Turing machines We make a distinction between cases in which formal languages can be recognized with a Turing machine and those in which the Turing machine is required to halt with each input It turns out that there any many natural and interesting problems that cannot be solved using a Turing machine Hence, by Church-Turingin thesis these problems are unsolvable by a computer! 151 Definition 3.5 Call a language Turing-recognizable (or recursively enumerable, RE-language) if some Turingin machine recognizes it. Definition 3.6 Call a language Turing-decidable (or decidable, or recursive) if some TM decides it (halts on every input, is total). The decision problem corresponding to language A is decidable if A is Turing-decidable. A problem that is not decidable is undecidable The decision problem corresponding to language A is semidecidable if A is Turing-recognizable Observe: an undecidable problem can be semidecidable. 8