The Program Optimizer PackageThis package contains the mechanisms used to optimize programs.
This package contains the mechanisms used to optimize programs. Optimized programs are as size-reduced as possible while preserving
their exact functionality. Small programs are good for evolution. If a program contains an instruction
i which could be
left away because it is useless or cannot be reached it wastes "evolutionary" power, because in the next mutation cycle,
might be changed. A change in
i will probably not result in
i becoming reachable or usefull, so we'll test
the same program again.
Currently, there are three levels of optimization to be performed:
Write mem, mem+(3*-1)will become
Write mem, mem-3.
0: If 1 Goto 2 1: mem = 1 2: mem = 0The instruction at index 1 will be removed, because it can never be reached. The result will be
0: If 1 Goto 2 1: mem = 0
0: Sleep 10 1: Sleep 10will become
0: Sleep 20.