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
Advantages of asp.net mvc framework MVC is a conventional style design that many designers are acquainted with. Some kinds of Web programs will advantage from the MVC structur

Before I describe what you are supposed to do, please remember that this programming assignment is NOT a group project. You are NOT allowed to do this with anyone else's help. This

1. Write a program that reads a minimum of three command line arguments and displays the program's results. a. Command Line arguments:  i. The first argument will be the program

Problem Specification I/O programming is the \bread and butter", the raison d'etre, of microcontrollers. After all, our definition of a microcontroller is \a microprocessor wit

Expertsmind brings you unique solution in java assignments I.O streams The Java.io packages contains nearly every category you might ever need to execute feedback and resu

The following are required for this lesson: Complete the Project "Adding New Payments," which is the Karate Payments that includes the Adding New Payments, Deleting Payments,

Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

Create a logical expression that corresponds to the following statement: If you like talking about computers or playing video games at LAN parties, and you want to meet others w

Redundant sequence identification: Given a set of k DNA sequences, S = { s 1, s 2, ... ,  s k } give an optimal algorithm to identify all sequences that are completely contained

We want a program, a logic, we can list the intermediate films sandwiched between the 2 tapes (from - to) that indicates the user. example: From to