[mercury-users] Doing input with determinism cc_multi

Kral Stefan skral at mips.complang.tuwien.ac.at
Wed Jan 5 22:46:59 AEDT 2005


On Wed, 5 Jan 2005, Ralph Becket wrote:
> Kral Stefan, Tuesday,  4 January 2005:
> > [...]
> > io__read looks like a very convenient way, but it only 
> > works when I declare main as det (which is something I can not do).
> > [...]
> You need to show us the code and the error message.  There shouldn't be
> any trouble mixing IO and cc_multi code.  The only constraint you have
> with cc modes is that you can never backtrack into a cc goal.
I tried again, and alas, it works!  I'm sure I got some spurious
compiler error message yesterday, but I can not quite pinpoint
what is was (should have saved the log file of my shell).

After reading your explanation, my best guess is that I had 
some IO-calls between the call of a non-deterministic predicate <X>
and some det predicate <Y>, something like (<X>,<IO>,<Y>).
Actually, the call to <Y> could fail because of some implicit
unification. I was irritated because calls to <Y> would always
succeed in practise, while the compiler must have gotten the 
impression that my code could try to backtrack over IO!

Thank you for your help.

Best Regards,
Stefan.

--------------------------------------------------------------------------
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