[mercury-users] Again: cc_ problem - what is Context requiring all solutions...

Ondrej Bojar oboj7042 at ss1000.ms.mff.cuni.cz
Wed Sep 5 02:37:35 AEST 2001


Hi.

I got this error:

fstag.m:081: Error: call to predicate `fstag:cc_tagmap/2' with determinism
`cc_nondet'
fstag.m:081:   occurs in a context which requires all solutions.

And the context is:

:- mode my_something(in, out) is cc_multi.

my_something(In, MainOut) :-
  (
    cc_tagmap(In, TempOut),
    % ... make TempOut into Out
  ;
    Out = ok(calculation_skipped_for_whatever_reason)
  ),
  % ... and perform further working on Out here to obtain MainOut...
  % this futher part can never fail

It is fine for me, if cc_tagmap fails, it is fine, if it succeeds as well.
I just do no want to backtrack it, because the ...making TempOut into Out
is too expensive and all possible solutions of cc_tagmap are equal for
this.

Why is cc_tagmap in a context requiring all solutions? It's embedded in
my_something which is cc_ as well.

Thanks for help, Andrew.

P.S.: Are there some examples on determinism? I know only the Language
Reference explanation, but I cannot find any samples in real life (samples
or extras of mercury distribution).


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