CSE 105 THEORY OF COMPUTATION Fall 2016 - - PowerPoint PPT Presentation

cse 105
SMART_READER_LITE
LIVE PREVIEW

CSE 105 THEORY OF COMPUTATION Fall 2016 - - PowerPoint PPT Presentation

CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ T odays lecture Examples of undecidable languages Examples of decidable languages Reductions Reading: Chapter 5 Previously Diag


slide-1
SLIDE 1

CSE 105

THEORY OF COMPUTATION

Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/

slide-2
SLIDE 2

T

  • day’s lecture
  • Examples of undecidable languages
  • Examples of decidable languages
  • Reductions
  • Reading: Chapter 5
slide-3
SLIDE 3

Previously …

  • Diag = {<M> | M is a TM s.t. <M> is not in L(M) }

Undecidable (in fact, not even RE)

  • DD = {<M,<M>> | M is a TM s.t. <M> is not in L(M) }

Just like Diag: Undecidavle (in fact, not even RE)

Proof: Assume DD is decidable. It follows that Diag is decidable. Contradiction!

  • ATM = { <M,w> | M is a TM such that M(w) accepts }

ATM is RE, but not Decidable. Therefore, also not coRE.

Proof: Assume ATM is decidable. It follows that MM is decidable. Contradiction!

slide-4
SLIDE 4

ATM is undecidable (Proof details)

  • Assume for contradiction ATM is decidable
  • MM = {<M,<M>> | M is a TM} is decidable
  • MM - ATM is decidable because the class of decidable

languages is closed under set difgerence.

  • Notice: MM – ATM

= { <M,<M>> | M is a TM} - {<M,w> | w ∈ L(M) } = { <M,<M>> | M is a TM and <M> ∉ L(M) } = DD

  • So, DD is decidable. Contradiction!
slide-5
SLIDE 5

Some example languages

  • Acceptance problem:

ADFA = { <M,w> | M is a DFA and M(w) accepts }

ATM = { <M,w> | M is a TM and M(w) accepts }

  • Emptyness problem:

EDFA = {<M> | M is a DFA and L(M) is the empty set }

ETM = {<M> | M is a TM and L(M) is the empty set }

  • Equivalence problem:

EQDFA = { <M,M’> | M and M’ are DFAs and L(M) = L(M’) }

slide-6
SLIDE 6

Some example languages

  • Acceptance problem:

ADFA = { <M,w> | M is a DFA and M(w) accepts } DECIDABLE

ATM = { <M,w> | M is a TM and M(w) accepts } UNDECIDABLE

  • Emptyness problem:

EDFA = {<M> | M is a DFA and L(M) is the empty set } DECIDABLE

ETM = {<M> | M is a TM and L(M) is the empty set } UNDECIDABLE

  • Equivalence problem:

EQDFA = { <M,M’> | M and M’ are DFAs and L(M) = L(M’) } DECIDABLE

slide-7
SLIDE 7

EDFA is decidable

  • PEDFA(w) =
  • 1. Parse input w as <Q,Σ,δ,s,F>. If parse fails, then reject.
  • 2. Let X = {s}
  • 3. For all q in X and a in Σ

a) Let q’ = δ(q,a) b) If q’ is not in X, then X ← X U {q’} and restart the loop at 3)

  • 4. If X intersects F, then accept, else reject.
slide-8
SLIDE 8

EDFA is decidable

  • PEDFA(w) =
  • 1. Parse input w as <Q,Σ,δ,s,F>. If parse fails, then reject.
  • 2. Let X = {s}
  • 3. For all q in X and a in Σ

a) Let q’ = δ(q,a) b) If q’ is not in X, then X ← X U {q’} and restart the loop at 3)

  • 4. If X intersects F, then accept, else reject.

EDFA

slide-9
SLIDE 9

EDFA is decidable

  • PEDFA(w) =
  • 1. Parse input w as <Q,Σ,δ,s,F>. If parse fails, then reject.
  • 2. Let X = {s}
  • 3. For all q in X and a in Σ

a) Let q’ = δ(q,a) b) If q’ is not in X, then X ← X U {q’} and restart the loop at 3)

  • 4. If X intersects F, then accept, else reject.

What is the language of PEDFA? A) {<P,w> | P is a DFA and P(w) accepts} B) {<P> | P is a DFA} C) {<P> | P is a DFA and L(P) = Ø } D) {<P> | P is a DFA and L(P) = {ε} } E) None of the above

slide-10
SLIDE 10

EDFA is decidable

  • PEDFA(w) =
  • 1. Parse input w as <Q,Σ,δ,s,F>. If parse fails, then reject.
  • 2. Let X = {s}
  • 3. For all q in X and a in Σ

a) Let q’ = δ(q,a) b) If q’ is not in X, then X ← X U {q’} and restart the loop at 3)

  • 4. If X intersects F, then reject

reject, else accept accept

slide-11
SLIDE 11

EQDFA is decidable

  • PEQDFA(<M,M’>)

1) Check if both M and M’ are DFA. If not, then reject. 2) Use closure properties of regular languages to build a DFA M’’ for L(M’’) = (L(M) – L(M’)) U (L(M’) - L(M))

Run PEDFA(<M’’>). If PEDFA accepts, then accept, else reject.

  • Notice L(M)=L(M’) if and only if L(M’’) is empty.
slide-12
SLIDE 12

Summary

  • DD is decidable → Diag is decidable

Since Diag is undecidable, then DD is also undecidable

  • ATM is decidable → DD is decidable

Since DD is undecidable, then ATM is undecidable

  • EDFA is decidable → EQDFA is decidable

Since EDFA is decidable, then EQDFA is decidable

slide-13
SLIDE 13

Proving implications

  • Claim: If A is decidable, then B is decidable
  • Proof:

Assume A is decidable

Show that B is also decidable

  • Proof methods:

Using closure properties of decidable languages: transform A into B

Let M be a decider for A. Use M to build a decider for B

  • Notice: We do not need to know if A is decidable
slide-14
SLIDE 14

Reductions

  • “If A is decidable then B is decidable”

Can be proved using closure properties, or assuming a decider for A

Makes sense even when A or B are undecidable

  • When decidability of B is unknown

This reduces the problem of solving B to the (possibly easier) problem of solving A

  • Proof is called a “reduction” from B to A

Oftern written B < A

slide-15
SLIDE 15

Reductions

  • “If A is decidable then B is decidable”

Can be proved using closure properties, or assuming a decider for A

Makes sense even when A or B are undecidable

  • When decidability of B is unknown

This reduces the problem of solving B to the (possibly easier) problem of solving A

  • Proof is called a “reduction” from B to A

Oftern written B B < < A A Assume B<A B<A and A is decidable. What can you conclude? A) B is also decidable B) B is a subset of A C) B is undecidable D) B may be decidable or undecidable E) I don’t know

slide-16
SLIDE 16

Reductions

  • “If A is decidable then B is decidable”

Can be proved using closure properties, or assuming a decider for A

Makes sense even when A or B are undecidable

  • When decidability of B is unknown

This reduces the problem of solving B to the (possibly easier) problem of solving A

  • Proof is called a “reduction” from B to A

Oftern written B B < < A A Assume A<B A<B and A is decidable. What can you conclude? A) B is also decidable B) B is a subset of A C) B is undecidable D) B may be decidable or undecidable E) I don’t know

slide-17
SLIDE 17

Reductions

  • “If A is decidable then B is decidable”

Can be proved using closure properties, or assuming a decider for A

Makes sense even when A or B are undecidable

  • When decidability of B is unknown

This reduces the problem of solving B to the (possibly easier) problem of solving A

  • Proof is called a “reduction” from B to A

Oftern written B B < < A A Assume A<B A<B and A is undecidable. What can you conclude? A) B is also decidable B) B is a subset of A C) B is undecidable D) B may be decidable or undecidable E) I don’t know

slide-18
SLIDE 18

Reductions

  • “If A is decidable then B is decidable”

Can be proved using closure properties, or assuming a decider for A

Makes sense even when A or B are undecidable

  • When decidability of B is unknown

This reduces the problem of solving B to the (possibly easier) problem of solving A

  • Proof is called a “reduction” from B to A

Oftern written B B < < A A Assume B<A B<A and A is undecidable. What can you conclude? A) B is also decidable B) B is a subset of A C) B is undecidable D) B may be decidable or undecidable E) I don’t know

slide-19
SLIDE 19

Some problems on CFG

  • EQCFG = {<G1,G2> | G1,G2 CFG s.t. L(G1) = L(G2) }
  • SUBCFG = {<G1,G2> | G1,G2 CFG s.t. L(G1) ⊆ L(G2) }
  • SUPCFG = {<G1,G2> | G1,G2 CFG s.t. L(G1) ⊇ L(G2) }
  • Can you give reductions between any two of these

problems? In what direction?

EQCFG < SUBCFG ?

SUBCFG < SUPCFG ?

SUPCFG < EQCFG ?

slide-20
SLIDE 20

Next Time

  • We have class on Wednesday
  • Thursday and Friday: Thanksgiving!
  • Haskell 4 due tonight
  • HW7 due T

ue Nov 29

  • Last week of classes after Thanksgiving