Introduction.
Unlimited Register Machines (or URMs) are mathematical abstractions of real-life computers. They are more user-friendly than Turing Machines and make an ideal introduction to machine models of computability. Any effectively computable function can be computed on a URM.
URMs were invented by J. C. Shepherdson and H. E. Sturgis. In this assignment you are required to implement Unlimited Register Machines (URMs) using three different languages – Java, C and Python. i.e., you are required to write programs in these languages that imitate the functionality of URMs (to develop Virtual URMs).
Programming tasks
You are required to implement Unlimited Register Machines (URMs) in three different languages – Java, C and Python.
Implementation Requirements:
• Set of URM’s registers should be implemented as an array or list of integers.
• Instruction types should be coded by the integers {0,1,2,3}: use 0 for Z, 1 for S, 2 for T and 3 for J.
• Instructions should be represented by arrays or lists of integers, for example, instruction J(1,2,4) in your Python program should be represented by the list [3,1,2,4].
• Programs should be implemented as arrays or lists of instructions. For example, the program from Example 1 should be represented by the following list of lists in your Python implementation:
program = [[3,1,2,4],[1,0],[1,2],[3,0,0,0]]
Also, you are required to write the following three functions/methods in each of the implementations:
(1) isValidCommand(command) – takes a list/array of integers and returns true if it is a valid URM command, otherwise returns false.
(2) isValidProgram(program) – takes a list of instructions and returns true if it is a valid URM program, otherwise returns false.
(3) run(program, registers) – runs the URM program on the list/array of registers.
(4) main() – this is a testing method/function where you test your implementation of URM by running the program from Example 1. Write a URM program.
In this task you are required to write and test a URM program that computes the product of two numbers.
Allocated Marks: See Course Description
Due Date: See Course Description
Please refer to the Course Description for information relating to late assignments and special consideration
Assignment Submission:
You must supply your program source code files and report documentation as single compressed archive called Assignments will be marked on the basis of fulfilment of the requirements and the quality of the work. In addition to the marking criteria, marks may be deducted for failure to comply with the assignment requirements, including (but not limited to):
• successful compilation
• successful completion of the required tasks
• adherence to the guidelines provided
• quality of code that adheres to the programming standards for the Course;
Including:
1. comments and documentation
2. code layout
3. meaningful variable names
Submit your assignment (all program source files plus your discussion document) to the Assignment 2 upload location on Moodle before the deadline. The mark distribution for this assignment is explained on the next page.