Write a prolog predicate has duplicates, 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/28/2013 3:52:19 AM | Location : United States







Related Discussions:- Write a prolog predicate has duplicates, Assignment Help, Ask Question on Write a prolog predicate has duplicates, Get Answer, Expert's Help, Write a prolog predicate has duplicates Discussions

Write discussion on Write a prolog predicate has duplicates
Your posts are moderated
Related Questions
Example problem Imagine that  you  require  to create  a robot  that  will  roll up  close to a light  lamp  and  stop  a fixed distance from it.  The first question is, how w

Draw the sequence diagram for the following scenario of eBroker. Sell Stock The user enters the username and password The system checks that the user is a valid user

Design an application that opens and analyses word files. Requirements: Create an application that analyses text documents. It should open a text file, read each word into an ap

You are asked to develop a replicator (client) that distributes a large job over a number of computers (a server group) on a single switched LAN (our BU04 lab). In this assignment,

Support for Multi-Targeting The multi-targeting function of Vision Facilities allows you specify the particular edition or account of the .NET Structure that is required for your p

What is DOM? The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure an

A psychologist is interested in learning about the voting behavior of college students.  (4 points for each part.)Design a study which would yield data on this topic. a. state y

You are required to develop a program that calculates the charges for DVD rentals, where current release cost RM3.50 and all others cost RM2.50. If a customer rents several DVDs, e

Expertsmind brings you unique solution in java assignments Applet In processing, and the apple company is any little application that works one specific process that works