Hi Olivier, On Mon, Nov 19, 2001 at 11:58:04AM +0000, Olivier Thirifay wrote: > Hello, > > I would like some information about #\/... > > I execute the following predicate : > test(R):-R=[A,B,C], > A::[0,1], > B::[2,3], > C::[4,5], > (A#=0 #/\ B#=2 #/\ C#=4)#\/(A#=1 #/\ B#=3 #/\ C#=5), > labeling(V). > > It gives no result : why ? > When I trace, I can see : > 0#=0 #/\ 2#=2 #/\ 4#=4)#\/(...) > Why it doesn't return true (like when I use ';' instead of '#\/') ? When reporting a problem, please tell us the version of ECLiPSe you're using and give a transcript of the session showing the problem (i.e. showing the exact queries entered and the output). Preferably also report the operating system used, whether you were using TkECLiPSe or the command-line version, and anything else which may be relevant. If we cannot reproduce the bug, we cannot help you. Did you really mean `V' to be the argument to labeling/1? It doesn't appear anywhere else in your predicate, and ECLiPSe should have given you a warning to that effect. This may explain what you are seeing, depending upon what you mean by "no result" (older versions of ECLiPSe will unify V with the empty list, and on backtracking give an intantiation fault; newer ones have an explicit check to make sure labeling/1 is given a list and report a type error right away if it's a variable). > If there's a difference between #\/ and ; Yes there's definitely a difference between these two; the latter makes a choice right away (meaning that if the wrong choice is made the computation has to come all the way back to this point to try the other), while the former delays the "choice" until it knows enough to rule one out. > is there a difference between #/\ and , (I think no after reading the > documentation) ? There is essentially no difference between these two at the top level, but you can't use `,' inside a constraint expression. (E.g. in your example, you can't write `(A #= 0, B #= 2, C #= 4) #\/ (A #= 1, B #= 3, C #= 5)'.) Cheers, WarwickReceived on Mon Nov 19 13:55:04 2001
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:11 PM GMT GMT