[m-dev.] from [mercury-users] Re: Question regarding determinism

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Sep 21 13:51:31 AEST 1998


On 20-Sep-1998, Peter Schachte <pets at cs.mu.OZ.AU> wrote:
> On Fri, Sep 18, 1998 at 06:01:42PM +1000, Fergus Henderson wrote:
> > If mode inference is to work, then mode analysis has to be done top-down
> > (at least unless you change the mode analysis algorithm drastically).
...
> > This is a good argument for keeping these two phases separate ;-)
> 
> Not as good an argument as you might think.  You can still do them
> together if the analysis is a dependency analysis.  First you compute,
> bottom-up, which modes are possible for each predicate and what the
> determinism would be for that mode, without committing to generating
> code for any particular mode.  You want a representation for the set
> of possible modes other than a simple list, something along the lines
> of
> 
> 	if X and Y are ground, then Z will be too, and the spine of
> 	either X or Z must be determined at call time; if the spine of
> 	X is determined on call, the call is at worst semidet; if at
> 	one of X and Z are free on call, the call is det
> 
> would describe append/3.

Like I said, unless you change the mode analysis algorithm drastically...

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list