Artificial Life: A Programmer’s Perspective

By ai-depot | August 23, 2002

A Programmer’s Perspective

A Programmer’s Perspective

If we vaguely define a “program” then it is just a set of rules applied to a definite input space to get some desired output. The logic behind any program is always defined using these rules. Although a program’s functionality entirely depends on the logic on which it is based, still there can be lower levels of approaches towards it too. Computer code need not be always viewed as a collective block. It can be sub-divided into segments, more like functions and sub-routines, each segment capable of accomplishing some definite objective irrespective of what triggers it. Such kind of segmentation helps us understand how processes will communicate to result in interesting properties. We will look into two computer programs which share the significant biological phenomenon, namely survival and predation.

Core Wars

Core Wars is a game popularized by A.K. Dewdney in the 1980s through his series of articles in Scientific American. Core Wars is like a gaming arena where you program your own warriors by writing computer code. These programs then battle against each other in a computer generated world. The computer generated world is actually a linear looping array of memory cells called the “Core”. Each warrior is a small program consisting of well-defined instructions and each of the instructions occupy a single cell in the memory array. The memory is said to be looping because after the last instruction in memory is executed, control goes back to the first cell. Two programs are loaded into random positions in the core where the battle starts. After a certain number of cycles, if neither program has quit executing, a tie is declared. If one program terminates, the other is declared the winner. So, the primary objective behind the game is to write a warrior that can terminate all the opponent processes. This is where the ‘War’ in Core Wars comes in. Core Wars warriors are written in an assembly level language, called Red Code.

A simple warrior in Red Code, called the dwarf, looks like this:

 mov.i  $0,     $1

It should be noted here that addressing in Core Wars is always relative. All locations are referenced from the executing instruction. This single instruction will copy itself to the next location. Control then moves to the next instruction of the core. However, the current location now contains a copy of the previous instruction only. And so upon execution, it also copies the dwarf into the next location, and the process continues. As a result of this the entire core will be filled with dwarfs.

Core Wars, in another way to define, is a resembling model of Darwin’s famous “survival of the fittest” theory. It is a gaming arena where computer processes battle against each other for one sole objective - survival. The fact that Core Wars warriors shares this purpose with real life forms offers it as a perfect paradigm for studying phenomena in a virtual biological environment, generating artificial life forms in the process. Core Wars warriors resemble complete life forms in it. It’s not too difficult to find analogies between these warriors and other biological life forms. Though the behavioral complexity of these computer-simulated processes are way behind that of real life processes, they do exhibit comparable phenomena when placed in a Core Wars simulator. A warrior can copy itself and then split to the copy, which is much like cell division, or jump to the copy, which is more like the biological equivalent of movement. A process can cause another process to stop, which is somewhat like biological predation. Furthermore, some of the more complex programs have displayed such abilities as setting a trap, self-repair, and mimicry, all of which have biological equivalents. This functionality lends credence to Core Wars to function as an experimental bed for artificial life experiments.

Computer Viruses

In the simplest terminology, a computer virus is malicious code. They are designed to somehow affect the normal program execution, either by changing the program itself or by clogging the resources used by the program. A computer virus, just like a biological one, attaches itself to some host program, infects it, and then spreads whenever the host program is executed.

Almost all computer viruses are self-replicating. They contain within all the instructions necessary to replicate themselves. They are even capable of distinguishing non-infected hosts from infected ones. Continual infection of the same host program may result in early detection of the virus. In order to avoid such situations, viruses are assigned signature codes to help them self-recognize. Many special purpose viruses also attack the system devices directly through interrupts thereby redirecting system calls to malicious ones. Viruses can be self-mutating too. Every time they infect a program, they may change one or two instructions in their code so that the activation or replication methods differ from one to the other. All this brings computer viruses very much close to how we define artificial life. However, if computer viruses are treated as artificial life forms, then their environment - computer programs - also has to represent some aspect of artificial life. After all, no life can survive without a supportive environment. It’s still a matter of debate whether computer viruses are “alive” or “dead” entities. Viruses do not exist in any organic form, but that reason may not be sufficient enough to suggest that they are not any form of artificial life. They have properties causally connecting them to life. Whatever it may be, no one can deny the fact that computer viruses are something that directly affects the way we work. They have the capacity to clog networks, disenable servers, and destroy mission critical data. They are more than just a model for any kind of experiment.

Summary

Throughout the length of the essay, we saw how basic definitions are all that is required to explain complex systems. Complexity need not be always designed; it may arise from simplicity too. Complex behaviors are emergent properties that evolve from simple laws. Artificial life studies are based on this theory only. Evolutionary mechanisms like crossovers and mutations are applied to simple organisms and in the process much complex organisms evolve out of it. The complexity of a structure or behavior hides within itself multi-layered simpler structures. Artificial life forms are very restricted to their environment, and any change in it will destabilize them.

Ever since its inception, the Game of Life has been of much interest to researchers of artificial life forms. Its resemblance with many biological as well as physical phenomena has made Life intriguing enough to encourage many artificial life experiments in it. Moreover, Life being a computationally simple model, it attracts the attention of programmers too. Virtual eco-systems, like Tierra, prove that computer code is not collective, but a conglomeration of logically comprehensible structures. Any model of real life will never be accurate simply because there are too many factors affecting it. However, models can be designed to solve specific problems. Real life is too complicated to be deciphered, but only if we take an ordered approach towards it, will we know the real meaning of life.

Written by Rinku Dewri.

Pages: 1 2 3 4

Tags: none
Category: essay |

Comments