Q:

Write a skip predicate

someone asks a question about Prolog, But I even don't know what does he mean can someone explain to me??
?- Forskip([1,2,3,4,5],[3],L).
L=[4, 5].
?- Forskip([c,3,6,hello,6,7,z],[6,c,a],L).
L=[3, 6, 7, z]. 

can someone see the pattern and explain to me what does Forskip does???

A:

First, predicate names are atoms but Forskip is a variable. I assume a typo in your sample calls?
The predicate seems to return the two list elements in the first list that follows any element in the second list. In the first case, the two elements after 3 are 4 and 5:
?- forskip([1,2,3,4,5],[3],L).
L=[4, 5].

In the second sample call, after c follows 3 and 6 and after 6 follows 7 and z:
?- forskip([c,3,6,hello,6,7,z],[6,c,a],L).
L=[3, 6, 7, z].

An implementation of the forskip/3 predicate that allows to reproduce the results above is:
forskip([], _, []).
forskip([Element| Elements], Markers, Results) :-
    (   member(Element, Markers) ->
        Elements = [Element1, Element2| RestElements],
        Results = [Element1, Element2| RestResults],
        forskip(RestElements, Markers, RestResults)
    ;   forskip(Elements, Markers, Results)
    ).

But it should be noted that the two sample calls are not a specification. E.g. what should be the result when after a marker there's only a single element left?

