Question
In computability theory, the recursion theorem states that Turing machines can obtain their own description, which can then be used in further computation [2]. The
In computability theory, the recursion theorem states that Turing machines can obtain their own description, which can then be used in further computation [2]. The ability of a Turing machine to implement self-referential algorithms means that any Turing complete language can be used to construct a program that outputs an exact copy of its source code when executed. These self-reproducing programs were later coined as quine programs by Douglas Hofstadter in his book Godel, Escher, Bach: An Eternal Golden Braid [3]. A quine-relay extends quine computing to multiple levels or recursion. For example, a quine relay program A generates program B which generates program C and so on. An ouroboros (like the serpent eating its own tail) is a quine-relay that eventually produces the original starting program.
A. Your task is to write a ouroboros quine-relay program that writes to two output streams (stdout and stderr), while adhering to the following requirements.
Requirements:
Your ouroboros program should be written in Java and contained in a single class file named Ouroboros.java
Your ouroboros program cannot receive any form of input, including reading from a file.
Each output program in the ouroboros should write the source code of the next program to be executed to stdout (System.out).
Each output program must include comments in the output source code.
Your first name and last name must be in a multi-line comment block following the author annotation (Example: /* @author Payas Awadhutkar */)
Each program in the ouroboros should output a single character to stderr (System.err).
Using the provided runner (runner.sh), the ouroboros should repeatedly output your first and last name followed by a newline to the file result.txt
B. What is the relationship of your ouroboros program to a computer virus and what implications does the recursion theorem have on anti-virus software? Explain your answer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started