[m-rev.] diff: reset contains_trace_goal if necessary
Mark Brown
mark at csse.unimelb.edu.au
Thu Nov 9 15:02:07 AEDT 2006
On 06-Nov-2006, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> @@ -2657,6 +2670,84 @@
>
> %-----------------------------------------------------------------------------%
>
> +:- pred goal_contains_trace(hlds_goal::in, hlds_goal::out,
> + contains_trace_goal::out) is det.
> +
> +goal_contains_trace(GoalExpr0 - GoalInfo0, GoalExpr - GoalInfo,
> + ContainsTrace) :-
> + (
...
> + ;
> + GoalExpr0 = scope(Reason, SubGoal0),
> + goal_contains_trace(SubGoal0, SubGoal, ContainsTrace),
> + GoalExpr = scope(Reason, SubGoal)
It appears that this goal feature propagates outside promise_pure scopes.
I realise this behaviour follows what is in the reference manual, but is
this really what we want?
I think that a goal which is explicitly promised pure should be able to
be optimised away even if it contains trace goals, in the same way that
a pure call can be optimised away even if there are trace goals in its
definition.
Any comments?
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