Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
is_member(V, [V | _]) :- !.
is_member(V, [_ | T]) :-
is_member(V, T).
delete_element([], _V, []) :- !.
delete_element([V | T], V, T) :- !.
delete_element([V1 | T], V, [V1 | NT]) :-
delete_element(T, V, NT).
delete_by_set(R, [], R) :- !.
delete_by_set(L, [VS | TS], R) :-
delete_element(L, VS, TLR),
delete_by_set(TLR, TS, R).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment