You are on page 1of 54

Contents

2 Reducibility

1 Decidability

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 1 / 21


Decidability

Section outline

Decidability problems for


CFLs
1 Decidability Halting problem
Decidability problems for ATM is not
RLs Turing-recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 2 / 21


Decidability Decidability problems for RLs

Decidability problems for RLs

ADFA = {hB, wi | B is a DFA accepting w}


ADFA is decidable
ANFA = {hB, wi | B is a NFA accepting w}
ANFA is decidable
EDFA = {hAi | A is a DFA and L(A) = ∅}
EDFA is decidable
EQDFA = {hA, Bi | A, B are DFAs and L(A) = L(B)}
EQDFA is decidable
ALLDFA is decidable – hDi ∈ ALLDFA ≡ hD, F i ∈ EQDFA , F is a
DFA, L (F ) = ?
P

ALLNFA is decidable – convert NFA N to DFA D, then


hNi ∈ ALLNFA ≡ hDi ∈ ALLDFA TE
OF
TECHNO
LO

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 3 / 21


Decidability Decidability problems for CFLs

Decidability problems for CFLs

ACFG = {hG, wi | G is a CFG generating w}


ACFG is decidable
ECFG = {hGi | G is a CFG and L(G) = ∅}
ECFG is decidable
EQCFG = {hG, Hi | G, H are CFGs and L(G) = L(H)}
EQCFG is not decidable – to be shown later
Every CFL is decidable – via its CFG

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 4 / 21


Decidability Halting problem

Halting problem
ATM = {hM, wi | M is a TM accepting w}
Halting problem, because that is crucial to decide whether M rejects w
By diagonalisation with characteristic sequences for enumerated TMs,
some languages are not Turing recognisable
– not enough TMs for the possible languages
TM halting problem is undecidable

accept if M accepts w
TM H (hM, wi) =
reject if M does not accept w

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 5 / 21


Decidability Halting problem

Halting problem
ATM = {hM, wi | M is a TM accepting w}
Halting problem, because that is crucial to decide whether M rejects w
By diagonalisation with characteristic sequences for enumerated TMs,
some languages are not Turing recognisable
– not enough TMs for the possible languages
TM halting problem is undecidable

accept if M accepts w
TM H (hM, wi) =
reject if M does not accept w

accept if M does no accept hMi
TM D (hMi) =
reject if M accepts hMi
TM D (hMi) works oppositely to H (hM, hMii)
D (hDi)?

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 5 / 21


Decidability Halting problem

Halting problem
ATM = {hM, wi | M is a TM accepting w}
Halting problem, because that is crucial to decide whether M rejects w
By diagonalisation with characteristic sequences for enumerated TMs,
some languages are not Turing recognisable
– not enough TMs for the possible languages
TM halting problem is undecidable

accept if M accepts w
TM H (hM, wi) =
reject if M does not accept w

accept if M does no accept hMi
TM D (hMi) =
reject if M accepts hMi
TM D (hMi) works oppositely to H (hM, hMii)
D (hDi)?

accept if D does no accept hDi
– TM D (hDi) =
reject if D accepts hDi
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 5 / 21


Decidability Halting problem

Halting problem
ATM = {hM, wi | M is a TM accepting w}
Halting problem, because that is crucial to decide whether M rejects w
By diagonalisation with characteristic sequences for enumerated TMs,
some languages are not Turing recognisable
– not enough TMs for the possible languages
TM halting problem is undecidable

accept if M accepts w
TM H (hM, wi) =
reject if M does not accept w

accept if M does no accept hMi
TM D (hMi) =
reject if M accepts hMi
TM D (hMi) works oppositely to H (hM, hMii)
D (hDi)?

accept if D does no accept hDi
– TM D (hDi) =
reject if D accepts hDi
Contradiction, so neither TM D nor TM H can exist TE
OF
TECHNO
LO

GY
ITU
IAN INST

KH
ARAGPUR
IND
Associated diagonalisation?
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 5 / 21


Decidability ATM is not Turing-recognisable

ATM is not Turing-recognisable

A language L is co-Turing recognisable if L is Turing recognisable


A language L is both Turing recognisable and co-Turing
recognisable
– both L and L are TM recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 6 / 21


Decidability ATM is not Turing-recognisable

ATM is not Turing-recognisable

A language L is co-Turing recognisable if L is Turing recognisable


A language L is both Turing recognisable and co-Turing
recognisable
– both L and L are TM recognisable
ATM is TM recognisable
ATM is TM recognisable?
– no!, because then ATM /halting would be decidable
So, ATM is not TM recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 6 / 21


Reducibility

Section outline

Computation histories
Reductions via computation
2 Reducibility histories
Undecidable problems from Mapping reducibility
language theory PCP
Linear bounded automaton

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 7 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


HALTTM = {hM, wi | M is a TM halting on input w}
HALTTM is undecidable, as ATM reduces to HALTTM

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 8 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


HALTTM = {hM, wi | M is a TM halting on input w}
HALTTM is undecidable, as ATM reduces to HALTTM
ETM = {hMi | M is a TM and L(M) = ∅}

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 8 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


HALTTM = {hM, wi | M is a TM halting on input w}
HALTTM is undecidable, as ATM reduces to HALTTM
ETM = {hMi | M is a TM and L(M) = ∅}
Let TM M1 reject any string x 6= w and accept x if M accepts w
If R is a decider for ETM , let TM S decide on hM, wi as follows:
construct M1 from hM, wi
run R on M1 and accept if R rejects (L(M1 ) 6= ∅ as M accepts w)
and reject if R accepts (M rejects w or loops on w)

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 8 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


HALTTM = {hM, wi | M is a TM halting on input w}
HALTTM is undecidable, as ATM reduces to HALTTM
ETM = {hMi | M is a TM and L(M) = ∅}
Let TM M1 reject any string x 6= w and accept x if M accepts w
If R is a decider for ETM , let TM S decide on hM, wi as follows:
construct M1 from hM, wi
run R on M1 and accept if R rejects (L(M1 ) 6= ∅ as M accepts w)
and reject if R accepts (M rejects w or loops on w)
ETM is undecidable, as ATM reduces to ETM
NB ETM undecidable ≡ ETM undecidable – unaffected by
complementation
Let TM M10 reject x if x 6= w or if M accepts w and accept x if M
rejects w (x 6∈ L(M10 ) if M loops on w)
L(M10 ) = ∅ if M accepts w or loops on w and L(M10 ) 6= ∅ if M
rejects w
Thus, a decider of ETM applied on M1 will not help to correctly TE
OF
TECHNO
LO

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

decide on ATM 19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 8 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


(contd.)

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

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 9 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


(contd.)

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


Create M2 that accepts x = 0n 1n ensuring that a non-regular string
is accepted
Any other string x 6= 0n 11 is accepted if M accepts w
L(M2 ) is regular (= ? ) ≡ M accepts w
P

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 9 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


(contd.)

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


Create M2 that accepts x = 0n 1n ensuring that a non-regular string
is accepted
Any other string x 6= 0n 11 is accepted if M accepts w
L(M2 ) is regular (= ? ) ≡ M accepts w
P

REGULARTM is undecidable, as ATM reduces to REGULARTM


What about CFLTM ?

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 9 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


(contd.)

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


Create M2 that accepts x = 0n 1n ensuring that a non-regular string
is accepted
Any other string x 6= 0n 11 is accepted if M accepts w
L(M2 ) is regular (= ? ) ≡ M accepts w
P

REGULARTM is undecidable, as ATM reduces to REGULARTM


What about CFLTM ?
Rice’s theorem – to be studied (and presented in tutorial)

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 9 / 21


Reducibility Undecidable problems from language theory

Undecidable problems from language theory


(contd.)

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


Create M2 that accepts x = 0n 1n ensuring that a non-regular string
is accepted
Any other string x 6= 0n 11 is accepted if M accepts w
L(M2 ) is regular (= ? ) ≡ M accepts w
P

REGULARTM is undecidable, as ATM reduces to REGULARTM


What about CFLTM ?
Rice’s theorem – to be studied (and presented in tutorial)
EQTM = {hM1 , M2 i | M1 , M2 are TMs and L(M1 ) = L(M2 )}
EQTM is undecidable, as ETM reduces to EQTM
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 9 / 21


Reducibility Linear bounded automaton

Linear bounded automaton

A linear bounded automaton (LBA) is a restricted TM wherein the


TM head is not allowed to move beyond the tape positions
containing the input
A direct consequence of this restrictionPis that the number of
configurations of a LBA with q states, | | = g and n as length of
input is qng n – why?

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 10 / 21


Reducibility Linear bounded automaton

Linear bounded automaton

A linear bounded automaton (LBA) is a restricted TM wherein the


TM head is not allowed to move beyond the tape positions
containing the input
A direct consequence of this restrictionPis that the number of
configurations of a LBA with q states, | | = g and n as length of
input is qng n – why?
q possible states
TM head can be only in one of the n positions
g n possible symbol patterns on the tape

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 10 / 21


Reducibility Linear bounded automaton

Linear bounded automaton

A linear bounded automaton (LBA) is a restricted TM wherein the


TM head is not allowed to move beyond the tape positions
containing the input
A direct consequence of this restrictionPis that the number of
configurations of a LBA with q states, | | = g and n as length of
input is qng n – why?
q possible states
TM head can be only in one of the n positions
g n possible symbol patterns on the tape
ALBA is decidable – why

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 10 / 21


Reducibility Linear bounded automaton

Linear bounded automaton

A linear bounded automaton (LBA) is a restricted TM wherein the


TM head is not allowed to move beyond the tape positions
containing the input
A direct consequence of this restrictionPis that the number of
configurations of a LBA with q states, | | = g and n as length of
input is qng n – why?
q possible states
TM head can be only in one of the n positions
g n possible symbol patterns on the tape
ALBA is decidable – why
Using pigeon hole principle
Run the LBA; if it run length crosses qng n , then it has to loop
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 10 / 21


Reducibility Linear bounded automaton

Linear bounded automaton

A linear bounded automaton (LBA) is a restricted TM wherein the


TM head is not allowed to move beyond the tape positions
containing the input
A direct consequence of this restrictionPis that the number of
configurations of a LBA with q states, | | = g and n as length of
input is qng n – why?
q possible states
TM head can be only in one of the n positions
g n possible symbol patterns on the tape
ALBA is decidable – why
Using pigeon hole principle
Run the LBA; if it run length crosses qng n , then it has to loop
What about ELBA ?
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 10 / 21


Reducibility Computation histories

Computation histories

An accepting computation history for at TM M on w is a finite


sequence C1 , . . . , Ct of configurations such that
C1 : start configuration
Ct : terminal accepting configuration containing qacc
Ci : follows from Ci−1 (i > 1), as a result of a valid move
For a rejecting computation history, Ct contains qrej

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 11 / 21


Reducibility Reductions via computation histories

Decidability of ELBA
Consider a LBA BM that takes an input x and accepts x if x corresponds
to a accepting computation history of M on w
#C1 #C2 # . . . #Ct # is a valid computation history
L(BM ) = {x|x is a valid computation history of M}
LBA BM needs to test whether x is a valid computation history, by testing

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 12 / 21


Reducibility Reductions via computation histories

Decidability of ELBA
Consider a LBA BM that takes an input x and accepts x if x corresponds
to a accepting computation history of M on w
#C1 #C2 # . . . #Ct # is a valid computation history
L(BM ) = {x|x is a valid computation history of M}
LBA BM needs to test whether x is a valid computation history, by testing
C1 = q0 w1 w2 . . . wn is the initial configuration
Ci follows from Ci−1 (i > 1) through a valid move
– Ci and Ci−1 must be identical except for the positions under and
adjacent to the head in Ci−1
– there should be a move of M to justify the difference between Ci
and Ci−1
Ct ∈ Γ? qacc Γ? is the terminal configuration
NB BM works on any input x to check if it’s an accepting computation history

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 12 / 21


Reducibility Reductions via computation histories

Decidability of ELBA
Consider a LBA BM that takes an input x and accepts x if x corresponds
to a accepting computation history of M on w
#C1 #C2 # . . . #Ct # is a valid computation history
L(BM ) = {x|x is a valid computation history of M}
LBA BM needs to test whether x is a valid computation history, by testing
C1 = q0 w1 w2 . . . wn is the initial configuration
Ci follows from Ci−1 (i > 1) through a valid move
– Ci and Ci−1 must be identical except for the positions under and
adjacent to the head in Ci−1
– there should be a move of M to justify the difference between Ci
and Ci−1
Ct ∈ Γ? qacc Γ? is the terminal configuration
NB BM works on any input x to check if it’s an accepting computation history
L(BM ) 6= ∅ ≡ hM, wi ∈ ATM
TECHNO
OF LO
TE

GY
Thus ATM reduces to ELBA and so ELBA is undecidable

ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 12 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG
Can a PDA D (with grammar G) be designed to recognise any string
except those representing accepting computation histories of TM M?
Then L(D) = L(G) = ? ≡ L(M) = ∅ – ETM reduces to ALLCFG
P

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 13 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG
Can a PDA D (with grammar G) be designed to recognise any string
except those representing accepting computation histories of TM M?
Then L(D) = L(G) = ? ≡ L(M) = ∅ – ETM reduces to ALLCFG
P

Let y = #C1 #C2 #C3 #C4 # . . . #Ct # be a computation history (y may


be any string)
Preprocess y as x = #C1 #C2R #C3 #C4R # . . . #Ct # (if y looks like a
computation history, otherwise, let y = x)
Preprocessing is to make it easy for D to work on x
– w1 and w2 cannot be compared by PDA, but w1 and w2R can

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 13 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG
Can a PDA D (with grammar G) be designed to recognise any string
except those representing accepting computation histories of TM M?
Then L(D) = L(G) = ? ≡ L(M) = ∅ – ETM reduces to ALLCFG
P

Let y = #C1 #C2 #C3 #C4 # . . . #Ct # be a computation history (y may


be any string)
Preprocess y as x = #C1 #C2R #C3 #C4R # . . . #Ct # (if y looks like a
computation history, otherwise, let y = x)
Preprocessing is to make it easy for D to work on x
– w1 and w2 cannot be compared by PDA, but w1 and w2R can
How can x not be a computation history?

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 13 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG
Can a PDA D (with grammar G) be designed to recognise any string
except those representing accepting computation histories of TM M?
Then L(D) = L(G) = ? ≡ L(M) = ∅ – ETM reduces to ALLCFG
P

Let y = #C1 #C2 #C3 #C4 # . . . #Ct # be a computation history (y may


be any string)
Preprocess y as x = #C1 #C2R #C3 #C4R # . . . #Ct # (if y looks like a
computation history, otherwise, let y = x)
Preprocessing is to make it easy for D to work on x
– w1 and w2 cannot be compared by PDA, but w1 and w2R can
How can x not be a computation history?
C1 is not a valid start configuration
Ct is not a valid accepting configuration
Ci doesn’t follow from Ci−1 (i > 1) through a valid move
– Ci and Ci−1 may not be identical except for the positions under
and adjacent to the head in Ci−1
– there should not be a move of M to justify the difference between
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

Ci and Ci−1 , if they are otherwise identical


yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 13 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG and EQCFG


Construct an NPDA D to non-deterministically check one of these:
C1 is not a valid start configuration, then accept
Ct is not a valid accepting configuration, then accept
Ci doesn’t follow from Ci−1 (i > 1) through a valid move, then accept
– Ci and Ci−1 may not be identical except for the positions under
and adjacent to the head in Ci−1
– there should not be a move of M to justify the difference between
Ci and Ci−1 , if they are otherwise identical

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 14 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG and EQCFG


Construct an NPDA D to non-deterministically check one of these:
C1 is not a valid start configuration, then accept
Ct is not a valid accepting configuration, then accept
Ci doesn’t follow from Ci−1 (i > 1) through a valid move, then accept
– Ci and Ci−1 may not be identical except for the positions under
and adjacent to the head in Ci−1
– there should not be a move of M to justify the difference between
Ci and Ci−1 , if they are otherwise identical
Derive G to generate precisely those strings accepted by D
Now, L(G) = ? ≡ L(M) = ∅
P

ETM reduces to ALLCFG , hence ALLCFG is undecidable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 14 / 21


Reducibility Reductions via computation histories

Decidability of ALLCFG and EQCFG


Construct an NPDA D to non-deterministically check one of these:
C1 is not a valid start configuration, then accept
Ct is not a valid accepting configuration, then accept
Ci doesn’t follow from Ci−1 (i > 1) through a valid move, then accept
– Ci and Ci−1 may not be identical except for the positions under
and adjacent to the head in Ci−1
– there should not be a move of M to justify the difference between
Ci and Ci−1 , if they are otherwise identical
Derive G to generate precisely those strings accepted by D
Now, L(G) = ? ≡ L(M) = ∅
P

ETM reduces to ALLCFG , hence ALLCFG is undecidable


What about EQCFG ?
Let F be a grammar to generate all strings in ? ,
P

hF , Gi ∈ EQCFG if and only if G ∈ ALLCFG


Hence EQCFG is undecidable, as a decider for EQCFG can be used to TE
OF
TECHNO
LO

GY
ITU
IAN INST

KH
ARAGPUR
construct a decider for ALLCFG

IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 14 / 21


Reducibility Mapping reducibility

Mapping reducibility

A function f : ? → ? is a computable function if some TM M, on


P P

every input w on the tape, halts with f (w) on the tape – examples?

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 15 / 21


Reducibility Mapping reducibility

Mapping reducibility

A function f : ? → ? is a computable function if some TM M, on


P P

every input w on the tape, halts with f (w) on the tape – examples?
Computable functions may transform machine descriptions – as
those described earlier
Language A is mapping reducible to language B, written as
A ≤m B, if there is a computable function f : ? → ? , where for
P P

every w, w ∈ A ≡ f (w) ∈ B – f is the reduction from A to B


A ≤m B ≡ A ≤m B
To test whether w ∈ A, one may test whether f (w) ∈ B

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 15 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM
If A ≤m B, then if B is Turing recognisable, so is A

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM
If A ≤m B, then if B is Turing recognisable, so is A
If A ≤m B, then if A is not Turing recognisable, neither is B
ATM ≤m ETM ≡ ATM ≤m ETM

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM
If A ≤m B, then if B is Turing recognisable, so is A
If A ≤m B, then if A is not Turing recognisable, neither is B
ATM ≤m ETM ≡ ATM ≤m ETM
ATM is not Turing recognisable, so ETM is not Turing recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM
If A ≤m B, then if B is Turing recognisable, so is A
If A ≤m B, then if A is not Turing recognisable, neither is B
ATM ≤m ETM ≡ ATM ≤m ETM
ATM is not Turing recognisable, so ETM is not Turing recognisable
An attempt to reduce ATM to ETM (via M10 ) failed

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

If A ≤m B, then if B is decidable, so is A
If A ≤m B, then if A is undecidable, so is B – check earlier uses
ETM to EQTM , ATM to ETM
If A ≤m B, then if B is Turing recognisable, so is A
If A ≤m B, then if A is not Turing recognisable, neither is B
ATM ≤m ETM ≡ ATM ≤m ETM
ATM is not Turing recognisable, so ETM is not Turing recognisable
An attempt to reduce ATM to ETM (via M10 ) failed
– for a good reason ...
ATM ≤m ETM ⇒ ETM is not TM recognisable, but ETM is TM
recognisable – M ∈ ETM if ∃w s.t. M accepts w OF
TECHNO
LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 16 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

Also, ETM ≤m EQTM , so EQTM is not Turing recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 17 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

Also, ETM ≤m EQTM , so EQTM is not Turing recognisable


Now, for hM, wi, create m/cs M1 and M2 and output hM1 , M2 i
M1 : Accept any input x
M2 : Accept input x if M accepts w

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 17 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

Also, ETM ≤m EQTM , so EQTM is not Turing recognisable


Now, for hM, wi, create m/cs M1 and M2 and output hM1 , M2 i
M1 : Accept any input x
M2 : Accept input x if M accepts w
Thus, ATM ≤m EQTM

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 17 / 21


Reducibility Mapping reducibility

Mapping reducibility (contd.)

Also, ETM ≤m EQTM , so EQTM is not Turing recognisable


Now, for hM, wi, create m/cs M1 and M2 and output hM1 , M2 i
M1 : Accept any input x
M2 : Accept input x if M accepts w
Thus, ATM ≤m EQTM ≡ ATM ≤m EQTM
EQTM is neither Turing recognisable nor co-Turing recognisable

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 17 / 21


Reducibility PCP

PCP – a not so simple puzzle


Let have at least two symbols
P

An instance  of the
 Post Correspondence
  problem (PCP) is given by a
u1 um
sequence ,··· , word dominos over ?
P
v1 vm
Is there a (finite) sequence i1 , . . . , ip , ij ∈ 1..m, 1 ≤ j ≤ m such that
ui1 ui2 . . . uip = vi1 vi2 . . . vip ?
     
a ab bba
Instance: , ,
baa aa bb
       
bba ab bba a
Solution: 3231: , , ,
bb aa bb baa

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 18 / 21


Reducibility PCP

PCP – a not so simple puzzle


Let have at least two symbols
P

An instance  of the
 Post Correspondence
  problem (PCP) is given by a
u1 um
sequence ,··· , word dominos over ?
P
v1 vm
Is there a (finite) sequence i1 , . . . , ip , ij ∈ 1..m, 1 ≤ j ≤ m such that
ui1 ui2 . . . uip = vi1 vi2 . . . vip ?
     
a ab bba
Instance: , ,
baa aa bb
       
bba ab bba a
Solution: 3231: , , ,
bb aa bb baa
PCP is undecidable if | | ≥ 2
P

Reduce ATM to PCP


Create a PCP instance (a suitable set of dominos) for hM, wi to have a
unique solution if M accepts w with the accepting computation history of OF
TECHNO
LO
TE

M on w

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 18 / 21


Reducibility PCP

MPCP: PCP with match starting from first domino


 
#
Initial C1 :
#q0 w1 . . . wn
 
qa
R transition δ(q, a) = hr , b, Ri: , for every a, b ∈ Γ and every
br
q, r ∈ Q
 
cqa
L transition δ(q, a) = hr , b, Li: , for every a, b, c ∈ Γ and every
rcb
q, r ∈ Q
 
a
Symbols , for every a ∈ Γ
a
   
# #
Boundaries , , (simulate infinite tape to the right)
# t#
   
aqacc qacc a
Termination , , gobble on termination to close
qacc qacc
matching
 
qacc ##
Finish
TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

# 19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 19 / 21


Reducibility PCP

MPCP → PCP

For a string u = u1 u2 . . . un , define the following


?u: ?u1 ? u2 ? . . . ? un
u?: u1 ? u2 ? . . . ? un ?
?u?: ?u1 ? u2 ? . . . ? un ?
       
t1 t2 t3 tn
MPCP: , , ,...,
b1 b2 b3 bn
         
?t1 ?t2 ?t3 ?tn ?
PCP: , , ,..., ,
?b1 ? b2 ? b3 ? bn ? 

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 20 / 21


Reducibility PCP

MPCP example

Γ = {0, 1, 2, t}, w = 0100, q0


         
t1 # 0 1 2
d1 = = ; d2 = , d3 = , d4 = ,
b #q 0100# 0 1 2
 1  0       
t # # aqacc qacc a
d5 = ; d6 = , d7 = d8 = , d9 = ,
t # t# qacc qacc
 
qacc ##
d10 =
#
   
q0 0 q7 1
δ(q0 , 0) = hq7 , 2, Ri → d11 = ; δ(q7 , 1) = hq5 , 0, Ri → d12 = ;
2q7 0q5
     
0q5 0 1q5 0 2q5 0
δ(q5 , 0) = hq9 , 2, Li → d13 = , d14 = , d15 = , d16 =
q9 02 q9 12 q9 22
 
tq5 0
q9 t 2
#C1 #C2 #C3 #C4 # . . . #Ct . . . → d1 d11 d3 d2 d2 d6 d4 d12 d2 d2 d6 . . . d4 d3 d9 d4 d2 d6 . . . d10
The transformations may be applied to obtain the PCP instance

TECHNO
OF LO
TE

GY
ITU
IAN INST

KH
ARAGPUR
IND
 

19 5 1

yog, km s kOflm^

Chittaranjan Mandal (IIT Kharagpur) FoCS October 26, 2019 21 / 21

You might also like