510 likes | 690 Vues
Digital Universes. BARAK NAVEH, www.cs.bgu.ac.il/~barnav. < Previous. Next >. Evolution in Other Contexts. Life on Earth is a product of evolution by natural selection operating in the medium of carbon chemistry .
E N D
Digital Universes BARAK NAVEH, www.cs.bgu.ac.il/~barnav < Previous Next >
Evolution in Other Contexts • Life on Earth is a product of evolution by natural selection operating in the medium of carbon chemistry. • However, in theory, evolution is not limited to Earth, nor to carbon chemistry. • Just as it may occur on other planets, it may also operate in other media, such as the medium of digital computation.
Carbon-Based Organization • The organizationgenerated by evolution spans about twelve orders of magnitude of scale. • from the molecular to the ecosystem level.
Evolution in Organic Medium • Organic lifeuses energy and organizes matter. • Evolution on Earth has organized matter from the molecular level up to the ecosystem level.
Evolution in Digital Medium • Can we use evolution to develop such organization? • Can life use CPU-timetoorganize memory? • Can we use evolution to synthesize digital life?
What isLife? • No clear definition. • We will regard to an object as alive if it is • Self-replicating • Capable of open-ended evolution
The Creatures • Self-replicating machine code programs. • Why machine code? (most natural to the machine) • Machine instructions remind us of amino acids because they are “chemically active”. (actively manipulate bits, bytes, CPU registers) • The “genome” of a creature is the sequence of its machine instructions.
The Environment – Tierra VM • Why Virtual Machine? • Avoid the threat of evolving hostile code such as viruses or worms. • Von Neumann type machine languages are fragile, any mutation or recombination event is almost certain to completely break program. • To make it especially hospitable to synthetic life. • Tierra is a (simulated) parallel computer • with a processor for each creature.
Each CPU • Contains • 2 address registers + 2 numeric registers • Small Stack + Stack pointer • Instruction pointer • Flags register to indicate error conditions • Performs fetch-decode-execute-inc(IP) cycle • Has a simple instruction set for • Arithmetics, bit manipulation • Moving data between registers and RAM • Control “instruction pointer” (IP) • Computations are probabilistic • Mutations occur at some low rate
The Tierran Language • 32 instructions represented by five bits, operands included. • Numeric operands eliminated • Instruction set need not include all possible integers. • CPU registers and stack are the only operands of instructions. • Bit flipping and shifting is used to synthesize numbers. • Errors that cause instructions to fail make them have no effect.
Template Addressing • Numeric operands are normally used to specify addresses, such as absolute or relative addresses for jmp instruction. • Numeric operands were eliminated • (another method is needed) • In Tierra, the jmp instruction uses a template instead of an absolute or relative address.
Template Addressing • Templates are “borrowed” from molecular biology. • Molecules “address” one another by having complementary shapes. • Templates are complementary patterns of zeros and ones. • Templates are built from two kinds of nop instructions: nop0 and nop1
Template Addressing • The instruction sequence: jmpnop0nop0nop1 • causes execution of the program to jump to the nearest occurrence of the instruction sequence: nop1nop1nop0 • Why use complementarity? • so that the jmpwill never jump to itself.
Memory Allocation • The Tierran computer operates on a block of RAM of the real computer, referred to as the “soup”. • The soup consisted of 60,000 bytes, which can hold 60,000 Tierran machine-instructions. • Each “creature” occupies some area in the soup. • Memory is circular.
Cellularity • The cell membrane is defining its limits and preserving its structural integrity. • In digital organisms we need an analog to cell membrane in order to prevent them from demolishing one another easily when they come into contact
Cellularity (cont.) • Each Tierran creature has exclusive write privileges within its own memory • A creature may examine the code of another creature, and even execute it, but it can NOT overwriteit.
Cellularity and Division • Creature has write privileges to: • The memory block it is born with (mother cell). • The memory block it may allocate using mal instruction (daughter cell), which may be used to grow or to reproduce into. • Upon creature divide instruction: • The mother cell loses write privileges on daughter cell’s. • The daughter cell is given its own CPU and can allocate its own second memory block.
The Slicer • Time sharing approximates parallelism. • The number of instructions to be executed in each slice may be set in proportion to the size of the creature being executed, raised to a “slicer-power”. • The power determines if selection favors large or small creatures • power < 1: favors small • power = 1: size neutral • power < 1: favors large
Mortality - The Reaper • At birth, processes enter the bottom of the Reaper queue. • When the memory is full, the Reaper kills processes at the top of the queue. • Memory allocated to the dead process is reclaimed. • The code of a dead process is NOT removed from the soup.
The Reaper (cont.) • When a process generates an error, it moves one position up the Reaper queue. • Successful execution of divide or mal moves the process one position down. • Overall effect: • Flown creatures rise to queue top and die. • Vigorous creatures have a greater longevity. • The probability of death increases with age.
Mutations • Two kinds of mutations of machine instructions: • a single bit of an instruction is flipped • random replacements - the affected instruction is replaced by one of the 32 instructions in the set, chosen at random • Mutations occur when: • a process is born • code is copied from place to place • any time at random (cosmic ray)
Gene Splicing • There are three classes of splicing: • Crossover • Insertion • Deletion • Each class can occur in two ways: • Anywhere in the genome • Only at “segment boundaries”, marked by templates • Gene splicing is applied to a daughter process at the time of birth
Flaws • Flaws were originally conceived of as being analogous to metabolic reactions gone wrong, or producing side products • Flaws are “intentional” errors in the operations of the machine instructions • Most flaws are errors of magnitude + or – 1 • Increment/decr may add/sub 2 or 0 instead of 1 • Instructions shifting or rotating bits in registers may shift the bits one place too much or too little
Tierra System • Self replicating individuals • Genetic alterations • Natural selection • Co-evolution Results
Ancestor 0080aaa 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Self-examination 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 Reproduction Loop 1100 save registers to stack 1010 move [bx] -> [ax] decrement cx if cx == 0 jump 0100 increment ax & bx jump 0101 1011 restore registers return 1110 Copy Procedure (coded by human)
Ancestor 0080aaa 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Self-examination 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 Reproduction Loop 1100 1100 save registers to stack 1010 move [bx] -> [ax] decrement cx if cx == 0 jump 0100 increment ax & bx jump 0101 1011 restore registers return 1110 Copy Procedure
Mutant 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Self-examination 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 Reproduction Loop 1110 save registers to stack 1010 move [bx] -> [ax] decrement cx if cx == 0 jump 0100 increment ax & bx jump 0101 1011 restore registers return 1110 Copy Procedure
Parasite 0045aaa 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Self-examination 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 Reproduction Loop 1110
Ancestor 0080aaa Parasite 0045aaa Self-exam Self-exam 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx ReproductionLoop Reproduction Loop 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 1100 1110 Copy Procedure save registers to stack 1010 move [bx] -> [ax] decrement cx if cx == 0 jump 0100 increment ax & bx jump 0101 1011 restore registers return 1110
Parasite 0045aaa 0080gai Self-exam 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Reproduction Loop allocate daughter -> ax call 0011 (copy procedure) cell division jumpb 0000 1100 Copy Procedure 1010 move [bx] -> [ax] decrement cx if cx == 0 jumpb 1100 increment ax & bx jumpb 0101 1110 Self-exam 1111 find 0000 (start) -> bx find 0001 (end) -> ax calculate size -> cx Reproduction Loop 1101 allocate daughter -> ax call 0011 (copy procedure) cell division jump 0010 1110 Hyper Parasite!
1010 move [bx] -> [ax] decrement cx if cx == 0 jumpb 110 increment ax & bx jumpb 0101 111 ?? 110 find 001 (start) -> bx find 000 (end) -> ax calculate size -> cx 0061acg Self-examination Social Hyper-parasite allocate daughter -> ax call 001 (copy procedure) cell division jumpb 010 Reproduction Loop 1100 Copy Procedure 1010 move [bx] -> [ax] decrement cx if cx == 0 jumpb 110 increment ax & bx jumpb 0101 111
Other Results • Immunity to parasites • Circumvention of immunity to parasites • Cheaters (e.g., 0027aab) • Abuse the cooperation of social hyper-parasites • Novel forms of self examination • Optimization • Size decrease • Loop unrolling • Emergence of Ecology
More Info www.isd.atr.co.jp/~ray/tierra/index.html It’s life Jim, but not as we know it (Dr. McCoy, Star Trek)
Related Works • Network Tierra (T. Ray) • Connect many machines together to form a bigger “soup”. • “Avida” (Adami, Brown, 94), similar idea but • On a grid (locality) • I/O and (limited) ability to train organisms to perform functions • Active research • “Amoeba” (Pargellis, 96), similar idea • Simpler instruction set • Spontaneous emergence of self-replicators
Related Works (cont.) • “Physis” (A. Egri-Nagy, ‘03) • Evolves both: VM and programs • Encodes the computer together with the program • “String Based Tierra” (K. Sigiura, ‘03) • Encodes programs into strings • Uses reg-expr rules to match-and-substitute (to compute) • Rules are strings as well • Evolve programs and their rules as a single individual
Open Challenges • Why creature complexity has stopped increasing? • What’s limiting further development? • Over 10 years have passed: • Memory space can support x10,000 bigger soup • CPUs can crunch x100 faster • In many cases “more is different” – is it here?
Demos of Other Artificial-Life Works Karl Sims Demetri Terzopoulos
Evolving Artificial FishDemetri Terzopoulos ’94-’99 Evolving a Swimmer Go Fish Jack Cousto
Thank You Good Luck