Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automata, Grammars and Languages

Similar presentations


Presentation on theme: "Automata, Grammars and Languages"— Presentation transcript:

1 Automata, Grammars and Languages
C SC 473 Automata, Grammars and Languages 9/12/2018 Automata, Grammars and Languages Discourse 08 Rice’s Theorem C SC 473 Automata, Grammars and Languages

2 Predicates, Properties and Sets
predicate, n. 1. Logic. That which is predicated or said of the subject in a proposition; the second term of a proposition, which is affirmed or denied of the first term by means of the copula, as in ‘paper is white’, ‘ink is not white’. 2. a. Gram. The statement made about a subject, including the logical copula (`is’, `are’, etc.). b. Math. An assertion or propositional function. c. Synonyms: `assertion’, `proposition’ Mathematically: a function which returns a truth-value (true or false). If the function P returns `true’ for an argument x, this indicates the property holds for that x: Predicates can be about objects of any universe: C SC 473 Automata, Grammars and Languages

3 Predicates, Properties and Sets
property: the quality or attribute that is asserted to hold by a predicate, as in `whiteness (or white) is a property of paper’, `blackness (or black) is a property of ink’. Used synonymously with quality or attribute. A property of Turing-recognizable sets is defined by a predicate on Turing-recognizable sets. example: the property of “emptiness” for a language is defined by the predicate P (L )  [ L = ]. C SC 473 Automata, Grammars and Languages

4 Rice’s Theorem A machine tool for proving problems undecidable
Any property of TMs that can be expressed as a property of languages [a machine independent property] is undecidable—except trivial properties. Trivial property: a property true for all Turing-recognizable sets, or for none. Michine independent properties: “the language accepted by M is a regular set.” Machine dependent properties C SC 473 Automata, Grammars and Languages

5 Rice’s Theorem (cont.) Theorem (Rice’s Theorem). The language
is decidable iff P is a trivial property. (Hence no non-trivial property of the Turing-recognizable sets can be decided.) Proof: (). If P is true for all TMs M, then is decidable. If P is false for all TMs then is decidable. (  ). (contrapositive). Assume that P is non-trivial. Without loss of generality, we can assume that [ For if not, we can use the property and show that the complementary language is undecidable.] C SC 473 Automata, Grammars and Languages

6 Rice’s Theorem (cont.) Since property P is non-trivial, there is some recognizable language B with Our goal is to reduce to To prove we assume there is a decider for and from it plus a reduction function, construct a decider for What is decider good at? Given an input it can tell whether M has property P or not. Our reduction function (“program translator”) will transform a pair to a program having “dual” behavior: if M accepts w then behaves like an acceptor for B; otherwise it behaves like an acceptor for . Since B has the property P while  does not, the decider will say “yes” iff M accepts w. C SC 473 Automata, Grammars and Languages

7 Rice’s Theorem (cont.) Construct from input a transformed program
so that the following holds: Here is what the “translator” C constructs: Note: if then: if then : So (*) holds as desired. With this reduction function, we proceed to the reduction itself. yes yes start C SC 473 Automata, Grammars and Languages

8 C SC 473 Automata, Grammars and Languages
Rice’s Theorem (Cont.) 9/12/2018 Reduction: Suppose there is a decider for Since the language is undecidable, so must be undecidable.  yes yes no no C SC 473 Automata, Grammars and Languages

9 Rice’s Theorem (Cont.) Corollary: Given a TM M the following properties of the language L(M) are all undecidable: Is L(M) empty? Is L(M) finite? Is L(M) regular? Is L(M) a CFL? Is the string foo  L(M) ? Does L(M) have more than 3 members? Does L(M) have fewer than 10 members? C SC 473 Automata, Grammars and Languages

10 Machine-Dependent Problems
Not all problems about TM-recognizable sets can be settled by Rice’s Theorem Rice’s Theorem only applies to properties of languages recognized Properties of the TM itself might be decidable or undeciable—the approach has to be ad hoc. Ex: Given a TM M, does it have an even number of states? Easily decidable Ex: Given TM M,q. Is there any configuration with p  q yielding a configuration with state q? Decidable. If there is a transition in  of form (p,a) = (q,-,-), pq, then yes else no. (We do not require any of these configurations to be reachable from the initial configuration.) C SC 473 Automata, Grammars and Languages

11 Machine-Dependent Problems
Ex: Undecidable Machine-Dependent Problem Predicate: Given TM M with ={0,1,blank}, does it ever print 3 consequtive 1’s on its tape (for any input). Reduction: reduction func. in 2 stages. uses 01 for 0 and 10 for 1, making changes in the rules accordingly. When M has a 0 in cell j then has a 0 in cell 2j and a 1 in cell 2j+1 (never a 111 on tape) modifies so that if accepts, prints 111 and halts in the accept state. prints 111  accepts   accepts   C SC 473 Automata, Grammars and Languages


Download ppt "Automata, Grammars and Languages"

Similar presentations


Ads by Google