unsolpda

Embed Size (px)

Citation preview

  • 8/13/2019 unsolpda

    1/5

    Unsolvable Problems f or Pushdow n Aut omat a

    Soon after introducing pushdown automata we proved that their membershipproblem was solvable. Well, this was not quite true since we did it only fordeterministic machines. But, it should not be too diff icult to extend this resultto the nondeterministic variety. Soon we shall when we examine formallanguages. Also at that time we shall show that the emptiness and finitenessproblems for pushdown automata are solvable too. Unfortunately most of theother decision problems for these machines are unsolvable. So, it would appearthat stacks produce some unsolvability.

    As usual we shall use reducibility. We shall map some undecidable Turing

    machine (or actually r.e. set) problems into pushdown automata problems. Todo these reductions we need to demonstrate that pushdown automata cananalyze Turing machine computations. Recall from before that a Tur i ngm achine conf igur at ion is a string that describes exactly what the machine isdoing at the moment. It includes:

    a) what is written on the tape,b) which symbol the machine is reading, andc) the instruction the Turing machine is about to execute.

    If we dispense with endmarkers and restrict ourselves to the two symbol

    alphabet {0, 1, b}then a configuration is a string of the form x(Ik)y or x where xand y are strings over the alphabet {0, 1, b}. (We interpret the configurationx(Ik)y to mean that the string xy is on the tape, the machine is about to executeinstruction Ik, and is reading the first symbol of the string y. A configuration ofthe form x with no instruction in it means that the machine has halted with xon its tape.) Let us prove some things as we develop the ability of pushdownmachines to examine Turing machine computations.

    Lem m a . The set of str ings that ar e val id Tu r ing m achine conf ig ur at ions isa r egular set.

    Proof . This is simple because a Turing machine configuration is of the

    form [0+1+b]*or of the form [0+1+b]*(I1[0+1]*)[0+1+b]*. (Note that weused square brackets in our expressions because the parentheses werepresent in the Turing machine configurations.)

    Since these are regular expressions and represent a regular set.

  • 8/13/2019 unsolpda

    2/5

    Unsolvable Problems for PDA 2

    A computat ionis merely a sequence of configurations (Ci) separated by markers.

    It can be represented by a string of the form:

    C1#C2# ... #Cn

    Since the regular sets are closed under concatenation and Kleene star thesekinds of strings form a regular set also.

    Now let us examine just what makes a sequence of valid Turing machineconfigurations not a val id hal t ing compu tat ionfor a particular machine. Either:

    1) C1is not an initial configuration,

    2) Cnis not a halting configuration,

    3) one of the Cicontains an improper instruction, or

    4) for some i < n, some Cidoes not yield Ci+1.

    Parts (1) and (2) are easy to recognize. An initial configuration is merely a string

    of the form (I1)[0+1+b]* and a halting configuration is a string of the form

    [0+1+b]*. These are both regular sets. Part (3) is regular also because Turingmachine instructions are required to be members of a sequence beginning at I1and there can be only a finite number of them for a particular Turing machine.Thus this is regular also because a finite automata can recognize finite sets.

    Let us now put this in the form of a lemma that we shall use later when we wishto build a pushdown machine which check Turing machine computations.

    Lem m a . For each Tur in g machine there ar e f in i te autom ata that ar e able

    to detect:

    a) ini t ia l conf ig ur at ions,

    b) ha l t ing conf igu r at ions, an d

    c) conf igur at ions wit h im pr oper in str uct ions.

    The final situation that leads to a string not being a valid Turing machinecomputation is part (4) of our previous list. This when a configuration does notyield the next in the sequence. We shall show now that a nondeterministicpushdown machine can detect this.

    Lem m a . For each T ur ing m achine, there is a pu shdown autom aton th ataccepts pair s of conf igur at ions (for tha t Tu r in g m achine) such th at th e

    fir st d oes not yield th e second .

    Proof . Let C1 and C2 be valid configurations for a particular Turing

    machine. We shall build a pushdown automaton which accepts the inputC1#C2 whenever it is not the case that C1 C2. The automaton will

  • 8/13/2019 unsolpda

    3/5

    Unsolvable Problems for PDA 3

    operate in a nondeterministic manner by first selecting the reason that C1does not yield C2, and then verifying that this happened. Let us analyze

    the reasons why C1might not yield C2.

    a) No conf igur at ion can fo l low C1. There are three possible reasons for

    this, namely:

    1) C1is a halting configuration.

    2) The instruction in C1is not defined for the symbol read.

    3) C1= (Ik)x and the Turing machine wishes to move left.

    Since these three conditions are finite, a finite automaton could detectthem, and so can our pushdown machine.

    b) The instr uct ion in C2is in corr ect. In other words it does not follow

    from the situation in C1. This can also be detected by a finite

    automaton.

    c) Th e tape sym bols in C2are wrong. Suppose that

    C1 = a ( I ) cx k y

    and instruction Ik calls for the Turing machine to write the symbol dand transfer to instruction Im if it reads the symbol c. Then it shouldbe the case that

    C2 = a( I ) dx m y

    if the Turing machine moved left, and

    C 2 = a ( I )dx m y

    if the Turing machine moved a square to the right. Suppose thatinstead of things being as they should, we end up with the followingconfiguration:

    C2 = ( I )u m v

  • 8/13/2019 unsolpda

    4/5

    Unsolvable Problems for PDA 4

    The errors that could take place have been tabulated in the followingtable.

    l ef t m ov e er r or : u x or v ad y

    r ight move error : u xad or v y

    The pushdown machine first nondeterministicly selects which of the fourerrors has taken place and then verifies it. Here is how this works. Ourpushdown automaton first scans xacy (the tape in C1) and uses its stack

    as a counter to select the position of where the error will be in C2. It then

    remembers (in its finite control) exactly what symbol should be in thatlocation on C2. Now it counts off squares of C2until it reaches the site of

    the error and verifies that the wrong symbol is in that location.

    To recap, our pushdown automaton f irst selects the error that makes C1not yield C2and then verifies that it did indeed take place.

    Now we possess all of the tools necessary to show that pushdown machines cananalyze strings and detect whether or not they are Turing machinecomputations. This is done by enumerating what could be making the stringnot a proper computation, and then verifying that something of this sort tookplace.

    Theorem 1 . For ever y Tur ing m achine, th er e is a pushdown aut oma tontha t accepts al l str ings that ar e not val id h al t in g compu tat ion s for the

    Tur ing mach ine.

    Proof Sketch. The pushdown machine in question merely selects(nondeterministicly) the reason that its input cannot be a valid haltingcomputation for the Turing machine. Then it verifies that this error tookplace. The preceding lemmas provide the list of errors and the methodsneeded to detect them.

    This theorem is very interesting in its on right. as well as being a nice exampleof nondeterministic computation. In fact, the gu ess an d veri f ystrategy cannot

    be carried out on a deterministic device unless the choices remain constant nomatter how long the input gets.

    It also indicates that pushdown automata can in some sense analyze thecomputations of Turing machines. (By the way, npda cannotdetect val idhaltingcomputations for Turing machines. This should become clear after observinglinear bounded automata that is a more powerful device that is able torecognize valid computations.) The major use of this theorem, however, is to

  • 8/13/2019 unsolpda

    5/5

    Unsolvable Problems for PDA 5

    prove that several decision problems involving pushdown machines areunsolvable. This will be done by reducing unsolvable problems for the r.e. setsto problems for pushdown automata.

    Theorem 2 . Whether or n ot a pu shdow n a utom aton a ccepts every str ing

    over its alph abet is un solvable.

    Proof . We shall reduce the emptiness problem for Turing machines (is Wi

    = ?) to this problem (known as the * problem since is the inputalphabet) for pushdown machines.

    Let Mibe a Turing machine and let Pg(i)be the pushdown automaton that

    accepts the set of strings that are not valid halting computations forTuring machine Mi. Then note that:

    Wi= iff x[Mi(x) never halts]iff ax[Mi(x) has no halting computations]

    iff Pg(i)accepts every input

    That was the reduction from the emptiness problem for Turing machines

    to the * problem for pushdown machines. Recalling our results onreducibilities indicates that both must be unsolvable. (Also they are notr.e.)

    Acceptance of strings that are not valid halting computations of Turing

    machines leads to several other unsolvability results concerning pushdownautomata. Two which appear in the exercises are the equivalence problem(whether two machines accept the same set) and the cofi ni t eness pr oblem(whether the complement of the set accepted by a pushdown machine is finite).They are proven in the same manner.