Matching tasks with lists
To get a feeling for how the different list representations work, ask some matching queries involving lists and try to understand why Prolog answers the way it does. For example,
.(a,.(b,.(c,.(d,[])))) = [a|[b|[c|[d|[]]]]].
.(a,.(b,.(c,.(d,[])))) = [a,b,c,d].
[a,b,c,d] = [a|[a,b,c]].
[a,b,c,d] = [Head|Tail].
[a,b,c,d] = [a|X].
[a,X] = [a|[a,b,c]].
[a,b,c,d] = [a,b|[c,d]].
[a,b,c,d] = [X,Y|_].
[] = [[]].
[X] = [[]].