1

Closed

arbitrary infinite loop

description

I have a custom generator which appears to go into an infinite loop between the suchThatOption let binding in Gen.fs and stdRange / stdNext in Random.fs about half the time, and works successfully about half the time. Does this sound like a known issue?
Closed Dec 17, 2012 at 5:19 PM by kurt2001
Interesting case - there is a warning that an infinite loop can happen if a suchThat does not get "enough" good values, but if you are generating a generator, then it indeed becomes more meta than that :)

comments

jackfoxy wrote Dec 17, 2012 at 4:42 PM

I solved the situation. after posting this. I was generating one of the parameters in my custom generator without constraints, and it was possible to generate this parameter so that a subsequent suchThat constraint would be impossible to solve. My back of the envelope calculation predicts this situation should occur in nearly half the runs, which was consistent with my experience.

I think somewhere in the documentation it may mention this situation, but now I have proven for sure if a custom generator can generate unsovleable combinations it will loop.