'Check two consecutives parameters in prolog

I need to write a predicate in Prolog that given a list that return false if there are 2 consecutive '/', otherwise it returns true. This is what I've done so far, it works only in certain cases. For what I can see it works correclty only if the list has an even number of elements.

t([]) :- !.
t([X, Y | Xs]) :- 
    X \= '/',
    Y \= '/',
    !,
    t(Xs).
t([X, Y | Xs]) :-
    X \= Y,
    t(Xs).

Could you please help me?

Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source