[Icfp04-discuss] Ant optimizers?
Alejandro Forero Cuervo
bachue at bachue.com
Thu Jun 10 14:53:33 EDT 2004
> Such an optimizer will destroy the ant for sure, the ant's
> memory depends on identical codes in different places to embedd
> state information, it is the only working memory the ant has.
No.
If two states are indeed identical, you can remove one of them,
even if they were associated with different values for certain
variables. In this case you probably have a variable taking
different values embedded in the memory but the same code
executing regardless, so you can just ignore it and expand the
code only once.
The optimizer would be trivial:
1. Find two identical instructions A, B.
2. Remove B.
3. Change all references to B. Set them to the A.
4. Fix references to all the instructions that move one position
upwards (or move the last instruction to the position of B and
fix references to it).
This would be executed until 1 fails.
Our team considered writing one such optimizer, but didn't do it,
as we didn't think it would help *our* ants very much (and we ran
out of time anyway).
Alejo.
http://bachue.com/alejo
---=( Comunidad de Usuarios de Software Libre en Colombia )=---
---=( http://bachue.com/colibri )=--=( colibri at bachue.com )=---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.seas.upenn.edu/pipermail/icfp04-discuss/attachments/20040610/310dc920/attachment.bin
More information about the Icfp04-discuss
mailing list