[mercury-users] Confused about "undefined behaviour" of promise_only_solution

Mark Brown mark at cs.mu.OZ.AU
Mon Nov 29 11:08:13 AEDT 2004

Hi Stefan,

On 27-Nov-2004, Kral Stefan <skral at mips.complang.tuwien.ac.at> wrote:
> I have not yet understood the idea behind the
> cc-modes. Does it all boils down to "Do not care that the 
> program declaratively describes zillions of solutions, or
> indeed does not terminate universally. Just declare 
> everything non-deterministic as CC-nondet/CC-multi, 
> and think of the program exit as some kind of red cut."?

Kind of.  If cc_multi propagates all the way up to main/2, then a nicer
Prolog analogy is that it is like always exiting the program after the first
solution to main and never hitting ";" to request further solutions.  (This
isn't really a red cut, since the solution given is valid in the declarative
semantics of the program and there is no assertion being made that there
are no other valid solutions.)

If it doesn't propagate all the way up to main, then it means that either
the compiler has been able to prove for itself that the cut is green, or
else the user has "promised" that the cut is green.


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