cs21 decidability and tractability
Download
Skip this Video
Download Presentation
CS21 Decidability and Tractability

Loading in 2 Seconds...

play fullscreen
1 / 23

CS21 Decidability and Tractability - PowerPoint PPT Presentation


  • 122 Views
  • Uploaded on

CS21 Decidability and Tractability. Lecture 13 February 5, 2014. Outline. undecidable problems computation histories surprising contrasts between decidable/undecidable Rice’s Theorem Post Correspondence problem a non-RE and non-co-RE language the Recursion Theorem.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CS21 Decidability and Tractability' - ashby


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cs21 decidability and tractability

CS21 Decidability and Tractability

Lecture 13

February 5, 2014

CS21 Lecture 13

outline
Outline
  • undecidable problems
    • computation histories
    • surprising contrasts between decidable/undecidable
  • Rice’s Theorem
  • Post Correspondence problem
  • a non-RE and non-co-RE language
  • the Recursion Theorem

CS21 Lecture 13

dec and undec problems
Dec. and undec. problems
  • two problems regarding Context-Free Grammars:
    • does a CFG generate all strings:

ALLCFG = { : G is a CFG and L(G) = Σ*}

    • CFG emptiness:

ECFG = { : G is a CFG and L(G) = Ø}

  • Both decidable? both undecidable? one decidable?

CS21 Lecture 13

dec and undec problems1
Dec. and undec. problems

Theorem: ECFG is decidable.

Proof:

  • observation: for each nonterminal A, the set

SA = {w : A * w}

is non-empty iff there is some rule:

A → x

and  non-terminals B in string x, SB  Ø

CS21 Lecture 13

dec and undec problems2
Dec. and undec. problems

Proof:

  • on input
  • mark all terminals in G
  • repeat until no new non-terminals get marked:
    • if there is a production A→x1x2x3…xk
    • and each symbol x1, x2, …, xk has been marked
    • then mark A
  • if S marked, reject (GECFG), else accept (G2ECFG).
  • terminates? correct?

CS21 Lecture 13

dec and undec problems3
Dec. and undec. problems

Theorem: ALLCFG is undecidable.

Proof:

  • reduce from co-ATM (i.e. show co-ATM ≤m ALLCFG)
  • what should f() produce?
  • Idea:
    • produce CFG G that generates all strings that are notaccepting computation histories of M on w

CS21 Lecture 13

dec and undec problems4
Dec. and undec. problems

Proof:

  • build a NPDA, then convert to CFG
  • want to accept strings not of this form,

#C1#C2#C3#...#Ck#

plus strings of this form but where

    • C1 is not the start config. of M on input w, or
    • Ck is not an accept. config. of M on input w, or
    • Ci does not yield in one step Ci+1 for some i

CS21 Lecture 13

dec and undec problems5
Dec. and undec. problems

Proof:

  • our NPDA nondeterministically checks one of:
    • C1 is not the start config. of M on input w, or
    • Ck is not an accept. config. of M on input w, or
    • Ci does not yield in one step Ci+1 for some i
    • input has fewer than two #’s
  • details of first two?
  • to check third condition:
    • nondeterministically guess Ci starting position
    • how to check that Cidoesn’t yield in 1 step Ci+1 ?

CS21 Lecture 13

dec and undec problems6
Dec. and undec. problems

Proof:

  • checking:
    • Ci does not yield in one step Ci+1 for some i
  • push Ci onto stack
  • at #, start popping Ci and compare to Ci+1
    • accept if mismatch away from head location, or
    • symbols around head changed in a way inconsistent with M’s transition function.
  • is everything described possible with NPDA?

CS21 Lecture 13

dec and undec problems7
Dec. and undec. problems

Proof:

  • Problem: cannot compare Ci to Ci+1
  • could prove in same way that proved

{ww: w Σ*} not context-free

  • recall that

{wwR: w Σ*} is context-free

  • free to tweak construction of G in the reduction
  • solution: write computation history:

#C1#C2R#C3#C4R...#Ck#

CS21 Lecture 13

dec and undec problems8
Dec. and undec. problems

Proof:

  • f() = equiv. to NPDA below:
  • on input x, accept if not of form:
  • #C1#C2R#C3#C4R...#Ck#
  • accept if C1 is the not the start configuration for M on input w
  • accept if check that Ci does not yield in one step Ci+1
  • accept if Ck is not an accepting configuration for M
  • is f computable?
  • YES maps to YES?
    •  co-ATM  f(M, w)  ALLCFG
  • NO maps to NO?
    •  co-ATM  f(M, w)  ALLCFG

CS21 Lecture 13

rice s theorem
Rice’s Theorem
  • We have seen that the following properties of TM’s are undecidable:
    • TM accepts string w
    • TM halts on input w
    • TM accepts the empty language
    • TM accepts a regular language
  • Can we describe a single generic reduction for all these proofs?
  • Yes. Every property of TMs undecidable!

CS21 Lecture 13

rice s theorem1
Rice’s Theorem
  • A TM property is a language P for which
    • if L(M1) = L(M2) then  P iff  P
  • TM property P is nontrivial if
    • there exists a TM M1 for which  P, and
    • there exists a TM M2 for which  P.

Rice’s Theorem: Every nontrivial TM property is undecidable.

CS21 Lecture 13

rice s theorem2
Rice’s Theorem
  • The setup:
    • let TØ be a TM for which L(TØ) = Ø
      • technicality: if  P then work with property co-P instead of P.
      • conclude co-P undecidable; therefore P undec. due to closure under complement
    • so, WLOG, assume  P
    • non-triviality ensures existence of TM M1 such that  P

CS21 Lecture 13

rice s theorem3
Rice’s Theorem

Proof:

  • reduce from ATM (i.e. show ATM ≤m P)
  • what should f() produce?
  • f() = described below:
  • f computable?
  • YES maps to YES?
    •  ATM  L(f(M, w)) = L(M1) f(M, w)  P
  • on input x,
  • accept iff M accepts w and M1 accepts x
  • (intersection of two RE languages)

CS21 Lecture 13

rice s theorem4
Rice’s Theorem

Proof:

  • reduce from ATM (i.e. show ATM ≤m P)
  • what should f() produce?
  • f() = described below:
  • NO maps to NO?
    •  ATM  L(f(M, w)) = L(TØ) f(M, w)  P
  • on input x,
  • accept iff M accepts w and M1 accepts x
  • (intersection of two RE languages)

CS21 Lecture 13

post correspondence problem
Post Correspondence Problem
  • many undecidable problems unrelated to TMs and automata
  • classic example: Post Correspondence Problem

PCP = {<(x1, y1), (x2, y2), …, (xk, yk)> :

xi, yi Σ* and there exists (a1, a2, …, an) for which xa1xa2…xan= ya1ya2…yan}

CS21 Lecture 13

post correspondence problem1
Post Correspondence Problem

PCP = {<(x1, y1), (x2, y2), …, (xk, yk)> :

xi, yi Σ* and there exists (a1, a2, …, an) for which xa1xa2…xan= ya1ya2…yan}

x1

y1

x2

y2

x2

y2

x1

y1

x5

y5

x2

y2

x1

y1

x3

y3

x4

y4

x4

y4

x3

y3

xk

yk

x2x1x5x2x1x3x4x4 = y2y1y5y2y1y3y4y4

“tiles”

“match”

CS21 Lecture 13

post correspondence problem2
Post Correspondence Problem

Theorem: PCP is undecidable.

Proof:

  • reduce from ATM (i.e. show ATM ≤m PCP)
  • two step reduction makes it easier
  • first, show ATM ≤m MPCP

(MPCP = “modified PCP”)

  • next, show MPCP≤m PCP

CS21 Lecture 13

post correspondence problem3
Post Correspondence Problem

MPCP = {<(x1, y1), (x2, y2), …, (xk, yk)> :

xi, yi Σ* and there exists (a1, a2, …, an) for which x1xa1xa2…xan= y1ya1ya2…yan}

Proof of MPCP≤m PCP:

  • notation: for a string u = u1u2u3…um
    • u means the string u1u2u3u4…um
    • u means the string u1u2u3u4…um
    • u means the string u1u2u3u4…um

CS21 Lecture 13

post correspondence problem4
Post Correspondence Problem

Proof of MPCP≤m PCP:

  • given an instance (x1, y1), …, (xk, yk) of MPCP
  • produce an instance of PCP:

(x1, y1) , (x1, y1), (x2, y2), …, (xk, yk), (, )

  • YES maps to YES?
    • given a match in original MPCP instance, can produce a match in the new PCP instance
  • NO maps to NO?
    • given a match in the new PCP instance, can produce a match in the original MPCP instance

CS21 Lecture 13

post correspondence problem5
Post Correspondence Problem
  • YES maps to YES?
    • given a match in original MPCP instance, can produce a match in the new PCP instance

x1

y1

x4

y4

x5

y5

x2

y2

x1

y1

x3

y3

x4

y4

x4

y4

x1

y1

x4

y4

x5

y5

x2

y2

x1

y1

x3

y3

x4

y4

x4

y4



CS21 Lecture 13

post correspondence problem6
Post Correspondence Problem

can’t match unless start with this tile

  • NO maps to NO?
    • given a match in the new PCP instance, can produce a match in the original MPCP instance

x1

y1

x4

y4

x5

y5

x2

y2

x1

y1

x3

y3

x4

y4

x4

y4



“” symbols must align

x1

y1

x4

y4

x5

y5

x2

y2

x1

y1

x3

y3

x4

y4

x4

y4

can only appear at the end

CS21 Lecture 13

ad