Prev Next Up Home Keys Figs Search New

Genetic Algorithms

Appeared in Volume 7/4, November 1994

Keywords: genetic.


From: fuchs@ifi.unizh.ch (Norbert E. Fuchs)
16th August 1994  
Has anyone tried to use Prolog for genetic algorithms?


From: borbor@divsun.unige.ch (Boris Borcic)
24th August 1994  
Genetic programming pioneered by Koza uses mutating mini-programs generated in a form of Lisp. Has someone tried to adapt - or thought about adapting - the approach to a language more like Prolog ?


From: popx@vax.oxford.ac.uk (Jocelyn Paine)
31st August 1994  
Yes, I have. Koza's trees represent functional programs: the nodes are functions and the subtrees are their arguments. It's not much trouble to convert these into equivalent Prolog programs, by introducing extra variables to hold temporary results. So:

    (forward (+ (/ (sensor 1) 2) (/ (sensor 2) 3)))

would become:

    sensor(1,A), B is A/2, sensor(2,C), 
    D is C/3, E is B+D, forward(E)

Of course, I'm not using Prolog as a relational language here: I'm essentially doing genetic programming in a functional language, but with a separate phase which converts the function applications into Prolog.

One thing that Koza didn't do (as far as I know) was to constrain mutations and crossovers by using types. I know the abstract types that my functions have, and I wanted to ensure that these processes only generated type-correct trees. So I have a table of the argument and result types of each function, and I use this when locating and replacing subtrees. If I were treating Prolog as a relational language, I suppose I'd want to ensure the trees were mode-correct as well.

Prev Next Up Home Keys Figs Search New