[mercury-users] pragma memo and failure determinism
    Peter Hawkins 
    hawkinsp at cs.stanford.edu
       
    Wed Jul  5 01:41:57 AEST 2006
    
    
  
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.
>> 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.
Incidentally I just saw this exception when trying to build the  
following test program:
Uncaught Mercury exception:
Software Error: table.m: Unexpected: table_gen_transform_proc:  
minimal semi
Stack dump not available in this grade.
:- module test.
:- interface.
:- implementation.
:- pred foo(int::in).
:- pragma minimal_model(foo/1).
foo(_) :- fail.
Cheers,
Peter
--------------------------------------------------------------------------
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