[m-rev.] For review: State Variables

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jun 28 15:55:17 AEST 2002


On 28-Jun-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Simon Taylor, Thursday, 27 June 2002:
> > 
> > I was talking about if-then-else _goals_, not expressions.
> 
> I beg your pardon.  I'd thought that the scoping rule extending
> outer-most existential quantification in if-then-else expression
> conditions to include the then-expression was an ite-expression specific
> twist.  But I see that I was wrong about that.
> 
> Here's the interdiff:
> 
> diff -u make_hlds.m make_hlds.m
> --- make_hlds.m	25 Jun 2002 06:45:05 -0000
> +++ make_hlds.m	28 Jun 2002 01:24:23 -0000
> @@ -5842,16 +5842,39 @@
>  transform_goal_2(if_then_else(Vars0, A0, B0, C0), Context, VarSet0, Subst,
>  		if_then_else(Vars, A, B, C) - GoalInfo, VarSet,
>  		Info0, Info, SInfo0, SInfo) -->
> +
>  	{ substitute_vars(Vars0, Subst, Vars) },
> -	transform_goal(A0, VarSet0, Subst, A,  VarSet1, Info0, Info1,
> -		SInfo0, SInfoA),
> -	transform_goal(B0, VarSet1, Subst, B1, VarSet2, Info1, Info2,
> -		SInfoA, SInfoB),
> -	transform_goal(C0, VarSet2, Subst, C1, VarSet3, Info2, Info,
> +
> +	{ if A0 = some_state_vars(StateVars0a, A0a) - _Ctxt then
> +		substitute_vars(StateVars0a, Subst, StateVars),
> +		A1        = A0a
> +	  else
> +	  	StateVars = [],
> +		A1        = A0
> +	},

It would be better to be consistent with the way ordinary quantified
variables are handled (parse them in prog_io_goal.m and prog_io_dcg.m).

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list