Kish Shen wrote: > mauricio montecinos wrote: > >> Actually, I wanted to calculate the number of times that the algorithm >> attempts assigns a value to a variable and the constraint propagation fails, >> because the domains of non-instantiated variables are filtered and some >> domain becomes empty then a next value is tried. > It sounds like you want something like this: my_indomain(Var, [V|Vs]) :- ( Var = V, % try assigning the value true % this is where the constraints wake up and may fail -> true % no failure happened ; % assignment+propagation failed! % count only if there are still other values in the domain ( Vs == [] -> true ; incval(count) ), fail ). my_indomain(Var, [_|Vs]) :- my_indomain(Var, Vs). -- JoachimReceived on Tue May 12 2009 - 04:19:15 CEST
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST