Clojush
Clojush copied to clipboard
Reporting bug: Programs depend on initial program state
Running the simple_regression
demo, I evolved several successful programs which (I thought) worked fine before simplification, but failed after simplification.
It turns out that what I was doing was assuming that the demo config file was setting up push-state
with only the input value on the input
stack, when in fact it was pushing the number to both input
and integer
.
I had evolved a program which worked whether or not there was a copy of the input on the integer
stack, but which in simplified form was modified.
This is due in large part to the separation of "push setup" from the actual program being run and evolved at least at the level of the program setup files, and possibly at the point of reporting.
Prospective solutions, in order of difficulty:
- be sure to report "initial Push state" at the beginning (though this would be easy to miss in a long run); at present, what is reported is printed as a Clojure memory structure, not the actual source code used to set up the
push-state
- when reporting evolved programs, report them with their setup arguments; again, the source code used to initialize the stacks might do, here
- report all programs in a higher-order structure with their interface explicitly specified
In human-readable programming languages, we don't expect functions to accept arbitrary call signatures, and while there is "no syntax" in Push itself, there is a necessary interface between these programs we're writing and the user-constructed Push state as "inputs" and "outputs". Those should be incorporated into the notion of "program", not left to wander freely.