Dynamic Software Evolution

Team: 126

School: ST PIUS X HS

Area of Science: Artificial Intelligence


Interim:

If an infinite number of monkeys typed on an infinite number of typewriters, eventually all the great works of mankind would emerge.

-Anonymous

Introduction

The purpose of this project will be to create a software application that has the ability to rewrite and copy itself. Through simulating natural selection only the best programs will sustain themselves and multiply. Our goal will be to evolve a program that has the intelligence to adapt to any situation that is given to it. We will create a program that constantly copies itself (not perfectly). Another program will be created that will constantly challenge the first program to adapt to its environment. Failure of the first program to adapt to the environment will result in destruction and ultimately, its failure to pass-on its code (genes) to its "offspring". By constantly making the simulated environment more difficult to live in, as the program progresses, a program that posseses a unique level of intelligence can be created. The reason this project was chosen was to test and apply the theory of evolution to the field of software engineering. If this experiment proves to be one hundred percent successful, the field of software engineering may never be the same. The reason for this is that Dynamic Software Evolution is a type of software that rewrites itself, if it can be created, than there will be no need for the programmer.

Research / Background

Most of the ideas of Dynamic Software Evolution are derived from Charles Darwin's Theory of Natural Selection. Two major part of this of theory will be included in this experiment. The first part will be competition between species. "Hence, as more individuals are produced that can possibly survive, there must in every case be a struggle for existence ..." (Charles Darwin 91). This struggle for existence is the root cause of all evolution. As all species compete for a finite amount of resources, some species will inevitably be wiped out due to the seriousness of this struggle. The species that remain will be best suited for competition in nature. The experiment will simulate this competition and use it to narrow down the large number of simulated species into one species that is superior to all others. This experiment would not be possible without the creation of an imperfect replication algorithm (IRA). The purpose of the IRA will be to simulate variation, which is essential in any evolutionary process. "... can we doubt (remembering that many more individuals are born than can possible survive) that individuals having any advantage, however slight, over others, would have the best chance of surviving and of procreating their kind? On the other hand we may feel sure that any variation in the least degree injurious would be rigidly destroyed." (Charles Darwin 108). The advantages and disadvantages proposed by Charles Darwin are all results of variations in each individual species and can be simulated using the IRA. The second part of Darwin's theory to be included in this project is selection by man. "One of the most remarkable features in our domesticated races is that we see in them adaptation, not indeed to the animal's or plant's own good, but to man's use or fancy. Some variations useful to him have probably arisen suddenly, or by one step;" (Charles Darwin 49). As Charles Darwin proposed, selection by man will benefit the programmer and not the species in this experiment. Selection by man will be simulated in this experiment because the programmer will be allowed to intervene with the execution of the experiment. For example, there may arise a number of cases where a certain species may no longer possess certain qualities essential for its survival, but it may possess certain qualities that will help the programmer understand the theory of evolution. In this case, the programmer may save the species and allow it to advance in the experiment. Even though many of the ideas proposed in this experiment are derived from Charles Darwin's Theory of Natural Selection, it would not be possible to perform this experiment without the aid of computers. Since computers can perform large numbers of calculations in a small amount of time, it is possible to perform an experiment of this magnitude. The instructions given to the computer will be written in Java. Java was chosen in this experiment because of its portability, simplicity, power, and its implementation of object-oriented programming. "Object-oriented programming organizes a program around its data (that is, objects) and a set of well-defined interfaces to that data." (Herbert Schildt 13). Object-oriented programming contains three fundamental concepts: encapsulation, inheritance, and polymorphism. "Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse." (Herbert Schildt 19). Encapsulation prevents outside sources from accessing code. This prevents the alteration of important data. Another important object-oriented concept is inheritance. Inheritance is the process where one object inherits the properties of another. This concept is used extensively when species are created because all species are inherited from one common object. The purpose of this is to have certain attributes that all species must acquire. The last concept of object-oriented programming is polymorphism. "Polymorphism is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation." (Herbert Schildt 22). This specific feature allows the programmer to create code that is more generalized. The specifics can be left up to the compiler. Evolutionary programming has been used throughout time in an attempt to create artificial intelligence. "Evolutionary programming was used to attempt to optimize a program written in the pseudo-assembly language Redcode, invented by A. K. Dewdney. Corewars is the game under which Redcode programs compete." (Blaha and Wunsch 1). Corewars is a game in which programs compete against each other for survival. Multiple programs are released and attempt to destroy all other programs. The techniques that programs use to destroy each can become very advanced. "The most important and interesting instructions are JMP, MOV.I, DAT, and SPL. JMP simply moves the point of execution, as an unconditional branch. MOV.I copies an instruction at its first argument's location and overwrite the instruction at its second argument's location..." (Blaha and Wunsch 1). These techniques are used in combination with each other to destroy the opposing programs. The techniques display the advance methods that programs will use to carry out their instructions. This advance evolutionary program is just one of many applications to evolutionary programming.

Experiment/Project

The implementation of this experiment will require a number of separate programs all running at the same time in a common directory. The programs will fall under three categories: environmental, data logging, and species. The environmental category will contain one program. This program will be responsible for the simulation of nature itself. It will contain data relating to the amount of resources, time, position of all the species, and other environmental factors. Another responsibility of the environmental program will be to use the imperfect replication algorithm (IRA) on species when they request it. The data logging programs will be responsible for recording and displaying the data given by the species and environmental programs. This data will be analyzed after the completion of the experiment. The last category of programs will be the species programs. The species programs will be the largest group of programs. All the species programs will possess different code but will all extend the Species Class. The species programs will simulate the individual species of the environment. They will all interact with the environmental class and compete for resources. The species will have the ability to reproduce. Reproduction will be asexual and will be handled by the environmental class at request of each species.

Conclusion

In conclusion, after researching Dynamic Software Evolution, a number of predictions can be made about its outcome. If the experiment were to be done correctly, than a significant amount of software evolution would take place. The software may become advanced enough to survive in its simulated environment for a remarkable amount of time, but otherwise no major artificial intelligence breakthroughs should result. The extent at which the software would evolve would probably be limited. This would be due to the fact that the amount of time the experiment is allowed to run is limited. The more time given to the experiment the greater the extent of evolution. Therefore, if an infinite amount of time is given to the experiment, than eventually artificial intelligence would emerge. If any evolution does occur, than the experiment would be classified as a major success and could be allowed to run at longer intervals. Dynamic Software Evolution is a major attempt in the creation of artificial intelligence, and any result will prove to be beneficial.

Bibliography


  1. Blaha, Brian, and Don Wunsch. "Evolutionary Programing to Optimize an Assembly Program." University of Missouri. 5 Nov. 2005 .

  2. Darwin, Charles. The Origin of Species. New York: Random House Inc, 1998.

  3. Schildt, Herbert. Java 2 The Complete Reference. 4th ed. Berkeley: Osborne / McGraw-Hill, 2001.



Team Members:

  Ryan Loyd
  Matthew Paiz
  Mark Wunsch

Sponsoring Teacher: Kerrie Sena