[m-rev.] diff: reset contains_trace_goal if necessary
Mark Brown
mark at csse.unimelb.edu.au
Thu Nov 9 13:31:34 AEDT 2006
On 08-Nov-2006, Peter Ross <pro at missioncriticalit.com> wrote:
> Imagine we have a program.
>
> p(X) :-
> q(X),
> s(X).
>
> q(X) :-
> trace(..),
> r(X).
>
> Now imagine the compiler determines q(X) and r(X) don't actually need
> to be called.
> The behaviour of the program with respect to the trace goals will
> depend on whether or not inlining is done before or after unnecessary
> code removal.
According to the reference manual (last paragraph of sec 16) the call
to q/1 can be optimized away. The presence of the trace goal in the
clause for q/1 shouldn't hinder this optimization.
Cheers,
Mark.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list