Decidability - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

Decidability

Description:

The halting problem. Purpose. To investigate the power of algorithms to solve problems. ... 4.2 The Halting Problem ... input M, w , H halts and accepts if M ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 39
Provided by: jhy9
Category:

less

Transcript and Presenter's Notes

Title: Decidability


1
Decidability
  • Jianhua Yang
  • Department of Math and Computer Science
  • Bennett College

2
Goals
  • Decidable languages
  • The halting problem

3
Purpose
  • To investigate the power of algorithms to solve
    problems.
  • It is demonstrated that certain problems can be
    solved algorithmically and others that cannot.
  • To explore the limits of algorithmic solvability.

4
4.1 Decidable Languages
  • In this section, we will give some examples of
    languages that are decidable by algorithms.

5
1. Decidable problems concerning Regular Languages
  • To test
  • Whether a finite automata accepts a string
  • Whether the language of a finite automaton is
    empty
  • Whether two finite automata are equivalent.

6
Acceptance problem for DFAs
  • ADFAltB, wgt B is a DFA that accepts input
    string w
  • The problem of testing whether a DFA B accepts an
    input w is the same as the problem of testing
    whether ltB, wgt is a member of the language ADFA.

7
Theorem 4.1
  • ADFA is a decidable language.

8
Proof the basic idea
  • We need to present a TM M that decides ADFA .
  • M on input ltB, wgt, where B is a DFA and w is a
    string
  • 1) Simulate B on input w.
  • 2) If the simulation ends in an accept state,
    accept if it ends in a nonaccepting state,
    reject.

9
Theorem 4.2
  • ANFA ltB, wgt B is an NFA that accepts input
    string w
  • ANFA is a decidable language

10
Theorem 4.3
  • AREXltR, wgt R is a regular expression that
    generates string w
  • AREX is a decidable language.

11
Proof
  • The following TM P decides AREX
  • P On input ltR, wgt where R is a regular
    expression and w is a string
  • 1. Convert regular expression R to an equivalent
    DFA A by using the procedure discussed.
  • 2. Run TM M on input ltA, wgt.
  • 3. If M accepts, accept if M rejects, reject.

12
EDFA
  • EDFA ltAgt A is a DFA, and L(A)F
  • EDFA is a decidable language

13
Proof
  • A DFA accepts some strings if and only if
    reaching an accept state from the start state by
    traveling along the arrows of the DFA is
    possible.
  • T On input ltAgt where A is a DFA
  • 1. Mark the start state of A
  • 2. Repeat until no new states get marked.
  • 3. Mark any state that has a transition coming
    into it from any marked state.
  • 4. If no accept state is marked, accept
    otherwise, reject.

14
Testing whether two DFAs recognize the same
language
  • EQDFA ltA, Bgt A and B are DFAs and L(A)L(B)
  • EQDFA is a decidable language.

15
Proof
  • Construct a DFA C, which accepts only those
    strings that are accepted by either A or B but
    not by both.
  • And if A and B recognize the same language, C
    will accept nothing.
  • L(C) is empty if and only if L(A) is equal to
    L(B).

16
Proof
  • Design the following TM F,
  • F On input ltA, Bgt, where A and B are DFAs
  • 1. Construct DFA C as described.
  • 2. Run TM T on input ltCgt.
  • 3. If T accepts, accept. If T rejects, reject.

17
2. Decidable problems concerning context-free
languages
  • 1) whether a CFG generates a particular string
    and to test whether the language of a CFG is
    empty.
  • 2) emptiness testing problem.
  • 3) Every context-free language is decidable.

18
1) ACFG is a decidable language
  • ACFG ltG, wgt G is a CFG that generates string
    w

19
Chomsky theorem
  • If G were in Chomsky normal form, any derivations
    of w has 2n-1 steps, where n is the length of w.

20
Proof
  • The TM S for ACFG follows
  • SOn input ltG, wgt, where G is a CFG and w is a
    string
  • 1. Converting G to an equivalent grammar in
    Chomsky normal form.
  • 2. List all derivations with 2n-1 steps.
  • 3. If any of these derivations generate w,
    accept if not, reject.

21
2) Emptiness testing problem
  • ECFGltGgt G is a CFG and L(G) is empty.
  • ECFG is a decidable language.

22
Proof
  • R on input ltGgt, where G is CFG
  • 1. Mark all terminal symbols in G.
  • 2. Repeat until no new variables get marked
  • 3. Mark any variable A where G has a rule
    A?U1U2Uk and each symbol U1, U2, Uk has already
    marked.
  • 4. if the start symbol is not marked, accept
    otherwise, reject.

23
3) Every context-free Language is decidable
  • Proof
  • Let A be a CFL. Our objective is to show that A
    is decidable.
  • Let G be a CFG for A and design a TM MG that
    decides A.
  • MG On input w
  • 1. Run TM S on input ltG, wgt
  • 2. if this machine accepts, accept if it
    rejects, reject.

24
Relationship among the four Languages

Turing-recognizable

Decidable
Context-Free
regular
25
4.2 The Halting Problem
  • We will show that there is a specific problem
    that is algorithmically unsolvable
  • Computers are limited in a very fundamental way.

26
1. Undecidability
  • The problem of testing whether a Turing machine
    accepts a given input string.
  • ATMltM, wgt M is a TM and M accepts w
  • ATM is undecidable.

27
ATM is recognizable
  • The following Turing machine U recognizes ATM
  • UOn input ltM, wgt, where M is a TM and w is a
    string
  • 1. Simulate M on input w.
  • 2. If M ever enters its accept state, accept If
    M ever enters its reject state, reject If M
    loops on w, loop.

28
Halting problem
  • ATM is called halting problem.

29
2. The Halting Problem is undecidable
  • ATMltM, wgt M is a TM and M accepts w

30
Proof
  • We assume ATM is decidable. Then we have a
    decider H.
  • On input ltM, wgt, H halts and accepts if M accepts
    w.
  • We construct a new TM D with H as a subroutine.
    Once D has determined what M does, it does the
    opposite.

31
Proof (Cont.)
  • D On input ltMgt, where M is a TM
  • 1. Run H on input ltM, ltMgtgt.
  • 2. Output the opposite of what H outputs that
    is, if H accepts, reject and if H rejects,
    accept.

32
Proof (Cont.)
  • D(ltMgt) accept if M does not accept ltMgt
    reject if M does accept ltMgt.
  • D(ltDgt)accept if D does not accept ltDgt reject
    if D does accept ltDgt.
  • We have a contradiction.

33
3. A Co-Turing-recognizable language
  • Co-Turing-recognizable if the complement of a
    Turing-recognizable language is recognizable, it
    is called Co-Turing-recognizable.

34
Theorem
  • A language is decidable if and only if both
    Turing-recognizable and co-Turing-recognizable.

35
Proof
  • 1. if A is decidable, the complement A is also
    decidable, so they are all recognizable.
  • 2. if A and A are Turing-recognizable, we let M1
    be the recognizer for A and M2 be the recognizer
    for A. The following Turing Machine is a decider
    for A.

36
Proof (Cont.)
  • Mon input w
  • 1. Run both M1 and M2 on input w in parallel.
  • 2. if M1 accepts, accept if M2 accepts, reject.
  • M always halts, and so it is a decider.

37
Corollary
  • ATM is not Turing-recognizable.
  • How to proof? (Class work)

38
Summary
  • Recognizable languages
  • Decidable languages
  • The halting problem
Write a Comment
User Comments (0)
About PowerShow.com