Question: SWI-Prolog Question 3 1. Using thesign and the prolog list syntax to explicitly unify variables with parts of a list, write a prolog query that
SWI-Prolog

Question 3 1. Using thesign and the prolog list syntax to explicitly unify variables with parts of a list, write a prolog query that displays the head and tail of the list [1 2. 3. Write a prolog rule contains1' that returns true if a given element is the first 4. Write a prolog rule contains2 that returns true if a given list is the same as the tail 5. Similarly, use a nested list to display the head of the list, the head of the tail of the list and the tail of the tail of the list [1 ,2,3,4,5]. element of a given list. of another given list. Write a prolog query using 'contains1' to display the first element of a given list. [1 mark each]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
