Blame view

fz/util.pl 462 Bytes
554238da   Salvador Abreu   new file: list an...
1
2
3
4
5
% == No, Emacs this is -*-Prolog-*- code, not what you thought... =============

% -- utility predicates -------------------------------------------------------

% -- subset (SUB, SET, REST) --------------------------------------------------
118f3ac4   Salvador Abreu   whitespace cleanup
6

554238da   Salvador Abreu   new file: list an...
7
8
9
10
11
12
subset(L, L, []).
subset(S, [H|T], R) :- subset_aux(T, H, S, R).

   subset_aux(S, R, S, [R]).
   subset_aux([H|T], R1, S, [R1|R]) :- subset_aux(T, H, S, R).
   subset_aux([H|T], X, [X|S], R) :- subset_aux(T, H, S, R).
3a811a46   Salvador Abreu   added uniq_name/2.