[mercury-users] Solver types and \=

Peter Stuckey pjs at cs.mu.OZ.AU
Fri Aug 12 14:09:01 AEST 2005


On 12/08/2005, at 1:06 PM, Ralph Becket wrote:

> Peter Schachte, Friday, 12 August 2005:
>>
>> I don't think it's the execution model, it's the assumption that
>> anything not free is ground.
>
> That is part of the implicit execution model: one of the key reasons 
> for
> having the mode system is so we don't have to suspend on certain
> operations until a particular argument happens to become bound.
>
>> Anyway, disallowing \= for any inst
>> variables seems wrong, because disequality constraints are perfectly
>> sensible.  Forbidding the most obvious expression of disequalities is
>> unneighborly when there's a reasonable way to allow them (ie, allowing
>> the solver writer to specify the method).
>
> Most solvers that I've seen don't support disequality.
>
> It would be nice if this all just worked, but right now we don't know
> how to make CLP code work transparently in negated contexts without
> totally changing the execution model and without crippling distributed
> fat for non-CLP programs.

\= should be considered a separate predicate from = and have a default
implemetation for ground times of not(=). This would mean that code 
would always
be correct. It makes classes a bit tricker though

:- pred alldifferent(list(T)) <= neq(T).
alldifferent([]).
alldifferent([X|Xs]) :-
	notin(X,Xs),
	alldifferent(Xs).

notin(X,[]).
notin(X,[Y|Ys]) :-
	X \= Y,
	notin(X,Ys)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Peter Stuckey.vcf
Type: text/directory
Size: 524 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20050812/9221bcba/attachment.bin>
-------------- next part --------------



More information about the users mailing list