slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY PowerPoint Presentation
Download Presentation
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Loading in 2 Seconds...

play fullscreen
1 / 28

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY - PowerPoint PPT Presentation


  • 133 Views
  • Uploaded on

15-453. FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. UNDECIDABILITY II: REDUCTIONS. Accept if M accepts w Rejects or loops otherwise . A TM = { (M,w) | M is a TM that accepts string w }. (constructive proof & subtle). A TM is undecidable:. Assume machine H semi-decides A TM.

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 'FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY' - wolfgang


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
slide1

15-453

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

slide3

Accept if M accepts w

Rejects or loops otherwise

ATM = { (M,w) | M is a TM that accepts string w }

(constructive proof & subtle)

ATM is undecidable:

Assume machine H semi-decides ATM

H( (M,w) ) =

Construct a new TM DH as follows: on input M, run H on (M,M) and output the “opposite” of Hwhenever possible.

slide4

DH

DH

Reject if M accepts M

(i.e. if H( M , M ) = Accept)

Accept if M rejects M

(i.e. if H( M , M ) = Reject)

loops if M loops on M

(i.e. if H( M , M ) loops)

DH

DH

DH

DH

DH ( M ) =

DH

DH

DH

DH

DH

DH

DH

Note: There is no contradiction here!

DH loops on DH

We can effectively construct an instance which does not belong to ATM (namely, (DH, DH) )

butH fails to tell us that.

slide5

That is:

Given any semi-decision machine H for ATM

(and thus a potential decision machine for ATM ),

we can effectively construct an instance which does not belong to ATM (namely, ( DH, DH ))

butH fails to tell us that.

So H cannot be a decision machine for ATM

slide6

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 H decides HALTTM

Proof:

We use H to construct a TM D that decides ATM

On input (M,w), D runs H on (M,w)

If H rejects then reject

If H accepts, run M on w until it halts:

Accept if M accepts and

Reject if M rejects

slide7

(M,w)

(M,w)

If M halts

D

Does M halt on w?

w

H

M

If M doesn’t halt: REJECT

slide8

In most cases, we will show that a language L is undecidable by showing that if it is decidable, then so is ATM

We reduce deciding ATM to deciding the language in question

ATM “<” L

So,ATM “<” HaltTM

Is HaltTM “<” ATM ?

slide9

Mw

ETM = { M | M is a TM and L(M) =  }

Theorem: ETM is undecidable

Assume, for a contradiction, that TM Z decides ETM

Proof:

UseZas a subroutine to decideATM

Algorithm for deciding ATM:

On input (M,w):

1. Create Mw

If s  w, REJECT

s

If s = w, run M(w)

So, L (Mw) =  M(w) does not accept

L (Mw)   M(w) accepts

2. Run Z on Mw

slide10

If s  w, REJECT

s

If s = w, run M(w)

Mw

(M,w)

So, L (Mw) =  M(w) does not accept

N

Mw

Z

L(Mw) = ?

L(N) = ?

Decision Machine

for ATM

Accepts if M does not accept w

Rejects, otherwise

REVERSE accept/reject

slide11

REGULARTM = { M | M is a TM and L(M) is regular}

Theorem: REGULARTM is undecidable

Assume, for a contradiction, that TM R decides REGULARTM

Proof:

slide12

If s = 0n1n, accept

s

Else run M(w)

Mw

L(Mw) = Σ* if M(w) accepts

{0n1n } otherwise

L(Mw) is regular  M(w) accepts

N

Mw

R

Is L(N) regular?

Is L(Mw) regular?

Yes  M accepts w

slide13

ALLPDA = { P | P is a PDA and L(P) = Σ* }

Theorem: ALLPDA is undecidable

Assume, for a contradiction, that TM A decides ALLPDA

Proof:

We use A to decide ATM

More subtle construction

Idea! If M(w) does not accept, then there is no accepting computation for Mon input w. Then any string of 0’s and 1’s will fail to be (a code for) an accepting computation. So, given (M, w) construct a PDAthat accepts non-accepting computations of Mon w.

Thus, M(w) does not acceptL(P) = Σ*

Idea!

slide14

q7

0

0

0

1

1

1

0

1

1

0

CONFIGURATIONS

11010q700110

slide15

COMPUTATION HISTORIES

An accepting computation history is a sequence of configurations C1,C2,…,Ck, where

1. C1 is the start configuration,

2. Ck is an accepting configuration,

3. Each Ci follows from Ci-1

An rejecting computation history is a sequence of configurations C1,C2,…,Ck, where

1. C1 is the start configuration,

2. Ck is a rejecting configuration,

3. Each Ci follows from Ci-1

slide16

M accepts w

if and only if

there exists an accepting computation history

that starts with C1=q0w

slide17

ALLPDA = { P | P is a PDA and L(P) = Σ* }

Theorem: ALLPDA is undecidable

Assume, for a contradiction, that TM A decides ALLPDA

Proof:

We use A to decide ATM

On input (M,w), construct a PDA P that accepts Σ* if and only if M does not accept w

P will recognize all strings that are NOT accepting computation histories for M on w

slide18

P will recognize all strings (read as sequences of configurations) that:

1. Do not start with C1

2. Do not end with an accepting configuration

3. Where some Ci does not properly yield Ci+1

ε,ε → ε

ε,ε → ε

ε,ε → ε

Non-deterministic checks for 1, 2, and 3.

slide19

P recognizes all strings except:

#C1# C2R#C3 #C4R#C5 #C6R#….# Ck

If k is odd, putCk on stack and see if Ck+1R follows properly:

For example,

If =uaqibv and (qi,b) = (qj,c,R),

then Ck properly yields Ck+1 Ck+1 = uacqjv

slide20

P recognizes all strings except:

#C1# C2R#C3 #C4R#C5 #C6R#….# Ck

If k is odd, putCk on stack and see if Ck+1R follows properly:

For example,

If =uaqibv and (qi,b) = (qj,c,L),

then Ck properly yields Ck+1 Ck+1 = uqjacv

slide21

P recognizes all strings except:

#C1# C2R#C3 #C4R#C5 #C6R#….# Ck

If k is even, putCkRon stack and see if Ck+1 follows properly:

For example,

If =uaqibv and (qi,b) = (qj,c,L),

then Ck properly yields Ck+1 Ck+1 = uqjacv

slide22

ALLPDA = { P | P is a PDA and L(P) = Σ* }

Theorem: ALLPDA is undecidable

Assume, for a contradiction, that TM A decides ALLPDA

Proof:

We use A to decide ATM

On input (M,w), construct a PDA P that accepts Σ* if and only if M does not accept w

P will recognize all strings that are NOT accepting computation histories for M on w

slide23

MAPPING REDUCIBILITY

f : Σ*  Σ* is a computable function if some Turing machine M, on every input w, halts with just f(w) on its tape

A language A is mapping reducible to language B, written A m B, if there is a computable function (“coding”) f : Σ*  Σ*, where for every w,

w  A  f(w)  B

f is called a reduction from A to B

slide24

A

B

f

f

slide25

Theorem: If A m B and B is decidable,

then A is decidable

Let M decide B and let f be a reduction from A to B

Proof:

We build a machine N that decides A as follows:

On input w:

1. Compute f(w)

2. Run M on f(w)

slide26

All undecidability proofs from today can be seen as constructing an f that reduces ATM to the proper language

Exercise.Construct such an f in each case. (Hint. Sometimes you have to consider the complement of the language. )

slide27

All undecidability proofs from today can be seen as constructing an f that reduces ATM to the proper language

ATMmHALTTM :

Map (M, w)  (M’, w)

where M’(w) = M(w) if M(w) accepts

loops otherwise

So (M, w) ATM  (M’, w) HALTTM