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
In this assignment you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application. You

I am getting error at business layer object in code behind page.

find value of nCr using function

One of the main strengths of the Perl programming language are its powerful text manipulation features. In this assignment, you will put them to use for writing a Perl program tha

What is JVM-Java Virtual Machine  A JVM stands for java virtual machine. This is virtual computer or an abstract computer that runs the complied java programs. In fact JVM is

Pascal program: Exactly what you need to do to generate your empirical data is specific to your individual assignment. However, some rules apply to all of you: 1. The gener

#question. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Description: *

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 flowchart and program to do the following: A pressure sensor in a cooling system measures the pressure of the refrigerant and is connected to Port -1 of the 8051. If th

Figure is a representation of the solar system. In a basic model of the same concentric orbits planets rotate around the sun. The closer the Planet in less time Sun completes a ful