[m-dev.] cc_multi bug

Ralph Becket rafe at cs.mu.OZ.AU
Tue Jan 18 16:02:33 AEDT 2005

Ian MacLarty, Tuesday, 18 January 2005:
> :- pred p(int::out) is cc_multi.
> p(1).
> p(2).
> :- pred q(int::in, int::out) is cc_nondet.
> q(X, Y) :-
> 	p(Y),
> 	X > 0.
> However if I swap the goals in the conjunction in the body of q/2 around
> it compiles fine.
> Is this a known issue or should I log a bug?

Wellllll, it's a feature.

Goal scheduling tries to reorder as little as possible, so it
immediately schedules the call p(Y).  The next subgoal, X > 0, however,
can fail, but you're not allowed to backtrack into a cc goal so the
compiler reports a determinism error.

A better scheduling algorithm may be feasible if we get constraint-based
mode analysis to run quickly enough.

-- Ralph
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list