Question: Write a prolog program that will determine the equal integers in two different sorted lists and will form a third list that will consist of

Write a prolog program that will determine the equal integers in two different sorted

lists and will form a third list that will consist of these equal integers.

The predicate that you will implement will be queried as follows:

?-build([1,3,4,6,9,10

1,4,10],). 

=[1,4,10];

No

?-


Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Base case If either list is empty there cant be any common elements build Case where X is in ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!