Theory of Computer Science May 4, 2016 — D6. Decidability and Semi-Decidability Theory of Computer Science D6.1 (Semi-) Decidability D6. Decidability and Semi-Decidability D6.2 Recursive Enumerability Malte Helmert University of Basel D6.3 Models of Computation and Semi-Decidability May 4, 2016 D6.4 Summary M. Helmert (Univ. Basel) Theorie May 4, 2016 1 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 2 / 26 Overview: Computability Theory Further Reading (German) Computability Theory ◮ imperative models of computation: Literature for this Chapter (German) D1. Turing-Computability D2. LOOP- and WHILE-Computability D3. GOTO-Computability ◮ functional models of computation: Theoretische Informatik – kurz gefasst D4. Primitive Recursion and µ -Recursion by Uwe Sch¨ oning (5th edition) D5. Primitive/ µ -Recursion vs. LOOP-/WHILE-Computability ◮ Chapter 2.6 ◮ undecidable problems: D6. Decidability and Semi-Decidability D7. Halting Problem and Reductions D8. Rice’s Theorem and Other Undecidable Problems Post’s Correspondence Problem Undecidable Grammar Problems G¨ odel’s Theorem and Diophantine Equations M. Helmert (Univ. Basel) Theorie May 4, 2016 3 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 4 / 26
Further Reading (English) Guiding Question Literature for this Chapter (English) Guiding question for next three chapters: Introduction to the Theory of Computation by Michael Sipser (3rd edition) Which kinds of problems cannot ◮ Chapters 3.1 and 3.2 be solved by a computer? Notes: ◮ Sipser does not cover all topics we do. ◮ His definitions differ from ours. M. Helmert (Univ. Basel) Theorie May 4, 2016 5 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 6 / 26 D6. Decidability and Semi-Decidability (Semi-) Decidability D6. Decidability and Semi-Decidability (Semi-) Decidability Computable Functions ◮ From D1–D3, we now know enough about “computability” to use a higher level of abstraction. ◮ In particular, we now know that sufficiently rich D6.1 (Semi-) Decidability computational formalisms are equivalent. � Instead of saying Turing-/WHILE-/GOTO-computable or µ -recursive, we just say computable. � Instead of presenting TMs, WHILE programs etc. in detail, we use pseudo-code. � Instead of only considering computable functions over words (Σ ∗ → p Σ ∗ ) or numbers ( N k 0 → p N 0 ), we permit arbitrary domains and codomains (e.g., Σ ∗ → p { 0 , 1 } , N 0 → Σ ∗ ), ignoring details of encoding. M. Helmert (Univ. Basel) Theorie May 4, 2016 7 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 8 / 26
D6. Decidability and Semi-Decidability (Semi-) Decidability D6. Decidability and Semi-Decidability (Semi-) Decidability Computability vs. Decidability Decidability ◮ last chapters: computability of functions Definition (Decidable) ◮ now: analogous concept for languages A language L ⊆ Σ ∗ is called decidable if χ L : Σ ∗ → { 0 , 1 } , the characteristic function of L , is computable. Why languages? Here, for all w ∈ Σ ∗ : ◮ Only yes/no questions (“Is w ∈ L ?”) � instead of general function computation (“What is f ( w )?”) 1 if w ∈ L χ L ( w ) := makes it easier to investigate questions. 0 if w / ∈ L ◮ Results are directly transferable to the more general problem German: entscheidbar, charakteristische Funktion of computing arbitrary functions. ( � “playing 20 questions”) M. Helmert (Univ. Basel) Theorie May 4, 2016 9 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 10 / 26 D6. Decidability and Semi-Decidability (Semi-) Decidability D6. Decidability and Semi-Decidability (Semi-) Decidability Semi-Decidability Decidability and Semi-Decidability: Intuition Are these two definitions meaningfully different? Yes! decidability: Definition (Semi-Decidable) A language L ⊆ Σ ∗ is called semi-decidable if χ ′ L : Σ ∗ → p { 0 , 1 } , Yes “half” the characteristic function of L , is computable. w No Here, for all w ∈ Σ ∗ : � 1 if w ∈ L semi-decidability: χ ′ L ( w ) = undefined if w �∈ L Yes German: semi-entscheidbar, “halbe” charakteristische Funktion w ??? Example: Diophantine equations M. Helmert (Univ. Basel) Theorie May 4, 2016 11 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 12 / 26
D6. Decidability and Semi-Decidability (Semi-) Decidability D6. Decidability and Semi-Decidability (Semi-) Decidability Connection Decidability/Semi-Decidability (1) Connection Decidability/Semi-Decidability (2) Proof (continued). ( ⇐ ): Let M L be a semi-deciding algorithm for L , L be a semi-deciding algorithm for ¯ and let M ¯ L . Theorem (Decidable vs. Semi-Decidable) The following algorithm then is a decision procedure for L , A language L is decidable iff both L and ¯ L are semi-decidable. i.e., computes χ L ( w ) for a given input word w : FOR s := 1 , 2 , 3 , . . . DO Proof. IF M L stops on w in s steps with output 1 THEN ( ⇒ ): obvious (Why?) . . . RETURN 1 END IF M ¯ L stops on w in s steps with output 1 THEN RETURN 0 END DONE M. Helmert (Univ. Basel) Theorie May 4, 2016 13 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 14 / 26 D6. Decidability and Semi-Decidability Recursive Enumerability D6. Decidability and Semi-Decidability Recursive Enumerability Recursive Enumerability: Definition Definition (Recursively Enumerable) A language L ⊆ Σ ∗ is called recursively enumerable if L = ∅ or if there is a total and computable function D6.2 Recursive Enumerability f : N 0 → Σ ∗ such that L = { f (0) , f (1) , f (2) . . . } . We then say that f (recursively) enumerates L . Note: f does not have to be injective! German: rekursiv aufz¨ ahlbar, f z¨ ahlt L (rekursiv) auf � do not confuse with “abz¨ ahlbar” (countable) M. Helmert (Univ. Basel) Theorie May 4, 2016 15 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 16 / 26
D6. Decidability and Semi-Decidability Recursive Enumerability D6. Decidability and Semi-Decidability Recursive Enumerability Recursive Enumerability: Examples (1) Recursive Enumerability: Examples (2) ◮ Σ = { a , b } , f ( x ) = a x enumerates { ε, a , aa , . . . } . if x mod 3 = 0 hund ◮ Σ = { a , b , . . . , z } , f ( x ) = For every alphabet Σ, the language Σ ∗ can be recursively if x mod 3 = 1 katze if x mod 3 = 2 enumerated with a function f Σ ∗ : N 0 → Σ ∗ . (How?) superpapagei enumerates { hund , katze , superpapagei } . 2 x − 1 (as digits) if 2 x − 1 prime � ◮ Σ = { 0 , . . . , 9 } , f ( x ) = otherwise 3 enumerates Mersenne primes. M. Helmert (Univ. Basel) Theorie May 4, 2016 17 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 18 / 26 D6. Decidability and Semi-Decidability Recursive Enumerability D6. Decidability and Semi-Decidability Recursive Enumerability Recursive Enumerability and Semi-Decidability (1) Recursive Enumerability and Semi-Decidability (2) Theorem (Recursively Enumerable = Semi-Decidable) Proof (continued). A language L is recursively enumerable iff L is semi-decidable. ( ⇐ ): L is semi-decidable with semi-decision procedure M . Choose ˜ w ∈ L arbitrarily. (We have L � = ∅ .) Proof. Reminder: computable encoding/decoding functions Special case L = ∅ is not a problem. (Why?) encode , decode 1 , decode 2 (Chapter D5). Thus, let L � = ∅ be a language over the alphabet Σ. Define: ( ⇒ ): L is recursively enumerable. if n is the encoding of pair � x , y � x Let f be a function that enumerates L . and M executed on f Σ ∗ ( x ) stops in y steps f ( n ) = Then this is a semi-decision procedure for L , given input w : w ˜ otherwise FOR n := 0 , 1 , 2 , 3 , . . . DO f is total and computable and has codomain L . IF f ( n ) = w THEN Therefore f enumerates L . RETURN 1 END f uses idea of dovetailing: interleaving unboundedly many DONE . . . computations by starting new computations dynamically forever M. Helmert (Univ. Basel) Theorie May 4, 2016 19 / 26 M. Helmert (Univ. Basel) Theorie May 4, 2016 20 / 26
Recommend
More recommend