[m-dev.] fix for simplify.m

Fergus Henderson fjh at cs.mu.oz.au
Thu Mar 20 01:11:40 AEDT 1997


Simon TAYLOR, you wrote:
> 
> Fix a bug reported by Michael Winikoff which was caused by
> simplify.m not properly initialising the hlds_goal_info
> used in a disj([], SM) - Info.

That change looks good.
I have a couple of remarks.

> -simplify__goal_2(disj(Disjuncts0, SM), GoalInfo,
> +simplify__goal_2(disj(Disjuncts0, SM), GoalInfo0,
>  		Goal, GoalInfo, Info0, Info) :-
>  	( Disjuncts0 = [] ->
> -		Goal = disj([], SM),
> +		fail_goal(Goal - GoalInfo),
>  		Info = Info0

In this case you are leaving the goal unchanged; there is no need to
use fail_goal.  The original code is more efficient.

>  	; Disjuncts0 = [SingleGoal0] ->
>  		% a singleton disjunction is equivalent to the goal itself
> -		simplify__goal(SingleGoal0, Goal - _, Info0, Info) 
> +		simplify__goal(SingleGoal0, Goal - GoalInfo, Info0, Info) 

This change is not described in your log message.
Here you are changing the goal_info used when simplifying a
singleton disjunction; previously the outer goal_info was used,
now the inner one is used.  Are you sure that this will not
cause any problems?

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