[m-dev.] for review: Aditi [2]

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jul 20 14:51:47 AEST 1998


On 20-Jul-1998, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > > Index: compiler/lambda.m
> > >                  list__append(ArgModes1, Modes, AllArgModes),
> > >                  map__apply_to_list(AllArgVars, VarTypes, ArgTypes),
> > >  
> > > +                ( 
> > > +                        % Pass through the aditi markers for 
> > > +                        % aggregate query closures.
> > > +                        Detism = nondet,
> > > +                        check_marker(Markers, aditi)
> > > +                ->
> > > +                        LambdaMarkers = Markers
> > > +                ;
> > > +                        init_markers(LambdaMarkers)
> > > +                ),
> > 
> > Why only `nondet'?  What about `multi', for example?
> 
> I've changed that to `determinism_components(Detism, _, at_most_many)'

That's an improvement, but I think it is still a bit ad hoc.

Why do you copy across all the markers, whereas the comment
only mentions the Aditi markers?

What happens if an Aditi procedure contains a lambda expression
that is passed to a Mercury procedure?  In that case, it would
not be right to mark the lambda expression as Aditi.
Well, actually that can't happen, but I think the comment
should document why not.

> > > +        % If there are local Aditi procedures enable Aditi compilation.
> > > +:- pred maybe_enable_aditi_compilation(item_status, term__context,
> > > +                module_info, module_info, io__state, io__state) is det.
> > > +:- mode maybe_enable_aditi_compilation(in, in, in, out, di, uo) is det.
> > > +
> > > +maybe_enable_aditi_compilation(Status, Context, Module0, Module) -->
> > > +        { Status = item_status(ItemStatus, _) },
> > > +        ( { ItemStatus \= imported } ->
> > 
> > What about opt_imported predicates?
> 
> We may need to generate RL code for opt_imported predicates if they are
> specialised. If they are not, they are made imported by dead_proc_elim,
> and having aditi compilation enabled will be harmless.

OK.  Please add this as a comment here.

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