Basically I planned on getting the first three elements and also the last three and then concatenate them together. This has been a hassle. I know something like this first([A, B, C|_]) can help me get the first three. apart from this I am completely stuck. I am a noob at prolog, please help.
Given a relation first_last(L1, L2),
when I write something like first_last([1,2,3,4,5,6,7,8,9], L2) . where L2 is the resulting list, i should get L2 = [1,2,3,7,8,9]