CLPFD-systems are not primarily targeted to handle quadratic equations efficiently, nevertheless, are there better ways to formulate problems like the following?
It seems the problem boils down to equations like the following. SWI with library(clpfd)
gave:
?- time( ((L+7)^2#=L^2+189, L in 0..10000000) ). % 252,169,718 inferences, 87208.554 CPU in 87445.038 seconds (100% CPU, 2892 Lips) ERROR: Out of local stack
But now the latest version in SWI gives
?- time( ((L+7)^2#=L^2+189, L in 0..10000000) ). % 3,805,545,940 inferences, 868.635 CPU in 870.311 seconds (100% CPU, 4381063 Lips) L = 10.
and in SICStus 4.3beta7 I get:
| ?- statistics(runtime,_). yes | ?- (L+7)*(L+7)#=L*L+189, L in 0..10000000. L = 10 ? ; no | ?- statistics(runtime,[_,T_ms]). T_ms = 2550 ? ; no