[m-dev.] [for review] vqueens.m fix

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Wed Jul 12 10:00:56 AEST 2006

Dear all,

I've enclosed the diff -u for fixing the trailed_update sample vqueens.m.  The
new version now compiles and gives the same answer as listed in

The previous version did not compile, as the old module attempted to bind
an any variable to a constraint dependent on another any variable (actually
against a list of any variables).  It appears var.m does not have 
the machinery to allow this.

I'm not happy with the compromise I did: safe/1 is now gone, and I constrain
the any variables against the already just-grounded ones.  The reason why I'm not
happy with this is now I don't have a way to write constraints on a pair of
dependent any variables with var.m, and I hoping that would be possible.  So
now I don't know how to implement

:- pred var(int)::ia =< var(int)::ia is semidet.

and, e.g., the implementation of all_different(list(var(T)) for var.m types is
so far reduced as to be pointless.  It looks like I've lost most 
the advantages that the constraint-based programming style is advertised 
to give over traditional, plain-jane, logic programming.

Is there a way to write constraints against a pair of dependent any var(T)
types with var.m?  freeze/[2,3] and freeze_var/3 don't seem open to

Doug Auclair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vqueens.diffu
Type: application/octet-stream
Size: 807 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/developers/attachments/20060711/27fb78b4/attachment.obj>

More information about the developers mailing list