Re: propia and the cut

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Mon 23 Jul 2001 12:47:06 PM GMT
Message-ID: <3B5C1CCA.EDC1247F@icparc.ic.ac.uk>
Alexander Pretschner wrote:
> 
> [eclipse 2]:
> suspend((member(X,[1,2,3]),!),1,trigger(t)),schedule_suspensions(t),wake.
> X = 1     More? (;)
> X = 2     More? (;)
> X = 3

This is a bug in the handling of cut when the delayed goal
is one of the constructs that are transparent to cut
(comma, semicolon, implication). It will be fixed in the
next patch.

Apart from this problem, it is in general not a good idea
to delay compound goals like this. It is more efficient to
make an auxiliary predicate and delay that instead.

In your special case, either of the following works fine:

[eclipse 2]: suspend(once(member(X,[1,2,3])),1,trigger(t)),schedule_suspensions(t),wake.

X = 1
Yes (0.00s cpu)
[eclipse 3]: suspend(memberchk(X,[1,2,3]),1,trigger(t)),schedule_suspensions(t),wake.

X = 1
Yes (0.00s cpu)


-- 
 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 23 13:47:38 2001

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