applied computer science ii chapter 5: reducability prof. dr. luc de raedt institut für informatik...

25
Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Post on 21-Dec-2015

217 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Applied Computer Science IIChapter 5: Reducability

Prof. Dr. Luc De Raedt

Institut für InformatikAlbert-Ludwigs Universität Freiburg

Germany

Page 2: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Overview

• Examine several other undecidable problems

• Reducibility– Basic method to relate two problems to one

another in the light of “(un)solvability”– Reducibility is used for various types of

“unsolvability”, cf. complexity

• Mapping reducibility• The Post Correspondence Problem PCP

Page 3: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Reducability to compute

: map onto problem for

1. to map onto ( )

2. to compute ( )

3. return ( )

determine whether an NFA accepts

Assume you do not know an alg

w A

B

w f w

f w B

f w B

A w

Goal

Method

Example

Method

orithm that decides whether

an NFA accepts a string, but that you have an algorithm called that

decides whether a DFA accepts a string

You can obtain one using reduction

1. Transfor

P

m < , where is NFA into < ( ),

2. Run on < ( ),

3. Return answer of

A w A dfa A w

P dfa A w

P

Reductions

Page 4: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

and proofs by contradiction

To show that is not solvable

Suppose you know that is not solvable.

Reduce to

Conclude that is not solvable

(because solvability would imply that can be s

A

B

B A

A

A B

Reductions

olved)

Page 5: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Undecidable problems from language theory

{ , | is a TM and halts on input }

is undecidable

173

TM

TM

HALT M w M M w

HALT

p

Theorem

Proof

Page 6: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Computable functions

• Cf. Loop-programs

• Examples : – f(<m,n>)=m+n– f(<M>) = M’ where M’ accepts the same

language as TM M except that it does not move its head against the left “wall”; if M is not a TM then return epsilon

* *A function : is if

there is a deterministic Turing Machine that on every

input halts with just

com

( ) on its tape.

putablef

T

w f w

Page 7: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany
Page 8: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

If and is decidable, then is decidable

Let be a decider for

and the reduction from to

mA B B A

M B

f A B

Theorem

Proof

If and is undecidable, then is undecidablemA B A BCorollary

Page 9: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

TM m TMA HALTTheorem

Page 10: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

{ | is a TM and L( ) }

is undecidable ( )

174

TM

TM TM m TM

E M M M

E A E

p

Theorem

Proof

Page 11: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

{ | is a TM and L( ) is a regular language}

is undecidable ( )

175

TM

TM TM m TM

REGULAR M M M

REGULAR A REGULAR

p

Theorem

Proof n

*

Recognize {0 1 | 0} if does not accept

and otherwise

n n M w

Page 12: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

{ 1, 2 | 1 and 2 are TMs and ( 1) ( 2) }

is undecidable ( )

TM

TM TM m TM

EQ M M M M L M L M

EQ E EQ

Theorem

Page 13: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Reductions via computation histories

• Deterministic versus non-deterministic machines

• From now on we focus on deterministic machines

1 1

1

Let be a TM and a string

An for is

a sequence of configurations ,..., where is the starting configuration

of on ,

a

each corresponds to a legal transition,

a

ccepting computation history

n

m

i i

M w

M

C C C

M w C C

rejecting computation histor

d is an accepting configuration

A is similar except that it ends in

a rejecting configurat

y

ion.

mC

Page 14: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Linear bound automaton

Only limited memory available

A l is a restricted type of TM

where the tape head is not permitted to move off the portion

of the tape

inear bounde

containing t

d automato

he in

n

put.

Page 15: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

LBA

• LBAs are quite powerful, e.g.

Deciders for , , , are all LBAsDFA CFG DFA CFGA A E E

{ , | is an LBA that accepts } is decidable

Let be an LBA with states, symbols in its tape alphabet,

There are exactly . . distinct configu

contra

ration

st

s of

this w

f

ithLB

n

T

A

MA

A M w M w

M q g

q n g M

Theorem

Lemma

or a tape of length n

Page 16: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

• So, LBAs are fundamentally different than TMs !

Page 17: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

{ | is an LBA and L( ) }

is undecidable ( )

179 180

LBA

LBA TM LBA

E M M M

E A E

p

Theorem

Proof

{ | is an accepting computation history of on }B v v M w

Page 18: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

*

is undecidable

{ | is a CFG and ( ) }

CFG

CFG

ALL

ALL G G L G

Theorem

Page 19: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany
Page 20: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

{ | is an instance of the Post correspondence problem

with a match that starts with the first domino}

MPCP P P

Page 21: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

TM mA MPCPTheorem

0 1

#1. Put into P' as the first domino

# ... #

2. For every , and every , , where

if ( , ) ( , , ) put into P'

3. For every , , and every , , where

n

reject

reject

q w w

a b q r Q q q

qaq a r b R

br

a b c q r Q q q

if ( , ) ( , , ) put into P'

4. For every

put into P'

# #5. put and into P'

# #

6. For every

put and into P'

7

accept accept

accept accept

cqaq a r b L

rcb

a

a

a

a

aq q a

q q

. Finally, add

##

#acceptq

Page 22: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

mMPCP PCPTheorem

Transitivity implies that is undecidablePCP

Page 23: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

If and is Turing recognizable, then is Turing-recognizable

Let be a TM for

and the reduction from to

mA B B A

M B

f A B

Theorem

Proof

If and is not Turing recognizable,

then is not Turing recognizable

Usually, will be

Note also that if and only if

m

TM

m m

A B A

B

A A

A B A B

Corollary

Page 24: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Theorem 5.24 is neither Turing recognizable

nor co-Turing recognizable

1.

2.

TM

TM m TM

TM m TM

EQ

A EQ

A EQ

Theorem

Proof

Page 25: Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Conclusions

• Examine several other undecidable problems

• Reducibility– Basic method to relate two problems to one

another in the light of “(un)solvability”– Reducibility is used for various types of

“unsolvability”, cf. complexity

• Mapping reducibility• The Post Correspondence Problem PCP