Re: Two questions regarding lib(fd).

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Mon 09 Sep 2002 10:50:41 AM GMT
Message-ID: <3D7C7D01.6E1181F1@icparc.ic.ac.uk>
Ole Tranberg wrote:
> 
> I have looked at the "roster.ecl"-example from the ic-parc website. I have tried
> to understand what is going on but there is one confusing clause.
> 
> >From the roster.ecl:
> 
>     try_day_off(X) :- X #= r of shift.
>     try_day_off(X) :- X #\= r of shift.
> 
> Why does this give sense?

Declaratively this is useless, of course. It just says
"X is equal to r, or not".

However, this predicate is used in the search part of the
program, and here the operational behaviour is important:
It _first_ tries to set X to 'r of shift', and only if
this does not lead to a complete solution of the problem,
it tries the other alternative.

The 'ic2' search strategy, where this is used, works like this:
The first phase (ic_col_labeling/2) tries to heuristically label
some variables in the roster to 'r of shift' (using try_day_off/1),
and the second phase uses labelingff/1 to find solution values
for the rest of the variables.


> 
> The other quetion is this:
> 
> What is the difference of '#\=' and '##'? The description is the same:

They are the same. The preferred syntax is #\= .


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc, Imperial College   /            mailto:J.Schimpf@ic.ac.uk
 London SW7 2AZ, UK         /    http://www.icparc.ic.ac.uk/eclipse
Received on Mon Sep 09 11:52:50 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:16 PM GMT GMT