1 / 19

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. SET THEORY 101. A function ƒ : A ! B is:. 1-1 (or injective ) if. ƒ ( x) = ƒ ( y) ⇔ x=y. onto (or surjective ) if. ∀ y Ǝ x : y = ƒ ( x). bijective if it is 1-1 and onto. ƒ can help us count. If ƒ is:. 1-1 then |A| |B|.

Download Presentation

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

  2. SET THEORY 101 A function ƒ: A ! B is: 1-1 (or injective) if ƒ(x)=ƒ(y) ⇔ x=y onto (or surjective) if ∀y Ǝx: y = ƒ(x) bijective if it is 1-1 and onto. ƒcan help us count. If ƒis: 1-1 then |A| |B| ≤ onto then |A| |B| ≥ bijective then |B| |A|. =

  3. Let S be any set and 𝒫(S) be the power set of S Theorem: There is no onto map from S to P(S) Assume, for a contradiction, that there is an onto map ƒ: S 𝒫(S) Proof: We construct an D ⊆ S that cannot be the output, ƒ(y), for any y S. Let D = { x  S | x  ƒ(x) } If D = ƒ(y) then y  D if and only if y  D

  4. Y Y N Y (yi∈D) ≡ (yi ∉ ƒ(yi))

  5. The process of constructing a counterexample by “contradicting the diagonal” is called DIAGONALIZATION

  6. No matter what, 𝒫(S) always has more elements than S

  7. THE CHURCH-TURING THESIS L is recognized by a program for some computer* ⇔ L is recognized by a TM * The computer must be “reasonable”

  8. There are languages over {0,1} that are not decidable If we believe the Church-Turing Thesis, this means there are problems that computers inherently cannot solve. We proved this using a “simple” counting argument: There are more Languages than Turing Machines.

  9. Languages over {0,1} Turing Machines

  10. Not all languages over {0,1} are decidable Turing Machines Languages over {0,1} Sets of strings of 0s and 1s Strings of 0s and 1s S 𝒫(S) OK, but what does an undecidable language look like?

  11. THE DIAGONAL LANGUAGE DTM = {〈M〉 | M does not accept 〈M〉} is undecidable. * Y Y N Y *Note: Hypothetical. May not correspond to an actual encoding

  12. Programs can “accept” themselves as input: $ grep grep </usr/bin/grep Binary file (standard input) matches $ cat > /tmp/example.pl <<EOP #!/usr/bin/perl –n print “Yippee!\n” if /#/; EOP $ /tmp/example.pl </tmp/example.pl Yippee! Yippee! Programs can “reject” themselves as input: $ /usr/bin/python </usr/bin/python SyntaxError: invalid syntax

  13. THE ACCEPTANCE PROBLEM ATM = { 〈M,w〉 | M is a TM that accepts string w } Theorem: ATM is Turing-recognizable but NOT decidable ATM is Turing-recognizable: Define TM U as follows: On input 〈M,w〉, U runs M on w. If M ever accepts: accept. If M ever rejects: reject. If M(w) loops forever: U(〈M,w〉) loops forever.

  14. Accept if M(w) accepts Reject otherwise Reject if M accepts M Accept if M does not accept M ATM = { 〈M,w〉 | M is a TM that accepts string w } ATM is undecidable: (proof by contradiction) Assume TM acceptsInput decides ATM acceptsInput(M,w) = Construct a new TM LLPF as follows: on input 〈M〉 run acceptsInput(M,〈M〉) and output the opposite LLPF LLPF( M ) = LLPF LLPF LLPF LLPF

  15. accept accept accept reject reject accept reject reject accept reject reject accept accept reject reject reject OUTPUT OF acceptsInput(M,N)* … LLPF M1 M2 M3 M4 M1 accept accept M2 reject accept M3 accept reject M4 accept reject : ? LLPF reject reject accept accept *Note: Hypothetical. May not correspond to an actual encoding

  16. Theorem: ATM is Turing-recognizable (r.e.) but NOT decidable Theorem: ATM is not even Turing-recognizable! Proof: Suppose :ATM is recognized by TM V. We know ATM is recognized by U. Build Z to decide ATM: run V(M,w) and U(M,w) in parallel. If V accepts, reject; if U accepts, accept.

  17. r.e. languages recursive languages A language is called Turing-recognizable, semi-decidable, or recursively enumerable if some TM recognizes it A language is called decidable or recursive if some TM decides it all languages

  18. Accept if M(w) halts Reject if M(w) loops THE HALTING PROBLEM HALTTM = { 〈M,w〉 | M is a TM that halts on string w } Theorem: HALTTM is undecidable Assume, for a contradiction, that TM haltsOnInput decides HALTTM Proof: haltsOnInput(M,w) = We construct the machine liarLiar as follows: liarLiar(〈M〉): if haltsOnInput(M,〈M〉): return liarLiar(〈M〉) else: return true. liarLiar(〈liarLiar〉) halts iff liarLiar(〈liarLiar〉) loops!

  19. We can also prove that ATM is undecidable by “reusing” the proof that DTM is undecidable. Theorem. If ATM is decidable, then so is DTM. Proof: Suppose we have a program, acceptsInput, that decides ATM, e.g. acceptsInput(M,w) returns true if 〈M,w〉 ATM and returns false otherwise. We can build a TM notDiagonal to decide ¬DTM: notDiagonal(〈M〉) = return acceptsInput(M,〈M〉) Theorem. If HALTTM is decidable, then so is ATM. Proof: acceptsInput(M,w) = let M’ = M with qreject replaced by qloop. return haltsOnInput(M’,w)

More Related