Re: number of delayed goals

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Mon 15 Jul 2002 11:08:33 AM GMT
Message-ID: <3D32AD31.BF813E8@icparc.ic.ac.uk>
Alexander Pretschner wrote:
> 
> I don't understand the reason for the second element that is
> returned by delayed_goals/2, however:
>   [eclipse 4]: X#=Y+Z,delayed_goals(X,D),length(D,DL).
> 
>   Y = Y{[-10000000..10000000]}
>   Z = Z{[-10000000..10000000]}
>   X = X{[-10000000..10000000]}
>   D = [fd_eq([0, 1 * X{[-10000000..10000000]}, -1 *
> Z{[-10000000..10000000]}, -1 * Y{[-10000000..10000000]}]), fd_eq([0, 1 * X, -1 * Z, -1 * Y])]
>   DL = 2
>   Delayed goals:
>         0 + X{[-10000000..10000000]} - Z{[-10000000..10000000]} -
> Y{[-10000000..10000000]}#=0


It is better to use the newer predicates suspensions/1,2 instead
of delayed_goals/1,2. They will not return duplicates.
You can then use get_suspension_data/3 to obtain the actual goal:

[eclipse 2]: X#=Y+Z, suspensions(X,D), D=[S], get_suspension_data(S,goal,G).

Y = Y{[-10000000..10000000]}
Z = Z{[-10000000..10000000]}
X = X{[-10000000..10000000]}
D = ['SUSP-_511-susp']
S = 'SUSP-_511-susp'
G = fd_eq([0, 1 * X{[-10000000..10000000]}, -1 * Z{[-10000000..10000000]},
	-1 * Y{[-10000000..10000000]}])



> If, as in my case, the task is to reconstruct goals
> from constraints in the store, 

I would recommend against this approach, because a constraint
solver is in principle free to transform the original
constraint into whatever goals are necessary to implement it.
There is in general no one-to-one mapping of constraints and
delayed goals (often there are several delayed goals working
to implement one constraint in the source). In other words,
Eclipse does not normally maintain a "constraint store", and
trying to reconstruct constraints from delayed goals is
not always possible.

-- 
 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 Jul 15 12:08:41 2002

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