[m-dev.] is this a solver bug?
Ralph Becket
rafe at cs.mu.OZ.AU
Thu Jul 7 13:48:48 AEST 2005
Peter Schachte, Thursday, 7 July 2005:
> Hi all,
>
> I'm enclosing a test file that gives a mode error when compiling, but
> I don't think there's a mode error, or at least I don't think the
> error is what is claimed. It involves impurity, existential types and
> automatically-generated solver type cast functions. The code in
> question is:
>
> :- pragma promise_pure(delayed/2).
> delayed(F, V0) = V :-
> impure Ref = 'representation of any dvar/1'(V0),
> impure new_reference(unbound([func1(F,Ref)]), DV0),
> impure V = 'representation to any dvar/1'(DV0).
I would say the problem was that func1 here should be 'new func1'
because this is a construction of a value with an existentially
quantified type.
>
> The error message I get is:
>
> bug.m:047: In clause for `delayed(in, in) = out':
> bug.m:047: in argument 1 of call to function `bug.representation to
> any dvar/1/1':
> bug.m:047: mode error: variable `DV0' has instantiatedness `free',
> bug.m:047: expected instantiatedness was `ground'.
This error message is not very helpful, agreed...
-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list