Anomaly in the GNU Prolog `delete / 3` predicate?

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?

+4
source share
1 answer

delete . , ? , , , ?

, , , delete/3 ( , , ). :

http://www.gprolog.org/manual/gprolog.html#sec213

, delete/3. , . , Prolog. , .

+4

All Articles