Christian de Sainte Marie wrote: > > You may also try to compute all the factorials until the memory is > full by asking :- factorial(?in ?out) to your LP system, no? > Similarly, you might compute the factorial of 4 with your PR engine by > executing step by step, checking after each cycle if you have your > answer and stopping when you have it. > Good points. In prolog, I could add the builtin predicate "novar(?in)" as the *first* predicate in the recursive factorial rule body to avoid the infinite loop. :- factorial(?in ?out) would just return with no answers. Good for a prolog dialect. I'm not sure how I would convey the need to execute step by step to a PR engine, though. BTW, is "novar" a builtin, a constraint, or could never be in CORE because it is too operational? I'm thinking something like "novar" could be a hint that a translation to PR had better be careful, lest it attempts to generate too many facts.Received on Tuesday, 19 December 2006 23:08:29 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:33:34 GMT