Dear all, it seems that ic on the order and kind of the constraints that are used. For example, why does ECLiPSe find the correct answer with "[eclipse 5]" but delays with "[eclipse 7]"? [eclipse 3]: integers([X]), ic:(X #>X). No (0.00s cpu) [eclipse 4]: integers([X,Y]), X #= Y, X #>Y. X = X{-1.0Inf .. 1.0Inf} Y = X{-1.0Inf .. 1.0Inf} Delayed goals: -(X{-1.0Inf .. 1.0Inf}) + X #> 0 Yes (0.00s cpu) [eclipse 5]: [X,Y] :: [0,100], X #= Y, X #> Y. No (0.00s cpu) [eclipse 7]: integers([X,Y]), X#>1, Y#>1, X#<100, Y#<100, X#=Y, X#>Y. X = X{2 .. 98} Y = X{2 .. 98} Delayed goals: -(X{2 .. 98}) + X #> 0 Yes (0.00s cpu) To get failure fast, I could use labeling as follows. Is there a better way? testVariables(Vars) :- setval(test, 0), ( labeling(Vars), setval(test, 1), fail ; true ), getval(test, 1). Thanks, UlrichReceived on Mon Jan 19 2009 - 12:39:19 CET
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET