Re: Is it a bug?

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Tue 25 Sep 2001 11:27:54 AM GMT
Message-ID: <3BB06A3A.5268A4EA@icparc.ic.ac.uk>
Anthony Karageorgos wrote:
> ...
> Is it a bug, or I am doing something wrong?
> ...
>
> ctest([],[]).
> ctest(RL,[[Has,Plays]|Agent]) :-
>     alloc_role_set([Has,Plays],RL),
>     subtr_role_set(RL,[Has,Plays],Rnew),
>     ctest(Rnew,Agent).
> 
> alloc_role_set([Has,Plays],RL) :-
>     minlist(RL,RLmin),
>     maxlist(RL,RLmax),
>     intset(Has,RLmin,RLmax),
>     intset(Plays,RLmin,RLmax),
>     Has includes Plays.               % All B sets must be subsets of the

What happens is that when you backtrack into the 2nd clause
of ctest/2, RL is a variable, not a list. This leads to the
call to minlist/2 to fail because it expects a list (it should
better raise an error, we'll change that).

It works if you simply rewrite alloc_role_set/2 as follows:

alloc_role_set([Has,Plays],RL) :-
	RL includes Has,
	Has includes Plays.


-- 
 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 Tue Sep 25 12:29:11 2001

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