it seems easy...

From: gai luron (gai_luron_at_oplacha.novalid)
Date: 05/16/04


Date: Sun, 16 May 2004 16:26:12 +0200


... but I can't write my predicate.

%% box operator
:- op(720,xfy,box).
%% list box operators of the first list in the second one
list_mod_ops([],[]) :- !.
list_mod_ops([R box _ | Cdr],[R|Boxes]) :-
         \+ member(R,Boxes),
         list_mod_ops(Cdr,Boxes),!.
list_mod_ops([_|Cdr],Boxes) :-
         list_mod_ops(Cdr,Boxes).

Suppose I have a list of "things", I am interesting in things matching
with (R box A) and I want to list all the appearing R. I'm not sure it
is well explained.

I would like :
list_mod_ops([a,b,c],[]) -> true
list_mod_ops([2 box e, 7 box b, j, 2 box y], [2,7]) -> true

Does somebody can help me?