I found inconsistency in behavior in the GNU Prolog predicate (version 1.4.2) delete/3:
| ?- delete([a,b,c], b, R).
R = [a,c]
yes
| ?- delete([(a,_), (b,_), (c,_)], (b,_), R).
R = [(a,_),(b,_),(c,_)]
yes
| ?- member( (b,_), [(a,_), (b,_), (c,_)] ).
true ? ;
no
| ?- select((b,_), [(a,_), (b,_), (c,_)], R).
R = [(a,_),(c,_)] ? ;
no
| ?-
All the above results I expected, except those that delete([(a,_), (b,_), (c,_)], (b,_), R).. If you run the same set of requests in SWI Prolog, for example, delete([(a,_), (b,_), (c,_)], (b,_), R).gives R = [(a,_), (c,_)], as I would expect.
My question is, is this expected based on a specific “interpretation” of the predicate delete/3, or could it be a bug in GNU Prolog?