I am new to prolog. I am trying to write a predicate that accepts an element and list and checks to see the occurrence of the element in the list and returns the rest of the list after the element.
Example is mypredicate(3, [1 2, 3, 4, 5, 6, 7])
returns [3, 4, 5, 6, 7].
I hope I am able to explain.
mypredicate(X, [X|_]).
mypredicate(X, [_|T]) :- mypredicate(X,T).
This is basically just checking if the element is there in the list. How do I write a rule that returns the rest of the list after X?