You are running out of virtual memory. Because of the algorithm that Context Free uses to evaluate your rules it tends to leave 10s of millions of rules sitting in a queue, waiting to be evaluated. Context Free evealuates a rule and puts all the squares, circles, and triangles in the finished shapes list and everything else in the unfinished shapes list. The unfinished shapes list is a queue. But every once and a while Context Free sorts the queue to bring the biggest shapes to the front.
The queue-with-sorting algorithm is fine for evaluating your SCENE rules, but it is terrible for evaluating your xSHAPE rules. A better algorithm would evaluate the ASHAPE to a BSHAPE to a CSHAPE ... to a GSHAPE to a SQUARE before getting the next unfinished shape. But instead the ASHAPE gets put in the queue. When it gets to the front it causes a BSHAPE to be put in the queue. This means the queue gets clogged with huge numbers of xSHAPE rules. Disabling sorting helps, although I don't know why. I was able to produce this after two hours of rendering without sorting: I thought that changing the unfinished shapes list from a queue to a stack would fix the problem, but it broke the size based stopping rule and resulted in infinite recursion.
I can think of a number of ways to fix this cfdg file:
In this case it would be nice to have a random number syntax like 'hue 100:150' to set the hue to a random number between 100 and 150. This would work fine for color changes, but size and rotation changes are computed at parse time, not render time, so this would be hard.
thanks for your help MtnViewJohn, now i see why my code was displaying a white image.
Anyway, i don't know how will help the random number syntax you proposed, as i understand the color, size and rotation does not affect the unfinished shapes queue.
rule SCENE {
SQUARE { hue <100:150> sat <-0.5:1> b <0:1> alpha <-0.9:0.5> s <0.7:1> <0.5:1> r <-3:3> }
SCENE { x -0.25 y -0.25 s 0.5 alpha -0.2}
...
But this would be very hard and it is a point solution for your problem.
I fixed the stack-ordered shape expansion code and it was able to generate a 1000x1000 image in 3 minutes on my 1.8GHz Pentium M. The unfinished shape stack never had more than 25 shapes in it, down from ~10 million in the queue-ordered case. I think that giving people the ability to use the stack-ordered expansion algorithm might be a good feature to add to CFDG/Context Free. But it is very easy to get in an infinite loop with the stack algorithm, so we will need to put in some safeguards.