CSCI 2670 Introduction to Theory of Computing - PowerPoint PPT Presentation

About This Presentation
Title:

CSCI 2670 Introduction to Theory of Computing

Description:

CSCI 2670 Introduction to Theory of Computing October 19, 2004 Agenda Last week Variants of Turing machines Definition of algorithm This week Chapter 4 Decidable and ... – PowerPoint PPT presentation

Number of Views:182
Avg rating:3.0/5.0
Slides: 19
Provided by: Wimva2
Learn more at: http://cobweb.cs.uga.edu
Category:

less

Transcript and Presenter's Notes

Title: CSCI 2670 Introduction to Theory of Computing


1
CSCI 2670Introduction to Theory of Computing
October 19, 2004
2
Agenda
  • Last week
  • Variants of Turing machines
  • Definition of algorithm
  • This week
  • Chapter 4
  • Decidable and undecidable languages
  • The halting problem

3
Announcements
  • Homework due next Tuesday (10/26)
  • 4.2, 4.5, 4.7, 4.11, 4.14, 4.20

4
Decidable languages
  • A language is decidable if some Turing machine
    decides it
  • Every string in ? is either accepted or rejected
  • Not all languages can be decided by a Turing
    machine

5
Some decidable languages
  • ADFA ltB,wgt B is a DFA that accepts input
    string w
  • ANFA ltB,wgt B is an NFA that accepts input
    string w
  • AREX ltR,wgt R is a regular expression that
    generates string w
  • EDFA ltAgt A is a DFA and L(A) ?

6
One more decidable regular language
  • EQDFA ltA,Bgt A and B are DFAs and L(A)
    L(B)
  • Theorem EQDFA is a decidable language
  • Proof Consider the following language
  • (L(A) ? L(B)) ? (L(A) ? L(B))

7
One more decidable regular language
  • (L(A) ? L(B)) ? (L(A) ? L(B))

8
One more decidable regular language
  • EQDFA ltA,Bgt A and B are DFAs and L(A)
    L(B)
  • Theorem EQDFA is a decidable language
  • Proof Consider DFA C that accepts L(C) (L(A)
    ? L(B)) ? (L(A) ? L(B))
  • How do we know such a DFA exists?
  • If L(C) ?, then L(A) L(B)

9
Question
  • How would we show that the following language is
    decidable?
  • ALLDFA ltAgt A is a DFA that recognizes ?

10
Deciders and CFGs
  • Consider the following language
  • ACFG ltG,wgt G is a CFG that generates string
    w
  • Is ACFG decidable?
  • Problem How can we get a TM to simulate a CFG?
  • Must be certain CFG tries a finite number of
    steps!
  • Solution Use Chomsky normal form

11
Chomsky normal form review
  • All rules are of the form
  • A ?BC
  • A ?a
  • Where A, B, and C are any variables (B and C
    cannot be the start variable)
  • S ? e
  • is the only erule, where S is the start variable

12
How many steps to generate w?
  • If w 0
  • 1 step
  • If w n gt 0?
  • 2n 1 steps

13
TM simulating ACFG
  • Convert G into Chomsky normal form
  • If w 0
  • If there is an S ? erule, accept
  • Otherwise, reject
  • List all derivations with 2w-1 steps
  • If any generate w, accept
  • Otherwise, reject

14
Empty CFGs
  • Consider the following language
  • ECFG ltGgt G is a CFG and L(G) ?
  • Theorem ECFG is decidable
  • Can we use the TM in ACFG to prove this?
  • No. There are infinitely many possible strings
    in S
  • Instead, we need to check if there is any way to
    get from the start variable to some string of
    terminals

15
Work backwards
  • Mark all terminals
  • Repeat until no new variables are marked
  • Mark any variable A if G has a rule A?U1U2Uk
    where U1, U2, , Uk are all marked
  • If S is marked, reject
  • Otherwise, accept

16
What about EQCFG?
  • Recall for EQDFA, we considered
  • (L(A) ? L(B)) ? (L(A) ? L(B))
  • Will this work for CFGs?
  • No. CFGs are not closed under complementation or
    intersection
  • ECFG is not a decidable language!

17
Decidability of CFLs
  • Theorem Every context-free language L is
    decidable
  • Proof For each w, we need to decide whether or
    not w is in L. Let G be a CFG for L. This
    problem boils down to ACFG, which we showed is
    decidable.
  • Question Why dont we just make a TM that
    simulates a PDA?

18
Relationship of classes of languages
Write a Comment
User Comments (0)
About PowerShow.com