[m-dev.] for review: new version of accumulator introduction algorithm

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jan 15 17:06:56 AEDT 2000


On 15-Jan-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> On 15-Jan-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 13-Jan-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> > > library/list.m:
> > >     Add the law
> > >     :- promise all [L,H,T] ( L = [H|T] <=> list__append([H], T, L)).
> > 
> > Hmm, shouldn't that be
> > 
> >      :- promise all [L,H,T] ( list__append([H], T, L) <=> L = [H|T] ).
> > 
> > ?  I know that logically these two are the same, but as Lee (?)
> > pointed out, for rewrite rules the compiler also needs some hint
> > about which side is more efficient, and traditionally rewrite
> > rules replace the LHS with the RHS rather than vice versa.
> > 
> Good idea.
> 
> However, I thought that we were going to use a different syntax for
> rewrite rules, something like
> 
> :- promise list__append([H], T, L) == L = [H|T].

Yes.  But since we don't support that yet, in the mean time
it would IMHO still be a good idea to swap the order
(and perhaps to add a comment).

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