200 likes | 210 Views
This course introduces the concepts of decidability and regular languages in the context of the theory of computing, exploring the capabilities and limitations of computers. Topics covered include automata theory, computability theory, and complexity theory.
E N D
CSCI 2670Introduction 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 October 13, 2005
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
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
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
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
Decidable languages • A language is decidable if some Turing machine decides it • Every string in * is either accepted or rejected October 13, 2005
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
Question • How would we show that the following language is decidable? ALLDFA = {<A> | A is a DFA that recognizes *} October 13, 2005
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
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
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
How many steps to generate w? • If |w| = 0 • 1 step • If |w| = n > 0? • 2n – 1 steps October 13, 2005
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
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
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
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
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
Context-free Turing-recognizable Decidable Regular Relationship of classes of languages October 13, 2005