# costas busch - lsu1 the post correspondence problem

Post on 20-Jan-2018

214 views

Category:

## Documents

Embed Size (px)

DESCRIPTION

Costas Busch - LSU3 We need a tool to prove that the previous problems for context-free languages are undecidable: The Post Correspondence Problem

TRANSCRIPT

Costas Busch - LSU

*

The Post Correspondence Problem

Costas Busch - LSU

*

Costas Busch - LSU

*

Some undecidable problems for

context-free languages:

Is context-free grammar ambiguous?

Is ?

are context-free grammars

Costas Busch - LSU

Costas Busch - LSU

*

We need a tool to prove that the previous

problems for context-free languages

are undecidable:

The Post Correspondence Problem

Costas Busch - LSU

Costas Busch - LSU

*

The Post Correspondence Problem

Input:

Two sets of strings

Costas Busch - LSU

Costas Busch - LSU

*

There is a Post Correspondence Solution

if there is a sequence such that:

PC-solution:

Indices may be repeated or omitted

Costas Busch - LSU

Costas Busch - LSU

*

Example:

PC-solution:

Costas Busch - LSU

Costas Busch - LSU

*

Example:

There is no solution

Because total length of strings from

is smaller than total length of strings from

Costas Busch - LSU

Costas Busch - LSU

*

The Modified Post Correspondence Problem

Inputs:

MPC-solution:

Costas Busch - LSU

Costas Busch - LSU

*

Example:

MPC-solution:

Costas Busch - LSU

Costas Busch - LSU

*

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:

Costas Busch - LSU

Costas Busch - LSU

*

Theorem: The MPC problem is undecidable

Proof: We will reduce the membership

problem to the MPC problem

Costas Busch - LSU

Costas Busch - LSU

*

Membership problem

Input: Turing machine

string

Question:

Undecidable

Costas Busch - LSU

Costas Busch - LSU

*

Membership problem

Input: unrestricted grammar

string

Question:

Undecidable

Costas Busch - LSU

Costas Busch - LSU

*

Suppose we have a decider for

the MPC problem

MPC solution?

YES

NO

String Sequences

MPC problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

We will build a decider for

the membership problem

YES

NO

Membership

problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

MPC problem

decider

Membership problem decider

The reduction of the membership problem

to the MPC problem:

yes

yes

no

no

Costas Busch - LSU

Costas Busch - LSU

*

MPC problem

decider

Membership problem decider

We need to convert the input instance of

one problem to the other

yes

yes

no

no

Reduction?

Costas Busch - LSU

Costas Busch - LSU

*

Convert grammar and string

Reduction:

to sets of strings and

Such that:

generates

There is an MPC

solution for

Costas Busch - LSU

Costas Busch - LSU

*

: special symbol

For every symbol

Grammar

: start variable

For every variable

Costas Busch - LSU

Costas Busch - LSU

*

Grammar

For every production

: special symbol

string

Costas Busch - LSU

Costas Busch - LSU

*

Example:

Grammar :

String

Costas Busch - LSU

Costas Busch - LSU

*

Costas Busch - LSU

Costas Busch - LSU

*

Costas Busch - LSU

Costas Busch - LSU

*

Grammar :

Costas Busch - LSU

Costas Busch - LSU

*

Derivation:

Costas Busch - LSU

Costas Busch - LSU

*

Derivation:

Costas Busch - LSU

Costas Busch - LSU

*

Derivation:

Costas Busch - LSU

Costas Busch - LSU

*

Derivation:

Costas Busch - LSU

Costas Busch - LSU

*

Derivation:

Costas Busch - LSU

Costas Busch - LSU

*

has an MPC-solution

if and only if

Costas Busch - LSU

Costas Busch - LSU

*

MPC problem

decider

Membership problem decider

Construct

yes

yes

no

no

Costas Busch - LSU

Costas Busch - LSU

*

Since the membership problem is undecidable,

The MPC problem is undecidable

END OF PROOF

Costas Busch - LSU

Costas Busch - LSU

*

Theorem: The PC problem is undecidable

Proof: We will reduce the MPC problem

to the PC problem

Costas Busch - LSU

Costas Busch - LSU

*

Suppose we have a decider for

the PC problem

PC solution?

YES

NO

String Sequences

PC problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

We will build a decider for

the MPC problem

MPC solution?

YES

NO

String Sequences

MPC problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

PC problem

decider

MPC problem decider

The reduction of the MPC problem

to the PC problem:

yes

yes

no

no

Costas Busch - LSU

Costas Busch - LSU

*

PC problem

decider

MPC problem decider

yes

yes

no

no

Reduction?

We need to convert the input instance of

one problem to the other

Costas Busch - LSU

Costas Busch - LSU

*

: input to the MPC problem

: input to the PC problem

Translated to

Costas Busch - LSU

Costas Busch - LSU

*

For each

For each

replace

Costas Busch - LSU

Costas Busch - LSU

*

PC-solution

These strings

Costas Busch - LSU

Costas Busch - LSU

*

PC-solution

MPC-solution

Costas Busch - LSU

Costas Busch - LSU

*

has a PC solution

has an MPC solution

if and only if

Costas Busch - LSU

Costas Busch - LSU

*

PC problem

decider

MPC problem decider

yes

yes

no

no

Construct

Costas Busch - LSU

Costas Busch - LSU

*

Since the MPC problem is undecidable,

The PC problem is undecidable

END OF PROOF

Costas Busch - LSU

Costas Busch - LSU

*

Some undecidable problems for

context-free languages:

Is context-free grammar

ambiguous?

Is ?

are context-free grammars

We reduce the PC problem to these problems

Costas Busch - LSU

Costas Busch - LSU

*

Theorem:

Proof:

Let be context-free

grammars. It is undecidable

to determine if

Reduce the PC problem to this

problem

(intersection problem)

Costas Busch - LSU

Costas Busch - LSU

*

Suppose we have a decider for the

intersection problem

Empty-

interection

problem

decider

YES

NO

Context-free

grammars

Costas Busch - LSU

Costas Busch - LSU

*

We will build a decider for

the PC problem

PC solution?

YES

NO

String Sequences

PC problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

PC problem decider

The reduction of the PC problem

to the empty-intersection problem:

no

yes

yes

no

Intersection

problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

PC problem decider

no

yes

yes

no

Reduction?

We need to convert the input instance of

one problem to the other

Intersection

problem

decider

Costas Busch - LSU

Costas Busch - LSU

*

Context-free grammar :

Introduce new unique symbols:

Context-free grammar :

Costas Busch - LSU

Costas Busch - LSU

*

if and only if

has a PC solution

Costas Busch - LSU

Costas Busch - LSU

*

Because are unique

There is a PC solution:

Costas Busch - LSU

Costas Busch - LSU

*

PC problem decider

no

yes

yes

no

Intersection

problem

decider

Construct

Context-Free

Grammars

Costas Busch - LSU

Costas Busch - LSU

*

Since PC is undecidable,

the Intersection problem is undecidable

END OF PROOF

Costas Busch - LSU

Costas Busch - LSU

*

For a context-free grammar ,

The

Recommended