I want to write a prolog program that needs a number to stay between 2 other numbers but to not have a specific number as his neighbour.
For exemple i have the numbers 1,2,3,4,5. I want for number 5 to stay between any other number except 4.
How can i do that?