You are on page 1of 3

UNIVERSITY OF TECHNOLOGY, JAMAICA

SCHOOL OF COMPUTING AND INFORMATION TECHNOLOGY


BACHELOR IN COMPUTING & IT Computer Science Major PROGRAMMING ASSIGNMENT

GROUP: BSC3 SUBJECT: THEORY OF COMPUTATION

DATE GIVEN: February 16, 2012 DATE DUE: March 15, 2012

Turing Machine Simulator


This project aims to simulate the computation of the Turing Machine. A Turing Machine consists of a tape of infinite length and a read-write head which can move either left or right across the tape. For each transition, the machine checks the current state and the character on the tape below the head, then changes to a new state, writes a new character on the tape, and moves the head one space left or right. The machine stops after transferring to accept or reject state.

Implementation
This project is implemented with C++ or JAVA on the language which accepts a string and determine whether it is an even number or a palindrome.

Basic idea There is a transition table for the Turing Machine. The record in the transition table is just like this: [current state, current character, next state, next character, direction]. Current state is the current state of Turing Machine; Current Character is the character in the tape below the read-write head; Next state is the new state after the transition; Next character is the new character written in the tape; Direction is the movement of the read-write head which is right or left. User can input the transition rules of Turing Machine and input string of tape. Then the Turing Machine can decide if it accepts, rejects, or does not halt based on the transition rules.

Verify Turing Machine In this project, we assume the alphabet of Turing Machine is 0..1. The left direction is presented by L and right direction is presented by R. So we need to check if the Turing Machine violates these rules. Simulator Design The program should accept string from user

The user should be able to choose whether to check if string is an even number or a palindrome State whether or not the string entered is an even number or a palindrome Your program must have an option to display the Turing Machine configuration (state, head position, and tape) after each execution cycle, i.e. a trace or debug mode.

The program should compile without errors, and work in accordance to the specifications of a Turing Machine.
1

Simulator Description
The document [20 marks] How you choose to present your work is, of course, up to you. We do, however, ask you to structure the document as follows:
1.

Introduction: A summary of the aim of the project, and how you propose to go about it. [3 marks] Automaton design: Formal specification of the Turing Machine which defines the language in question. [6 marks] C++/JAVA implementation:
a. What data types are used, and how they relate to the components of the automaton

2.

3.

being implemented. [3 marks]

[3 marks]

b. How the structure of the program implements the operation of the automaton

Step by step operation of Turing Machine c. User guidelines [3 marks]

4.

Limitations: Circumstances that were not considered in design [2 marks]

The program [40 marks]


An algorithm, which implements the operation of the automaton [10 marks] User Interface [5 marks] Presentation and Readability of code [5 marks]

The program should compile without errors, and do what the formal specification of the Turing Machine does. In practice, this means that, once submitted, we must be able to run your program and expect it to work in accordance with the TM specification. More particularly:

If we input any of the strings of the language which the TM has to accept, it really must accept them, and also inform us that it has done so. [10 marks] If we input any other string, it must reject that string and also inform us that it has done so [10 marks]

Instructions
Students are expected to work in groups of three persons to complete this assignment. Each Group is to be formed from within each respective Tutorial class at the discretion of tutor responsible for that class. Students will be individually assessed within the context of each group for their actual proven involvement. Plagiarism is disallowed, and students are asked to refer to the University Handbook for further information on this matter. Mark deduction will be applied for days late as follows: 25% 1 day, 50% 2 days, 75% 3 days. No assignment will be accepted after the third day late, in which case the student will be awarded zero marks for the assignment. Assignments are due at 11 am on March 15, 2012. They are late after that.

Submission
All projects are to be handed in at SCIT Student affairs office, with a printout of the program code, and documentation along with a readable CD of source programs (i.e. the pre-compiled version only no executable files only are allowed). CDs or disk which cannot be read, will automatically be dumped in file 13. Hard-copy submissions should be packaged in envelopes and sealed. Names of ALL participating group members, student identification numbers, and class group to which they belong should be clearly affixed to the assignment, along with Authorship Declaration signed and attached by each group member. Failure to comply with one or more of the guidelines provided above, can result in a zero award for this assignment.

You might also like