Thanks Sean. Now I get it. 

----- Urspr√ľngliche Mail -----
Von: "Sean Luke" <[log in to unmask]>
An: [log in to unmask]
Gesendet: Donnerstag, 16. Mai 2013 20:09:01
Betreff: Re: Strong GPTyping

On May 16, 2013, at 4:20 AM, Bojan Janisch wrote:

> how do I define which node has to be root? I don't get it from the manual, 
> seems like it were mentioned in the beginning of chapter 5.2.11 but were 
> completely skipped at the examples. 

You're right, I had skipped it because it was the default setting.  I shouldn't have done that, so I've updated the manual.  Here's what I added:

> Next we need to say what kinds of nodes are permitted as the root of the tree.  We do this by specifying the tree's return type.  For a node to be permitted as the root of the tree, it must have a return type compatible with this tree return type.  Let's say that we want our tree to only have root nodes which have a return type of nil (no boolean allowed):
> = 1
> =
> = tc0
> = f0
> # Here we define the return type of this GPTreeConstraints
> = nil
> As it so happens, this is what we already have by default, so putting it all here is a bit redundant.

In short: the root is restricted to those GPNodes whose return type is type-compatible with the return type of the GPTree.

> It would be great if someone got an example of a hierarchical GPTree and
> could explain how a GPType is bounded to a GPConstraint and so to a GPNode,
> because this I also didn't understand from the manual. 

Constraints contain GPType names as part of their parameters.  For example, a GPNodeConstraint which returns type foo and accepts a left child of type foo and a right child of type bar would be written as: = = blah = foo = 2 = foo = bar

You specify that a given kind of GPNode uses this constraints in your function set:

gp.fs.0.func.4 = = blah

Basically the same thing goes for the trees (GPTree and GPTreeConstraints)