[racket] Redefinition of initial bindings/ Resessive genes in GP

From: jukka.tuominen at finndesign.fi (jukka.tuominen at finndesign.fi)
Date: Fri Jul 6 09:18:41 EDT 2012

>> The offspring is basically a module source code. Due to GP's crossover
>> and
>> mutation functions, the offsprings source code can suggest function
>> redefinitions in (atleast) two ways. For example
> You might consider a customized module language that's more amendable
> to the kinds of code mutations you're considering.  That is, it's
> possible to have a language variant of Racket where "define" acts like
> redefinition at the module toplevel.  I have an example of something
> like this in my Arctangent toy language (Refernce: see the definition
> of 'def' in
> https://github.com/dyoo/arctangent/blob/master/language.rkt)

Thanks Danny, I got lots of new ideas from this. A customized language is
a great possibility. However, there's quite a lot of existing "creatures"
which I'd rather keep valid and intact. What I'm now thinking, is either..

A) "Inject" the kind of def/arctangent definition to a
individual/population and see if it takes off.

B) Allow individuals to use the new "def" function if they ever come
across it (by crossover/mutation e.g.). This would be a part of the
initial environment "require".

C) Try to find a way to replace the original "define" definition with the
"def". This would be the fastest way to deploy it, but I'd need to be
careful not to break the earlier work.

Propably a combination of A and B might be the best bet. The initial
environment is expanded to cover a new function def1 (as a primitive, but
not the source), and some individuals could be injected with def2
including the source. Having the source included, exposes it to
evolutionary changes. So, you would end up having three variants (define,
def1 def2) available to choose from. If these were interchangeable,
mutation could easily handle it. And new variants could evolve faster than
spontaniously (who knows if there is something like that already in the
population :)

And I may end up creating a new #lang in the end, if necessary.

> I don't think redefinition should be the default, given that standard
> Racket's approach is to generally make mutation an explicitly
> represented feature.  That is, if I want to see that something stays
> the same, I grep for 'set!' in my code, and if I don't see it, I can
> assume that I don't mutate my toplevel.

Makes sense, I agree. But if there was a commandline option like

$ racket -allow-redefinitions ...

available, that would be great. Or if you could somehow enable it by code.

br, jukka

Posted on the users mailing list.