[Push] Type literals
Lee Spector
lspector at hampshire.edu
Fri Jun 18 15:33:56 EDT 2010
In Push 3 a type name, like INTEGER, is just a symbol that's not a known instruction, so it should go on the NAME stack. Which would be a little confusing, I agree, but I think that's the specified behavior -- it would be a name that has nothing intrinsic to do with the type that it names.
Unless you include the type name in your instruction set, or provide some other way for it to get into non-configuration code, I don't see how this could affect evolutionary dynamics or GP results.
-Lee
On Jun 18, 2010, at 10:10 AM, PerPlex Ed wrote:
>
> A numeric or symbolic literal is executed pushing its value in the respective stack (boolean, float, integer or name stack). How should type literal executed?
>
> As far as I understand you dropped the type stack.
> The only use for types is in "configuration code" like in this examples (from P3.0PLD):
>
> CODE.QUOTE ( FLOAT ) ENV.TYPES
>
> It means that, if not quoted, the FLOAT type literal would be executed and there would be no mean for ENV.TYPES to collect the type anywhere, so you quote it and ENV.TYPES pops an item from the code stack. Does it mean that FLOAT is supposed to be a no-op?
>
> I was finishing the the configuration code of my implementation and I realized I was missing type literals, implemented them just like the other literals - it pushes type value in the type stack - and made ENV.TYPES collect the types there.
> I forgot that the type stack was supposed to not exist and actually it was natural for me to do that.
>
> I realize that wheter it's "natural" or not may depend on the internals of the intepreter too.
> In my implementation I have a "float value", a "float stack" which is a stack of float values and a "float literal" which is an "instruction" that pushes a value on the float stack. "float value" and "float literal" are not the same thing. I think I understand that the lisp implementation doesn't make any difference (and so will probably do any implementation that is internally strongly typed for a reason or another).
>
> What if I keep using the type stack?
> Will it have any impact on the results that the genetic programming system will yield?
>
> It doesn't make any significant difference in the implementation. I spent more time writing this message than what is needed to implement this feature in any of the two ways. I'm just worried about the "impact on the evolutionary process" more than about a different in behaviour of the implementation in executing some specific code. I don't have experience in this field.
>
> Thanks.
>
>
>
>
> _______________________________________________
> Push mailing list
> Push at lists.hampshire.edu
> https://lists.hampshire.edu/mailman/listinfo/push
--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438
Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.com/
More information about the Push
mailing list