Re: Another little problem



On 26 Feb, 12:08, Nick Wedd <n...@xxxxxxxxxxxxx> wrote:

I think I understand what you mean.

This code is untested and may have errors:

hh( InF, InG, InF, InG ) :-
h( empty, InF, InG ).
hh( InF, InG, OutF, OutG ) :-
h( Z, InF, InG ),
hh( InG, Z, OutF, OutG ).

You call hh with the first two arguments instantiated to your initial F
and G. It instantiates its last two arguments to the F and G that
caused Z to become empty - I assume these are the values you are
interested in finding.

Nick

Thanks Nick, your predicate is great! :)


.