[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: questions about fd

**From**: |
Daniel Diaz |

**Subject**: |
Re: questions about fd |

**Date**: |
Mon, 22 Oct 2001 10:43:20 +0200 |

First, many things are NOT definitive in this language (thus not documented).
forall:
the idea is to write forall i in lst do i in ...
where l is a variable whose type is l_fdv (a list of fd variables)
trigger on and trigger also on:
normally an constraint is triggered each time one of the indexicals
(min/max/val/dom) is modified.
Using 'trigger on' you can define your own set of variables on which you want
to trigger.
Using 'trigger also on' you can increase the implicit set of triggers with
you own set.
always:
normally a constraint of the form X in r is stopped when X is ground. This is
an optimization.
The idea is r will never update X (i.e. the constraint now will never fail).
For some constraints
this is not true and you should specify 'always' to ensure the correctness.
wait_switch:
waits until a condition is true and executes the corresponding body, e.g. to
define
X = C <=> B (i.e. capture the truth value of X=C in the boolean B):
truth_x_eq_c(fdv X,int C,fdv B)
{
wait_switch
case max(B)==0
start X in ~{ C }
case min(B)==1
start X in { C }
case min(X)>C || max(X)<C
start B in { 0 }
case min(X)==C && max(X)==C
start B in { 1 }
}
Check files _fd.fd in src/BipsFD/ and files _c.c
Hector Palacios a écrit :
>* *
>* I was looking at FD_SINTAX and in the paper.*
>* And I wrote and used one simple new constraint.*
>* *
>* Could you describe the use of the following keywords?*
>* *
>* - forall*
>* - trigger also...*
>* - always*
>* - wait_switch*
>* *
>* Where can use l_fdv (list of fd vars) appart of c funcionts?*
>* The forall, ok. How? (if you can, give me an example)*
>* Any other one?*
>* *
>* Thanks...*
>* *
--
Daniel Diaz address@hidden
http://pauillac.inria.fr/~diaz
gprolog --version 2>&1 | sed -n -e 's/By //p'