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

Peter Ross petdr at cs.mu.OZ.AU
Sat Jan 15 16:15:49 AEDT 2000


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

Of course the rewrite rule should imply the original assertion.

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