Give recursive definition in Prolog: Define a predicate that holds of an argument X if and only if X is a list and the length of X is odd.
I have been trying to solve this for ages. I am just wanting to learn ProLog for myself and found this problem in a book.
I have tried this but it probably only works for lists of even length.
mult2_length( [] ).
mult2_length( [ _, _ | Xs ] ) :-
mult2_length( Xs ).
Can anyone please help me?