1 / 20

CSCI 2670 Introduction to Theory of Computing

CSCI 2670 Introduction to Theory of Computing. October 13, 2005. Agenda. Yesterday Decidability and regular languages Today Putting things in perspective More on decidability and regular languages Decidability and context free grammars. Course goals.

eliza
Télécharger la présentation

CSCI 2670 Introduction to Theory of Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI 2670Introduction to Theory of Computing October 13, 2005

  2. Agenda • Yesterday • Decidability and regular languages • Today • Putting things in perspective • More on decidability and regular languages • Decidability and context free grammars October 13, 2005

  3. Course goals • Theoretically explore the capabilities and limitations of computers • Complexity theory • What makes some problems computationally hard and others easy? • Computability theory • What problems can be solved by a computer? • Automata theory • How can we mathematically model computation? October 13, 2005

  4. Some perspective • Automata theory • Introduced DFA’s, NFA’s, RE’s • Showed that they all accept the same class of languages • Introduced CFG’s, PDA’s • PDA is essentially an NFA with a stack • PDA’s and CFG’s accept the same class of languages October 13, 2005

  5. Perspective (cont.) • Computability Theory • Introduced TM’s • Like PDA’s with more general memory model • Importance of TM’s • Church-Turing Thesis • Any algorithm can be implemented on a TM • Use the TM model and Church-Turing Thesis to understand and classify languages • Decidable languages • Undecidable languages • Recognizable languages • Unrecognizable languages • Complements of languages in these classes October 13, 2005

  6. Perspective (cont.) • Complexity theory (later this semester) • Use TM model to determine how long an algorithm takes to run • Function of input length • Classify algorithms according to their complexity October 13, 2005

  7. Decidable languages • A language is decidable if some Turing machine decides it • Every string in * is either accepted or rejected October 13, 2005

  8. Some decidable languages • ADFA = {<B,w> | B is a DFA that accepts input string w} • ANFA = {<B,w> | B is an NFA that accepts input string w} • AREX = {<R,w> | R is a regular expression that generates string w} • EDFA = {<A> | A is a DFA and L(A) = } • EQDFA = {<A,B> | A and B are DFA’s and L(A) = L(B)} October 13, 2005

  9. Question • How would we show that the following language is decidable? ALLDFA = {<A> | A is a DFA that recognizes *} October 13, 2005

  10. Another question • Let L be any regular language • How would we show L is decidable? • Assume L is described using a DFA October 13, 2005

  11. Deciders and CFG’s • Consider the following language ACFG = {<G,w> | 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 October 13, 2005

  12. 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 → ε • is the only εrule, where S is the start variable October 13, 2005

  13. How many steps to generate w? • If |w| = 0 • 1 step • If |w| = n > 0? • 2n – 1 steps October 13, 2005

  14. TM simulating ACFG M = “On input <G>, where G is a CFG • Convert G into Chomsky normal form • If |w| = 0 • If there is an S → εrule, accept • Otherwise, reject • List all derivations with 2|w|-1 steps • If any generate w, accept • Otherwise, reject” October 13, 2005

  15. Empty CFG’s • Consider the following language ECFG = {<G> | 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 Σ* • Instead, we need to check if there is any way to get from the start variable to some string of terminals October 13, 2005

  16. Work backwards B = “On input <G>, where G is a CFG • Mark all terminals • Repeat until no new variables are marked • Mark any variable A if G has a rule A→U1U2…Uk where U1, U2, …, Uk are all marked • If S is marked, reject • Otherwise, accept” October 13, 2005

  17. What about EQCFG? • Recall for EQDFA, we considered (L(A)  L(B))  (L(A)  L(B)) • Will this work for CFG’s? • No. CFG’s are not closed under complementation or intersection • EQCFG is not a decidable language! • We will see this later October 13, 2005

  18. Decidability of CFL’s 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 don’t we just make a TM that simulates a PDA? October 13, 2005

  19. Context-free Turing-recognizable Decidable Regular Relationship of classes of languages October 13, 2005

  20. Have a great weekend

More Related