Re: [eclipse-users] User defined constraints.

From: Malcolm Ryan <malcolmr_at_...25...>
Date: Tue, 13 Mar 2007 18:30:48 +1100
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  
Humility
Received 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