From 9cce7df45bd07e21654afa98b913334a944fdc7c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 15 Mar 2010 14:18:25 +0000 Subject: [PATCH] output unification should go after cut. --- pl/setof.yap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pl/setof.yap b/pl/setof.yap index 6fb150946..a626b6947 100644 --- a/pl/setof.yap +++ b/pl/setof.yap @@ -122,7 +122,8 @@ bagof(Template, Generator, Bag) :- % The fourth gives the free variables being currently used. % The fifth outputs the current solution. % -'$decide'([], Bag, Key, Key, Bag) :- !. +'$decide'([], Bag, Key0, Key, Bag) :- !, + Key0=Key. '$decide'(_, Bag, Key, Key, Bag). '$decide'(Bags, _, _, Key, Bag) :- '$pick'(Bags, Key, Bag).