Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p(E,L):-L=[X|Y],
- E=X.
- p(E,L):-L=[X,Y],
- p(E,Y).
- inserting(E,L,Result):-
- Result=[E|L].
- inserting(E,[H|T],Result):-
- inserting(E,T,Result2),
- Result=[H|Result2].
- deleting_first(E,[H|T],Result):-
- E=H,
- Result=T.
- deleting_first(E,[H|T],Result):-
- deleting_first(E,T,Result2),
- Result=[H|Result2],!.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement