multi vs nondet event sequences

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Fri Sep 18 11:52:25 AEST 1998


Hi,

> 
> > This rather strange to see a multi proc failing since it is supposed not
> > to fail. Isn't that a bug in the tracer ?
> 
> No, this is not a bug in the tracer, or in the code generator.
> 
> "This rather strange to see a multi proc failing since it is supposed not
> to fail" indicates a misconception. A multi proc is not supposed to fail
> *without first producing a solution*. Once it has produced that solution,
> and possibly other solutions, the multi proc is allowed to fail, and
> must fail if it has no more solutions. The only difference between nondet
> and multi is that multi promises at least one solution before failure.
> 
> Zoltan.
> 

This can be easily explained in terms of the Opium specification
also.  Mireille's JLP paper contains a grammar for event sequences
(for a particular call sequence number).  This grammar is intended
for Prolog, but the first two rules also apply to Mercury's nondet
model.  They are:

	Goal_Events	::= call Contd

	Contd		::= Direct_Failure
			|   Direct_Proof
			    Proof_On_Backtracking*
			    [Fail_On_Bactracking]

where Direct_* is a sequence leading from the call port to the exit
or fail port, and *_On_Bactracking is a sequence leading from the
redo port to the exit or fail port.

The difference between nondet and multi is that multi goals
will not have a Direct_Failure sequence of events.

Hope this helps,
Mark
-- 
Mark Brown  (dougl at cs.mu.oz.au)           |  Let's talk about tax, baby
MEngSc student,                     )O+   |  Let's talk about GST
Dept of Computer Science                  |  Let's make a wider gap twixt
University of Melbourne                   |  Affluence and po-ver-ty ...



More information about the developers mailing list