Hi Jesper, :- Cities =.. [cities|[X,Y,Z,X]] sets Cities = cities(X,Y,Z,X) which has four arguments. Then if I write :- MyCity is Cities[3] MyCity becomes (unified with) Z. dist(Term1,Term2,Dist) does three things: * it evaluates the terms, extracting the underlying variable (thus Cities[3] evaluates to Z) * it admits either order of the cities (because the data only records one of the two directions between each pair of cities) * it turns the test (c(X,Y,D) ; c(Y,X,D)) into a constraint through the annotation "infers ac". (This stops ECLiPSe from making a choice within the test: the test is only used to narrow the domains of the variables) Perhaps Milano and Focacci do the nearest thing to a comparison: See Proc. CP'99 (LNCS 1713), "Cost-Based Domain Filtering, pp189-203 (esp pp197-198) Cheers Mark -- _______________________________________________________________ Dr. Mark Wallace, IC-Parc, Phone +44 (0)20 7594 8434 William Penney Laboratory, Fax +44 (0)20 7594 8432 Imperial College, London SW7 2AZ, UK. Email: mgw@icparc.ic.ac.ukReceived on Thu Jan 02 19:51:39 2003
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:20 PM GMT GMT