On 13/03/2007, at 4:26 AM, Joachim Schimpf wrote: > Malcolm Ryan wrote: >> I'm trying to do reasoning about graphs using a CLP in Eclipse. I worked out the following solution: adjacent(From, To) :- domain_list(From, FromDomain), domain_list(To, ToDomain), outgoing(FromDomain, Outgoing), incoming(ToDomain, Incoming), From &:: Incoming, To &:: Outgoing, (ground(From), ground(To) -> true ; % suspend doesn't work properly on ic_symbolic symbol_domain_index(From, _, F), symbol_domain_index(To, _, T), suspend(adjacent(From, To), 2, [F,T]->constrained) ). > An easy and quite efficient way to do this is to use the > "Generalised Propagation" library lib(propia). ... > adjacent(X,Y) :- > edge(X,Y) infers ic. > Wow, that's much simpler than my solution. How does it work? The documentation on lib(propia) is very sparse. Malcolm -- "The act of defending any of the cardinal virtues has today all the exhilaration of a vice." - G.K.Chesterton A Defense of HumilityReceived on Tue Mar 13 2007 - 07:31:02 CET
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST