Download presentation
Presentation is loading. Please wait.
1
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006
2
CS 310 – Fall 2006 Pacific University Decidability “the power of algorithms to solve problems.” p 165 What are the limits of algorithmic solvability? How can we tell if two Regular Expressions define the same language? –or, can we? A language is decidable if some TM decides it (always either accepts or rejects, always halts)
3
CS 310 – Fall 2006 Pacific University Decidability Acceptance Problem (DFA): Does a given DFA, B, accept a given string w? In terms of languages (because we have defined computation as accept/reject a language): –A DFA = { | B is a DFA that accepts w } –For ALL input pairs can a single TM be constructed that will decide A DFA can we build one TM that will work for all DFAs? is there an algorithmic way to solve this problem?
4
CS 310 – Fall 2006 Pacific University Theorem A DFA is decidable –given we can decide if A DFA or A DFA Proof Idea: –Use a TM, M, to simulate B with input w –Keep track of current state and current position on the input string –Update according to the DFA’s
5
CS 310 – Fall 2006 Pacific University Also… A NFA and A Regular Expression are also decidable –why?
6
CS 310 – Fall 2006 Pacific University Emptiness testing Does a finite automata accept any strings at all? –E DFA = { | A is a DFA and L(A) = } Theorem: E DFA is decidable Proof Idea: –is it possible to reach an accept state from q 0 ? –mark the start state of A –repeat until no new states get marked: Mark any unmarked state that has an incoming transition from a marked state –if no accept state is marked, accept; else reject
7
CS 310 – Fall 2006 Pacific University Equivalence testing Do two DFAs recognize the same language? –EQ DFA = { | A and B are DFAs and L(A) = L(B)} Theorem: EQ DFA is decidable –Proof: construct new DFA, C, that accepts only strings accepted by either A or B but not both (XOR) L(C)=(L(A) L’(B)) U (L’(A) L(B) ) –complement and are closed over regular languages L(C)= if and only if L(A) = L(B)
8
CS 310 – Fall 2006 Pacific University Question Can we tell if two Regular Expressions define the same language? –why or why not?
9
CS 310 – Fall 2006 Pacific University CFGs A CFG = { | G is a CFG that generates w} A CFG is decidable Could enumerate all strings produced by G: could be infinite, though Proof Idea –Put G in CNF –How deep is the parse tree for string w? –Check only derivations of this length possibly large, but definitely finite
10
CS 310 – Fall 2006 Pacific University Equivalence of CFGs EQ CFG = { | G and H are CFL and L(G) = L(H)} –not decidable –CFGs are not closed under complement or –see chapter 5 for more information
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.