auto

9
The Church-Turing Thesis There are various equivalent formulations of the Church- Turing thesis. A common one is that every effective computation can be carried out by a Turing machine. The Church-Turing thesis concerns the notion of an effective or mechanicalmethod in logic and mathematics. ‘Effective’ and its synonym ‘mechanical’ are terms of art in these disciplines: they do not carry their everyday meaning. A method, or procedure, M, for achieving some desired result is called ‘effective’ or ‘mechanical’ just in case 1. M is set out in terms of a finite number of exact instructions (each instruction being expressed by means of a finite number of symbols); 2. M will, if carried out without error, produce the desired result in a finite number of steps; 3. M can (in practice or in principle) be carried out by a human being unaided by any machinery save paper and pencil; 4. M demands no insight or ingenuity on the part of the human being carrying it out. A well-known example of an effective method is the truth table test for tautologousness. In practice, of course, this test is unworkable for formulae containing a large number of propositional variables, but in principle one could apply it successfully to any formula of the propositional calculus, given sufficient time, tenacity, paper, and pencils. Universal Turing Machine

Upload: amukhopadhyay

Post on 22-May-2017

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Auto

The Church-Turing ThesisThere are various equivalent formulations of the Church-Turing thesis. A common one is that every effective computation can be carried out by a Turing machine.

The Church-Turing thesis concerns the notion of an effective or mechanicalmethod in logic and mathematics. ‘Effective’ and its synonym ‘mechanical’ are terms of art in these disciplines: they do not carry their everyday meaning. A method, or procedure, M, for achieving some desired result is called ‘effective’ or ‘mechanical’ just in case

1. M is set out in terms of a finite number of exact instructions (each instruction being expressed by means of a finite number of symbols);

2. M will, if carried out without error, produce the desired result in a finite number of steps;

3. M can (in practice or in principle) be carried out by a human being unaided by any machinery save paper and pencil;

4. M demands no insight or ingenuity on the part of the human being carrying it out.

A well-known example of an effective method is the truth table test for tautologousness. In practice, of course, this test is unworkable for formulae containing a large number of propositional variables, but in principle one could apply it successfully to any formula of the propositional calculus, given sufficient time, tenacity, paper, and pencils.

Universal Turing Machine

A “Universal Turing Machine,” or ‘UTM,’ can emulate any other specific Turing machine, by defining states and symbols. The UTM is defined with certain capabilities.

The UTM can define the symbols that the specific Turing machine will use.

It can define the symbols that encode the states and transition rules for the specific Turing machine.

It can encode the rules for that specific Turing machine onto the input tape.

Page 2: Auto

As noted, it is easier to describe any UTM as having three tapes, although  it does not require them.

The first tape encodes the set of states for the specific Turing machine to be emulated. The second tape is an input for that specific TM. The third tape is a working memory for the current state of the emulated machine.

The UTM’s program must begin by reading the “program tape” to learn the initial state, and note this on the “status” tape. The UTM’s states follow the following processes.

1. Read the current cell in the “data tape”.2. Read the “program tape” to find the instruction for the current status

and the current data cell, and note this on the “status tape”. This instruction includes the new state.

3. If the new state is “halt”, then set the UTM itself into the “halt” state; otherwise proceed to step 4.

4. Apply the instruction from the state to the “data tape”. This might rewrite a cell, and move the “data tape” to the right or left.

5. Update the “status tape”.6. Continue at step #1 above.

Halting Problem

Some mathematical problems can be solved in a limited number of steps. Anyone who follows a procedure to multiply a pair of four-digit numbers together proceeds by multiplying pairs of digits, in particular sequences, and includes “carrying” and “adding” steps as required. Multiplication of two finite numbers can be completed in some finite number of steps.Other problems, however, can never be completed. The value of pi, or ‘π‘, is approximately 3.14159…, but the decimal digits go on forever. No mathematician, no Turing machine, nor any modern computer can complete the task.Turing machines can do multiplication problems, when the TM needs to complete the task in a finite time, and has a correct instruction set. But what if the programmer makes an error, such as repeatedly multiplying by the “ones” digit rather than moving on to the “tens?”The programmer might examine the instructions, but there is no guarantee that this would be an error-free process itself. Could a Turing machine inspect the instructions, instead?

Page 3: Auto

Criteria for Solving the Halting ProblemAlan Turing stated that the three criteria for a machine that can avoid the halting problem or a Halting Problem Machine (HPM) were:

1. The HPM must correctly report “yes, the TM being tested will halt” or “no, it will not halt”.2. The HPM must work for any given Turing machine and any appropriate input for that TM.3. The HPM itself must halt within a finite amount of time, or a finite number of steps.

So the HPM must be somewhat more capable than the UTM, which cannot recognize that it will fail to halt.

Sketch of a proof that the Halting Problem is unsolvable

This proof was devised by Alan Turing, 1936

Suppose you have a solution to the halting problem called H. H takes two inputs:

1. a program P and2. an input I for the program P.

H generates an output "halt" if H determines that P stops on input I or it outputs "loop" otherwise.

So now H can be revised to take P as both inputs (the program and its input) and H should be able to determine if P will halt on P as its input.

Let us construct a new, simple algorithm K that takes H's output as its input and does the following

1. if H outputs "loop" then K halts,2. otherwise H's output of "halt" causes K to loop forever.

That is, K will do the opposite of H's output.

function K() {if (H()=="loop"){return; } else {

Page 4: Auto

while(true); //loop forever }}

Since K is a program, let us use K as the input to K.

If H says that K halts then K itself would loop (that's how we constructed it).If H says that K loops then K will halt.

In either case H gives the wrong answer for K. Thus H cannot work in all cases.

We've shown that it is possible to construct an input that causes any solution H to fail.

CFG to PDA

Step 1: CFG → PDA

• Let’s look at an example:

– Remember the CFG for odd length

palindromes:

• S → a | b

• S → a S a | b S b– Let’s convert this to a PDA.

Example:

Page 5: Auto

– M = (Q, Σ, Γ ,δ, q0, Z0 ,F)

– Q = { q0, q1, q2 }

– Σ = { a, b }

– Γ = { a, b, S, Z0 }– F = { q2 }

State Tape i/p Stack Movesq1 ε S (q1, a)

(q1, b)

(q1, aSa)(q1, bSb)

q1 a a (q1 , ε)q1 b b (q1 , ε)

Let’s run M on abbba

– (q0, abbba, Z) (q1, abbba, SZ)

– (q1, abbba, aSaZ) // push

– (q1, bbba, SaZ) // match

– (q1, bbba, bSbaZ) // push

– (q1, bba, SbaZ) // match

– (q1, bba, bbaZ) // push

– (q1, ba, baZ) // match

– (q1, a, aZ) // match

– (q1, ε, Z) // match

Page 6: Auto

–(q2, ε, Z ) // acceptWhat is Merger graph?

Ans. Merger graph of a machine M of n states is an undirected graph defined as follows.1. Merger graph consists of n number of vertices, where n is the number of states of the machine. That is

in other words each states of the machine represent one vertex.2. There is an undirected arc between a pair of vertices (states) if the outputs do not conflict for those pair

of states.(a) The arc will be an uninterrupted arc if the next states of the two states [Vertices] do not conflict.(b) The arc will be an interrupted arc if the next states of the states [Vertices] conflict. The conflicting

next states will be placed in the interrupted portions.3. There will be no arc between the two vertices if the outputs of the pair of states conflict.

Ans. In the above machine there are six states. Therefore, number of vertices of the Merger Graph is six, namely A, B, C, D, E, and F.

Lets consider two vertices A and B. In the state table for A and B for input I1 outputs are 1 and don't care. It is treated as same output (Don't care can be either 0 or 1). Same for I2, I3, and I4 the outputs do not conflict. (If the outputs are don't care, consider it same with the other) Therefore, an undirected arc is drawn between A and B.

For input I4, A produces next state E and B produces next state C. Hence the undirected arc between A and B is an interrupted arc and EC is placed in the interrupted portion.

 Consider A and C. The outputs do not conflict for inputs I1, I2, I3, and I4. An undirected arc is drawn between A and C. The next states produced by A and C for input I1 are D and E, i.e. conflicting. For input I2 the next states are B and F – also conflicting. The arc is an interrupted arc and (BF) and (DE) is placed in the interrupted portion.

Consider A and D. For input I2, A and D produce conflicting outputs – 0 for A and 1 for B. So no arc can be drawn between A and D.

Page 7: Auto

Consider A and E. For all the inputs they produce same outputs. An undirected arc is drawn between A and E. The A and E produce next states E and A, respectively, for input I4. Hence the arc is an interrupted arc and (EA) is placed in the interrupted portion.

Consider A and F. The A and F produce conflicting outputs (0 for A, 1 for F) for input  I2. Hence no arc can be drawn between A and F.

By this process, an uninterrupted arc is drawn between B and C.An uninterrupted arc is drawn between B and D.An interrupted arc is drawn between B and E and AC is placed in the interrupted portion.An uninterrupted arc is drawn between B and F.

For input I2, C and D produce conflicting outputs. No arc can be drawn between C and D.For input I3, C and E produce conflicting outputs. No arc can be drawn between C and E.For input I3, C and F produce conflicting outputs. No arc can be drawn between C and F. 

The D and E produce same outputs and same next states for all the inputs. An uninterrupted arc is drawn between D and E.

The D and F produce same outputs for all the inputs but conflicting next states (B and C) for input I2. An interrupted arc is drawn between D and F and BC is placed in the interrupted portion.

The E and F produce same output for all the inputs but conflicting next states (A and E) for input  I3. An interrupted arc is drawn between E and F and AE is placed in the interrupted portion.

The A and B are connected by an uninterrupted, undirected arc. In the interrupted portion CE is placed. The connection between A and B will be uninterrupted if C and E are connected by uninterrupted arc. But there is no arc between C and E. So there will be no arc between A and B. CE is crossed therefore.

The A and C are connected by uninterrupted undirected arc. In the interrupted portion DE and BF are placed. The A and C will be connected by uninterrupted arc if B, F and D, E are connected.