Upcoming SlideShare
×

TuringSlashPython - Undergraduate Final Year Project

472 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
472
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
5
0
Likes
0
Embeds 0
No embeds

No notes for slide

TuringSlashPython - Undergraduate Final Year Project

1. 1. TuringSlashPython A Turing Machine simulator for academic uses Alexandros James Psarras Final Year Project The University of Leeds May 2010
2. 2. Turing Machines <ul><li>A Turing Machine (TM) is a theoretical computing machine, first described by Alan Turing [1]. </li></ul><ul><li>A Turing Machine has three parts: </li></ul><ul><ul><ul><ul><li>1. An infinite tape . </li></ul></ul></ul></ul><ul><ul><ul><ul><li>2. A head that scans the tape. The head has a property known as a “ state ”, that determines the action the head will take. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>3. A set of instructions </li></ul></ul></ul></ul>
3. 3. Deterministic TM (DTM) A deterministic Turing Machine (DTM) is described by the 7-tuple M = (Q, S, G, d , q0, b, F)[2] Q:      set of states S:      language G:      tape language d:       transition function, q0 0 -> q0 1 R q0:    initial state b:      blank symbol F: halting states
4. 4. TuringSlashPython
5. 5. Objectives <ul><ul><li>Analysis of the problem and investigation of other Turing Machine simulators </li></ul></ul><ul><ul><li>Formulation of an appropriate development process </li></ul></ul><ul><ul><li>Development of the simulator in wxPython </li></ul></ul><ul><ul><li>Evaluation of the final version of the program. </li></ul></ul>
6. 6. Initial Goals <ul><ul><li>The creation of a ‘one tape deterministic’ Turing Machine. </li></ul></ul><ul><ul><li>The use of XML to input and output Turing Machines </li></ul></ul><ul><ul><li>Conversion from and to the JFlap Turing Machine format </li></ul></ul>
7. 7. Extensions <ul><ul><li>Two tape & non-deterministic features </li></ul></ul><ul><ul><li>A more detailed output, including the initial, final and maximum length of the tape </li></ul></ul><ul><ul><li>Autofill / autocorrect features </li></ul></ul><ul><ul><li>High-level command features </li></ul></ul>
8. 8. Schedule
9. 9. TuringSlashPython <ul><ul><li>Aimed at students who are new to Turing Machines </li></ul></ul><ul><ul><li>Support for assignments </li></ul></ul><ul><ul><li>High-level commands for advanced users </li></ul></ul>
10. 10. Task 1 – Palindrome checker A Turing Machine that accepts a string that is in the format: { wwR | w { 0, 1 }* }
11. 11. Task 2 – Binary addition with 2 tapes A Turing Machine that does binary additions with 2 tapes
12. 12. Task 3 – High-level commands TuringSlashPython introduces a set of high-level commands that make it easier for a user to create a complex Turing Machine. copy(q0, q1, #, %) | _ | # | 1 | 0 | 0 | 1 | 1 | # | _ | % | % | _ |
13. 13. One tape high-level commands <ul><ul><li>go2start(q0, q1) </li></ul></ul><ul><ul><li>go2end(q0, q1) </li></ul></ul><ul><ul><li>add2start(q0, q1, a) </li></ul></ul><ul><ul><li>add2end(q0, q1, a) </li></ul></ul><ul><ul><li>find(q0, q1, q2, 1, D) </li></ul></ul><ul><ul><li>replace(q0, q1, q2, 1, a, D) </li></ul></ul><ul><ul><li>replaceall(q0, q1, q2, 1, a) </li></ul></ul><ul><ul><li>remove(q0, q1, a) </li></ul></ul><ul><ul><li>copy(q0, q1, #, %) </li></ul></ul><ul><ul><li>compare(q0, q1, q2, #, %) </li></ul></ul>
14. 14. Two tape high-level commands <ul><ul><li>go2start(q0, q1) </li></ul></ul><ul><ul><li>go2start1(q0, q1) </li></ul></ul><ul><ul><li>go2start2(q0, q1) </li></ul></ul><ul><ul><li>go2end(q0, q1) </li></ul></ul><ul><ul><li>go2end1(q0, q1) </li></ul></ul><ul><ul><li>go2end2(q0, q1) </li></ul></ul><ul><ul><li>add2start(q0, q1, a, b) </li></ul></ul><ul><ul><li>add2start1(q0, q1, a) </li></ul></ul><ul><ul><li>add2start2(q0, q1, a) </li></ul></ul><ul><ul><li>add2end(q0, q1, a, b) </li></ul></ul><ul><ul><li>add2end1(q0, q1, a) </li></ul></ul><ul><ul><li>add2end2(q0, q1, a) </li></ul></ul><ul><ul><li>find(q0, q1, q2, 1, 2, D) </li></ul></ul><ul><ul><li>find1(q0, q1, q2, 1, D) </li></ul></ul><ul><ul><li>find2(q0, q1, q2, 1, D) </li></ul></ul><ul><ul><li>replace(q0, q1, q2, 1, 2, a, b, D) </li></ul></ul><ul><ul><li>replace1(q0, q1, q2, 1, a, D) </li></ul></ul><ul><ul><li>replace2(q0, q1, q2, 1, a, D) </li></ul></ul><ul><ul><li>replaceall(q0, q1, q2, 1, 2, a, b) </li></ul></ul><ul><ul><li>replaceall1(q0, q1, q2, 1, a) </li></ul></ul><ul><ul><li>replaceall2(q0, q1, q2, 1, a) </li></ul></ul><ul><ul><li>remove(q0, q1, 1, 2) </li></ul></ul><ul><ul><li>remove1(q0, q1, 1) </li></ul></ul><ul><ul><li>remove2(q0, q1, 1) </li></ul></ul><ul><ul><li>copy(q0, q1, #, %) </li></ul></ul><ul><ul><li>copy1(q0, q1, #, %) </li></ul></ul><ul><ul><li>copy2(q0, q1, #, %) </li></ul></ul><ul><ul><li>compare(q0, q1, q2, #, %) </li></ul></ul><ul><ul><li>compare1(q0, q1, q2, #, %) </li></ul></ul><ul><ul><li>compare2(q0, q1, q2, #, %) </li></ul></ul>
15. 15. Questions ? Thank you!
16. 16. References [1] Turing, Alan M. (1936) “On Computable Numbers, with an Application to the Entscheidungsproblem”. Proceedings of the London Mathematical Society . 2 42, 230-265, 1937. [2] Hopcroft, John E.; Rajeev Motwani and Ullman, Jeffrey D., 2000, Introduction to Automata Theory, Languages, and Computation (2nd ed), Addison-Wesley.