LISTSERV mailing list manager LISTSERV 16.0

Help for ECJ-INTEREST-L Archives


ECJ-INTEREST-L Archives

ECJ-INTEREST-L Archives


ECJ-INTEREST-L@LISTSERV.GMU.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

ECJ-INTEREST-L Home

ECJ-INTEREST-L Home

ECJ-INTEREST-L  April 2008

ECJ-INTEREST-L April 2008

Subject:

Re: The "nil" GPType in GPNodeConstraints

From:

Sean Luke <[log in to unmask]>

Reply-To:

ECJ Evolutionary Computation Toolkit <[log in to unmask]>

Date:

Wed, 9 Apr 2008 12:37:10 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (83 lines)

On Apr 9, 2008, at 10:00 AM, Lawrence Tsang wrote:

> Hi Tibi and Yow Tzu Lim,
>
> Thanks for all the answers. I've got the idea.

Too late! Now you've got me responding too. :-)

It's important to distinguish between "types" and "data". Formally a
type is just a compatibility constraint. If function FOO has a
"return type" of bar, and function BAZ takes one argument which is of
type "bar", then FOO is permitted to fill the argument slot of BAZ.

This doesn't actually have anything to do with data per se; but the
#1 reason why you'd want to state that functions have certain types
is because if FOO sends out an integer and BAZ expects a String, then
yo wouldn't want FOO to be allowed to hook up with BAZ, so you'd
stipulate that they have different types.

Because formal language types are so closely associated with "data
types" -- two functions are typed the same way because they return
the same data or whatever -- people think they're the same thing.
But they're not. There are other reasons you might not want two
functions to hook up. For example, you might want to be guaranteeing
that your tree structure has functions of some form A in its top row,
functions of some form B in its second row, and functions of some
form C in its third row. This kind of thing shows up a lot when the
tree structures aren't "programs" per se, but are used for some other
functionality. To do this, you could say that the root only accepts
functions whose return type is "A", and "A" functions only accept
child arguments of type "B", and so on.

What's nil?

That's easy. By default, most ECJ examples are "untyped", meaning
that there are no constraints on who is able to hook up with whom.
This isn't zero types: it's one type -- everyone shares the same type
so everyone is compatible with everyone. I had to have some name for
that type, so I picked nil. It's just a name. You can change it to
something else like gobbledygook and that'd work fine.

One further note on typing: ECJ's typing is a fairly rudimentary
typing which I call "set typing". Types are sets of objects. Two
things are compatible if their types have a nonempty intersection --
they share an object common in their two sets. You can do a lot with
set typing, not the least of which is generic functions and
replicating the functionality of polymorphism. People actually
typically need an even simpler typing notion, which I call "atomic
typing" -- here types are just symbols, and two functions are
compatible if their types are the same. Atomic typing is really just
a degenerate form of set typing: instead of an atomic type FOO, you
could just have a set type which contains a unique single symbol
inside it, which is special just to that set type: FOO2 = { FOO }.
So you can easily replicate atomic typing with set typing -- I
include it just for convenience. Also, you can mix atomic types and
set types. An atomic type is "compatible" with a set type if the
atomic type is found in the set type's set.

Note that this is strictly NOT as powerful as various "polymorphic
typing" approaches people have taken -- there's been a fair bit of
work on people who have functions whose return types (say) change
based on the argument types of the children that wound up plugging
into them. This is very powerful stuff but it's a nightmare to do
general crossover operators and mutation operators in, and it's
fairly rarely needed. An example of where it'd be nice to have.
Let's say the data structure your functions are passing around is a
matrix. You want to make a MATRIX_MULTIPLY function which takes two
matrices, multiplies them and returns the resulting matrix. In a
sophisticated polymorphic typing mechanism you could say that IF you
have an N x M matrix plugged into your first child, AND you had an M
x P matrix plugged into your second child, then your return type
would be "N x P". Note that this implies that you have a potentially
infinite number of types and so this clearly can't be done with set
typing. Maarten Keijzer (http://www.cs.vu.nl/~mkeijzer/) did work
exactly like this, and wound up building his own extension of EO (I
believe) to handle polymorphic typing. Tina Yu (http://www.cs.mun.ca/
~tinayu/) did polymorphic typing for her thesis I think.

Sean


  

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

March 2023
November 2022
June 2022
September 2019
August 2019
June 2019
April 2019
March 2019
January 2019
December 2018
November 2018
October 2018
July 2018
May 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004

ATOM RSS1 RSS2



LISTSERV.GMU.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager