Top Banner
Fall 2004 COMP 335 1 Undecidable problems for Recursively enumerable languages continued…
36

Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Dec 19, 2015

Download

Documents

Delphia Gaines
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 1

Undecidable problemsfor

Recursively enumerable languages

continued…

Page 2: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 2

• is empty?L

L• is finite?

L• contains two different strings of the same length?

Take a recursively enumerable language L

Decision problems:

All these problems are undecidable

Page 3: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 3

Theorem:

For a recursively enumerable language Lit is undecidable to determine whether is finite L

Proof:

We will reduce the halting problemto this problem

Page 4: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 4

finite languageproblemdecider

M

YES

NO

Suppose we have a decider for the finite language problem:

Let be the TM with M

)(ML

)(ML

finite

not finite

LML )(

Page 5: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 5

Halting problemdecider

M

w

YES

NO

halts onM w

We will build a decider for the halting problem:

doesn’t halt onM w

Page 6: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 6

YES

NO

M

w

NO

YES

Halting problem decider

wMfinite languageproblemdecider

We want to reduce the halting problem tothe finite language problem

Page 7: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 7

YES

NO

M

w

NO

YES

Halting problem decider

wMfinite languageproblemdecider

We need to convert one problem instanceto the other problem instance

convertinput ?

Page 8: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 8

Construct machine : wM

If enters a halt state, accept ( inifinite language)

M

Initially, simulates on input M w

Otherwise, reject ( finite language)

On arbitrary input strings

s

s

*

Page 9: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 9

M halts on

)( wML is infinite

if and only if

w

*)( wML

Page 10: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 10

construct

wM

YES

NO

M

w

NO

YES

halting problem decider

finite languageproblemdecider

wM

Page 11: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 11

• is empty?L

L• is finite?

L• contains two different strings of the same length?

Take a recursively enumerable language L

Decision problems:

All these problems are undecidable

Page 12: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 12

Theorem:

For a recursively enumerable language Lit is undecidable to determine whether contains two different strings of same length

L

Proof:We will reduce the halting problemto this problem

Page 13: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 13

Two-stringsproblemdecider

M

YES

NO

Suppose we have the deciderfor the two-strings problem:

Let be the TM withM

)(ML

)(ML

contains

Doesn’t contain

LML )(

two equal length strings

Page 14: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 14

Halting problemdecider

M

w

YES

NO

halts onM w

We will build a decider for the halting problem:

doesn’t halt onM w

Page 15: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 15

YES

NO

M

w

YES

NO

Halting problem decider

Two-stringsproblemdecider

wM

We want to reduce the halting problem tothe empty language problem

Page 16: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 16

YES

NO

M

w

YES

NO

Halting problem decider

Two-stringsproblemdecider

wM

We need to convert one problem instanceto the other problem instance

convertinputs ?

Page 17: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 17

Construct machine : wM

When enters a halt state, accept if or

M

Initially, simulate on input M w

as bs (two equal length strings )

On arbitrary input strings

},{)( baML w

Otherwise, reject ( )s )( wML

Page 18: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 18

M halts on

wM

if and only if

w

accepts two equal length strings

wM accepts and a b

Page 19: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 19

construct

wM

YES

NO

M

w

YES

NO

Halting problem decider

Two-stringsproblemdecider

wM

Page 20: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 20

Rice’s Theorem

Page 21: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 21

Non-trivial properties of recursively enumerable languages:

any property possessed by some (not all)recursively enumerable languages

Definition:

Page 22: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 22

Some non-trivial properties of recursively enumerable languages:

• is emptyL

L• is finite

L• contains two different strings of the same length

Page 23: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 23

Rice’s Theorem:

Any non-trivial property of a recursively enumerable languageis undecidable

Page 24: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 24

The Post Correspondence Problem

Page 25: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 25

Some undecidable problems forcontext-free languages:

• Is context-free grammar ambiguous?G

• Is ? )()( 21 GLGL

21,GG are context-free grammars

Page 26: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 26

We need a tool to prove that the previousproblems for context-free languagesare undecidable:

The Post Correspondence Problem

Page 27: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 27

The Post Correspondence Problem

Input: Two sequences of strings

nwwwA ,,, 21

nvvvB ,,, 21

n

Page 28: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 28

There is a Post Correspondence Solutionif there is a sequence such that:kji ,,,

kjikji vvvwww PC-solution:

Indices may be repeated or omitted

Page 29: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 29

Example:11100 111

001 111 11

1w 2w 3w

1v 2v 3v

:A

:B

PC-solution: 3,1,2 312312 vvvwww

11100111

Page 30: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 30

Example:00100 1000

0 11 011

1w 2w 3w

1v 2v 3v

:A

:B

There is no solution

Because total length of strings from is smaller than total length of strings from

BA

Page 31: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 31

1. The MPC problem is undecidable

2. The PC problem is undecidable

(by reducing MPC to PC)

(by reducing the membership to MPC)

We will show:

Page 32: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 32

Theorem: The PC problem is undecidable

Proof: We will reduce the MPC problem to the PC problem

Page 33: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 33

Some undecidable problems forcontext-free languages:

• Is context-free grammar ambiguous?

G

• Is ? )()( 21 GLGL

21,GG are context-free grammars

We reduce the PC problem to these problems

Page 34: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 34

Theorem:

Proof:

Let be context-free grammars. It is undecidableto determine if

21,GG

)()( 21 GLGL

Rdeduce the PC problem to thisproblem

Page 35: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 35

Suppose we have a decider for theempty-intersection problem

Empty-interectionproblemdecider

?)()( 21 GLGL

1G

2G

YES

NO

Context-free grammars

Page 36: Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…

Fall 2004 COMP 335 36

For a context-free grammar ,GTheorem:

it is undecidable to determineif G is ambiguous

Proof: Reduce the PC problem to this problem