Subject: Re: goal_expansion/2

From: Jan Wielemaker <[email-masked]>
Date: Mon, 26 Mar 2001 09:53:48 +0200

On Sun, 25 Mar 2001, you wrote:
>Dear Jan,
>
>what is the deeper reason that goal_expansion/2
>is applied repeatedly (as long as it triggers)?
>I mean suppose I want to replace a by a,nl, should
>I use something else for that purpose (so that
>expansion will not loop)?

If you write

goal_expansion(x, w).
goal_expansion(z, (x,y)).

you get the expected (w, y) for z.  Otherwise you'd
had to write:

goal_expansion(z, (X, Y)) :-
	expand_goal(x, X),
	expand_goal(y, Y).

Agreed the expansion you want is hard to realise, in
fact the only way would be to define another version
of goal-expansion using term_expansion.

The current behaviour however is consistent to SICStus,
which also goes into a loop expansing a to a,nl.

	--- Jan