Programme Reduction - applications Prove non-decidable properties - - PowerPoint PPT Presentation

programme reduction applications prove non decidable
SMART_READER_LITE
LIVE PREVIEW

Programme Reduction - applications Prove non-decidable properties - - PowerPoint PPT Presentation

Programme Reduction - applications Prove non-decidable properties of TMs Theorem 11.7 Acc- = {e(T) | L(T) } is not recursive Reduction technique Describe non-decidable properties of other universal Proof: Show Acc


slide-1
SLIDE 1

1 dBerLog 2007

Programme

  • Prove non-decidable properties of TMs

– Reduction technique

  • Describe non-decidable properties of other universal

formalisms

– Chomsky grammars – Java

  • Prove non-decidable properties of non-universal

formalisms

– Games – Context-free grammars

2 dBerLog 2007

Reduction - applications

  • Theorem 11.7

Acc-Λ = {e(T) | Λ ∈ L(T) } is not recursive Proof: Show Acc Acc- ≤ Λ

  • Theorem

Let TU denote the universal Turing Machine, then Uni-Acc = {e(w) | w ∈ L(TU) } is not recursive Proof: Show Acc Uni-Acc ≤

3 dBerLog 2007

Reduction - applications

  • Theorem 11.8

AccSome = {e(T) | L(T) is nonempty} is not recursive Proof: Show Acc-Λ AccSome ≤ AccEver = {e(T) | L(T)’ is empty} is not recursive Proof: Show Acc-Λ AccEver ≤ Subset = {e(T1)e(T2) | L(T1) ⊆ L(T2)} is not recursive Proof: Show Acc-Ever Subset ≤

4 dBerLog 2007

Rice’s Theorem - definition

  • Definition

A property of languages is said to be nontrivial iff it is satisfied by some but not all recursively enumerable languages

slide-2
SLIDE 2

5 dBerLog 2007

Nontrivial language properties

∀ Λ ∈ L

  • L = Ø
  • L = Σ*
  • L is finite
  • L is regular
  • All strings in L have even length

6 dBerLog 2007

Rice’s Theorem

  • Theorem 11.9

Let R be any nontrivial property of languages, then PR = {e(T) | L(T) has property R} is not recursive! Proof: Show Acc-Λ P ≤

R

7 dBerLog 2007

Reduction: Acc-Λ P ≤

R

  • Assume you had TM accepting PR

e(T) Y N L(T) sat R L(T) viol R

PR

8 dBerLog 2007

Reduction: Acc-Λ P ≤

R

  • Construct TM accepting Acc-Λ

e(T’) Y N L(T’) sat R L(T’) viol R

PR Acc-Λ

e(T)

Λ ∈ L(T) Λ ∉ L(T)

Y N Assume Ø viol R. Then TR exists s.t. L(TR) sat R Construct T’ s.t. if Λ ∉ L(T) then L(T’)=Ø else L(T’)= L(TR)

slide-3
SLIDE 3

9 dBerLog 2007

Programme

  • Prove non-decidable properties of TMs

– Reduction technique

  • Describe non-decidable properties of other universal

formalisms

– Chomsky grammars – Java

  • Prove non-decidable properties of non-universal

formalisms

– Context-free grammars

10 dBerLog 2007

Harel diagonalization

P Assume halting problem solvable in JAVA prog in FINE if prog(in)↓ LOOP if prog(in)↑

11 dBerLog 2007

Harel diagonalization

P Construct program Q FINE LOOP prog COPY prog prog Q LOOP

12 dBerLog 2007

Harel diagonalization

P Run Q with input Q FINE LOOP Q COPY Q Q Q LOOP

slide-4
SLIDE 4

13 dBerLog 2007

Busy Beaver

  • Definition

BB(n):= the maximal number of 1’s printed by a Turing machine starting with n 1s on the tape and with n states

  • Exercise

BB is not computable!

14 dBerLog 2007

Chomsky grammars

  • A Chomsky grammar is a tuple

G = (V, Σ, S, P), where V and Σ are finite disjoint sets of variables and terminals resp. S is the start variable, an element of V P is a set of productions of the form

Type 3: A → a or A → aB, where A, B ∈ V and a ∈ Σ Type 2: A → β, where A ∈ V and β ∈ (V∪ Σ )* Type 0: α → β, where α ∈ (V∪ Σ )*V (V∪ Σ )* and β ∈ (V∪ Σ )*

15 dBerLog 2007

Chomsky type 0 languages

  • Given a Chomsky type 0 grammar G = (V, Σ, S, P), define

if α → β ∈ P, then for all α’, α’’, β’, β’’ ∈ (V∪ Σ )* α’ α α’’ ⇒ β’ β β’’ L(G) = {w ∈ Σ *  S ⇒* w}

16 dBerLog 2007

Chomsky type 0 example

  • Let G = (V, Σ, S, P), where

V = {S, A, B, C} Σ = {a, b, c} P: S → FT T → ABCT T → ABC BA → AB CA → AC CB → BC FA → a aA → aa aB → ab bB → bb bC → bc cC → cc

L(G) = {aibici  i > 0}

slide-5
SLIDE 5

17 dBerLog 2007

Turing and Chomsky

  • Theorems 10.8 and 10.9

For any language L ⊆ Σ*, L is generated by a Chomsky type 0 grammar iff (constructively!!) L is accepted by a Turing machine

  • Corollary

All nontrivial properties of languages for Chomsky type 0 grammars are undecidable!

18 dBerLog 2007

Programme

  • Prove non-decidable properties of TMs

– Reduction technique

  • Describe non-decidable properties of other universal

formalisms

– Chomsky grammars – Java

  • Prove non-decidable properties of non-universal

formalisms

– Games – Context-free grammars

19 dBerLog 2007

Post’s correspondence problem - example

  • List A:

List B:

α1 = b β1 = bbb α2 = babbb β2 = ba α3 = ba β3 = a

Does there exist a sequence of indices i1, i2,..., im ∈ {1,2,3} such that αi1 αi2...... αim = βi1 βi2...... βim

20 dBerLog 2007

Post’s correspondence problem - example

  • List A:

List B:

α1 = b β1 = bbb α2 = babbb β2 = ba α3 = ba β3 = a

Solution?

slide-6
SLIDE 6

21 dBerLog 2007

Post’s correspondence problem - example

  • List A:

List B:

α1 = b β1 = bbb α2 = babbb β2 = ba α3 = ba β3 = a

Solution? YES: 2 1 1 3 α2 α1 α1 α3 = babbbbbba = β2 β1 β1 β3

22 dBerLog 2007

Post’s correspondence problem - example

  • List A:

List B:

α1 = ba β1 = bab α2 = abb β2 = bb α3 = bab β3 = abb

Solution?

23 dBerLog 2007

Post’s correspondence problem - example

  • List A:

List B:

α1 = ba β1 = bab α2 = abb β2 = bb α3 = bab β3 = abb

Solution? NO!

24 dBerLog 2007

Post’s correspondence problem - formally

  • Given two finite lists of strings over some alphabet Γ

List A: α1, α2,.., αk List B: β1, β2,...., βk

  • Does there exist a sequence of indices

i1, i2,...,im ∈ {1,2,..,k} such that αi1 αi2...... αim = βi1 βi2...... βim ?

slide-7
SLIDE 7

25 dBerLog 2007

Modified Post’s correspondence problem

  • Given two finite lists of strings over some alphabet Γ

List A: α1, α2,.., αk List B: β1, β2,...., βk

  • Does there exist a sequence of indices

i2, i3,...,im ∈ {1,2,..,k} such that α1 αi2...... αim = β1 βi2...... βim ?

26 dBerLog 2007

Post’s correspondence problem

  • Theorem

Post’s correspondence problem is undecidable!

27 dBerLog 2007

Post’s correspondence problem - reductions

Reduction I Reduction II Acc MPCP PCP

28 dBerLog 2007

Modified Post’s correspondence problem

  • Theorem 11.11

Modified Post’s correspondence problem is undecidable!

slide-8
SLIDE 8

29 dBerLog 2007

Reduction I

  • Given Turing machine T and input w,

construct algoritmically MPCPT,w such that T accepts w iff MPCPT,w has a solution

30 dBerLog 2007

A Turing Machine

p r q 0/X,R 1/Y, L p010 |- Xq10 |- rXY0........ # p010 # Xq10 # rXY0 #........

31 dBerLog 2007

Reduction I

  • Given T = (Q, Σ, Π, δ, q0,) and w ∈ Σ*

(assume w.l.g. that T has no Stay-moves!)

  • Alphabet of MPCPT,w

Γ := (Q ∪ {ha, hr}) ∪ (Π ∪ {∆}) ∪ {#}

32 dBerLog 2007

Reduction I - lists of MPCPT,w

  • List A:

List B:

α1 = # β1 = #q0∆w#

slide-9
SLIDE 9

33 dBerLog 2007

Reduction I - lists of MPCPT,w

  • List A:

List B:

α1 = # β1 = #q0∆w# αd = X βd = X for all X ∈ Γ αq,X = qX βq,X = Yp if δ(q,X) = (p, Y, R) αq,X = ZqX βq,X = pZY if δ(q,X) = (p, Y, L) αq,B = q# βq,B = Yp# if δ(q, ∆) = (p, Y, R) αq,B = Zq# βq,B = pZY#if δ(q, ∆) = (p, Y, L)

34 dBerLog 2007

Reduction I - lists of MPCPT,w

  • List A:

List B:

α1 = # β1 = #q0∆w# αd = X βd = X for all X ∈ Γ αq,X = qX βq,X = Yp if δ(q,X) = (p, Y, R) αq,X = ZqX βq,X = pZY if δ(q,X) = (p, Y, L) αq,B = q# βq,B = Yp# if δ(q, ∆) = (p, Y, R) αq,B = Zq# βq,B = pZY#if δ(q, ∆) = (p, Y, L) αa1 = XhaY βa1 = ha for all X,Y ∈ Γ αa2 = Xha βa2 = ha for all X,Y ∈ Γ αa3 = haY βa3 = ha for all X,Y ∈ Γ

35 dBerLog 2007

Reduction I - lists of MPCPT,w

  • List A:

List B:

α1 = # β1 = #q0∆w# αd = X βd = X for all X ∈ Γ αq,X = qX βq,X = Yp if δ(q,X) = (p, Y, R) αq,X = ZqX βq,X = pZY if δ(q,X) = (p, Y, L) αq,B = q# βq,B = Yp# if δ(q, ∆) = (p, Y, R) αq,B = Zq# βq,B = pZY#if δ(q, ∆) = (p, Y, L) αa1 = XhaY βa1 = ha for all X,Y ∈ Γ αa2 = Xha βa2 = ha for all X,Y ∈ Γ αa3 = haY βa3 = ha for all X,Y ∈ Γ αs = ha## βs = #

36 dBerLog 2007

Reduction II

  • Given MPCP over alphabet Γ
  • Construct PCP over alphabet Γ’ such that

MPCP has solution iff PCP has solution

slide-10
SLIDE 10

37 dBerLog 2007

Definitions

ir, il: Γ * → (Γ ∪ {#})* ir(ε) = ε ir(ax) = a# • ir(x) a∈ Γ, x ∈ Γ* il(ε) = ε il(ax) = #a • il(x) a∈ Γ, x ∈ Γ* Examples: ir(bob) = b#o#b# il(bob) = #b#o#b

38 dBerLog 2007

Reduction II

  • Given MPCP with k lists over alphabet Γ

A : α1, α2,.... αk B : β1, β2,..... βk

  • Construct PCP with k+2 lists over Γ ∪ {#, $}

A’: B’: α’0 = #ir(α1) β’0 = il(β1) α’i = ir(α1) β’i = il(βi) for i = 1,2,..k α’k+1 = $ β’k+1 = #$

39 dBerLog 2007

Context-free Grammar for expressions

  • G = ({E, I}, {1,2,+,∗,(,)}, P, S)

P: E → I | E + E | E ∗ E | (E) I → 1 | 2

40 dBerLog 2007

Ambiguity - example

E E E E E E E E E E I I I I I I + ∗ ∗ + 2 1 2 2 1 2

slide-11
SLIDE 11

41 dBerLog 2007

Ambiguity - definition

  • A grammar G is said to be ambiguous iff

some string in L(G) has two different derivation trees

42 dBerLog 2007

Unambiguous grammar for expressions

E → T | E + T T → F | T ∗ F F → I | (E) I → 1 | 2 | I1 | I2 E ⇒G E+T ⇒G T+T ⇒G T ∗ F+T ⇒G F∗F+T ⇒G I∗F+T ⇒G 2∗F+T ⇒G 2∗I+T ⇒G 2∗1+T ⇒G 2∗1+F ⇒G 2∗1+I ⇒G 2∗1+2

43 dBerLog 2007

Inherently ambiguous context-free language

  • L = {anbncmdm | n,m 1}

≥ ∪ {anbmcmdn | n,m 1} ≥

  • (Ambiguous) grammar for L:

S → AB | C A → aAb | ab B → cBd | cd C → aCd | aDb D → bCd | bc

44 dBerLog 2007

Ambiguity problem for CFG’s

  • Given a context free grammar G = (V, Σ, P, S)

Is G ambiguous?

  • Theorem 11.13

Ambiguity problem for CFG’s is undecidable!

slide-12
SLIDE 12

45 dBerLog 2007

Ambiguity problem for CFG’s - reduction

Reduction PCP GPCP Construct context-free grammar GPCP such that PCP has solution iff GPCP is ambiguous

46 dBerLog 2007

Reduction

  • Given PCP with lists A,B of k strings over alphabet Γ
  • Construct GPCP = ({S, A, B}, ∆ ∪ {1,2,..k}, P, S), where

S → AB A → α1A1  α2A2..  αkAk  α11  α22 ..  αkk B → β1B1  β2B2 ..  βkBk  β11  β22 .. βkk

47 dBerLog 2007

Undecidable problems for CFG’s

  • Given two context-free grammars G1, G2 over alphabet Σ
  • Is L(G1) ∩ L(G2) = Ø? (Theorem 11.12)
  • Is L(G1) = Σ* (Theorem 11.15 - without proof!)
  • Is L(G1) = L(G2) ? (Exercise - use 11.15!)
  • Is L(G1) regular?

48 dBerLog 2007

Programme

  • Prove non-decidable properties of TMs

– Reduction technique

  • Describe non-decidable properties of other universal

formalisms

– Chomsky grammars – Java

  • Prove non-decidable properties of non-universal

formalisms

– Games – Context-free grammars

slide-13
SLIDE 13

49 dBerLog 2007

Exercises

  • Describe (un)decidability

– 11.3 Reduction theorem for RE – 11.5 Fermat’s last theorem – 11.15 A non-trivial problem solvable for TMs – 11.18 Example of PCP

  • Explain algorithmic approaches to computability

– 11.9 A TM reduction – 11.13 Unsolvable problems for C-programs – 11.19 PCP unsolvable for binary alphabets – 11.20 PCP solvable for unary alphabets – 11.21 Unsolvable problems for CFG (hint: use Thm 11.15) – Show that the Busy Beaver (slide 13) function is non-computable