[mercury-users] pragma memo and failure determinism

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Jul 5 18:19:44 AEST 2006


On Tue, 4 Jul 2006, Peter Hawkins wrote:

> Hi...
> On Jul 4, 2006, at 4:37 AM, Julien Fischer wrote:
> >> While I admit tabling a predicate with failure determinism is a
> >> stupid thing to do, the mercury program I'm compiling is the output
> >> of another compiler which doesn't do its own determinism inference
> >> and doesn't know that Mercury will infer the determinism failure for
> >> this predicate. The other compiler blindly puts pragma minimal_model
> >> declarations on everything.
> >
> > I assume that you meant pragma memo there.
> >
>
> No, I mean minimal_model. The error message is slightly misleading,
> but I assume it's talking about the general class of memoing
> declarations.

No, in that case it's a bug in the error message.  I'll take a look at
it.

> >> Would it be possible for this error to
> >> become a warning instead, and have Mercury ignore the pragma memo
> >> declaration in this case?
> >
> > No, it as an error and by default the compiler should treat it as
> > such.
> > It would be possible to add an option that did what you wanted but I'm
> > not sure that such a thing is generally applicable (beyond scratching
> > your particular itch.)
>
> Well, it's not a very fatal error -- there's a very sensible error
> recovery behaviour. It is completely harmless to ignore the tabling
> declaration in this case. I can't leave minimal_model declarations
> off in general, since the program won't terminate without them. And I
> don't know where to leave them off, since I don't know any of the
> determinisms in advance duplicating a pass of the Mercury compiler.

I certainly don't support changing the behaviour where there is an
explicit predicate or function declaration whose determinism is failure.
We could add an option, something like `--ignore-inferred-failure-tabling'
that ignores tabling pragmas on procedure whose determinism is inferred to be
failure.

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list