Question: Write a predicate count in prolog that returns the number of atoms inside a list. It should take count(a,[a,c,d,a,b,a],X) and this should return X =

Write a predicate count in prolog that returns the number of atoms inside a list. It should take count(a,[a,c,d,a,b,a],X) and this should return X = 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!