Prolog predicate for list that contains duplicate elements, Programming Languages

Write a Prolog predicate  has_duplicates(L)  that is true if list  L  contains duplicated elements (that is at least 2 copies of an element). For instance:

?- has_duplicates([a,e,b,d,s,e]).
Yes
?- has_duplicates([a,b,d,s,e]).
No
?- has_duplicates([]).
No 

Posted Date: 3/22/2013 5:53:47 AM | Location : United States







Related Discussions:- Prolog predicate for list that contains duplicate elements, Assignment Help, Ask Question on Prolog predicate for list that contains duplicate elements, Get Answer, Expert's Help, Prolog predicate for list that contains duplicate elements Discussions

Write discussion on Prolog predicate for list that contains duplicate elements
Your posts are moderated
Related Questions
We are looking for Pool Services Software Our company Pool Hands LLC is looking to build software for our internal use. We would like the software built therefore that it could

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

An apartment complex has several apartments to rent. The apartments are all similar, and all rent for $750 per month. Currently, all units are occupied. The management, being in bu

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

want to do an image-mean. but image is and mean is so an error showing Error using ==> minus Number of array dimensions must match for binary array op. wat to do?

Im having problems with my php / mysql code. I am trying to make it so it looks for an asset Number and if it is in the shop if the asset is in the database but is not in the shop


Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

I am working on a matlab project and need help debugging one question i have written and need help working through another problem.

You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner (SLLx,SLLy), and the len