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
Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

Identifying the Central Individual in a Social Network 1. Introduction You have just been hired by a social networking company! The division you are working in is particul

The last exercise of each assignment will be continuous from assignment to assignment and will have the goal of building an e-store website by the end of the course. For the fir

A partly completed project Cwk 4-students is available for downloading from Studynet Assignments. You are required to amend this BlueJ project to implement a version of the WHEN sy

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

Open error message coming out when compiling

Introduction A search engine (like Google) has three main components: a crawler that finds and stores copies of files on the web, an indexer that creates a data structure that

This assignment is an individual programming assignment using Perl. It addresses objectives 3, 4, 5 and 8 as listed in the Subject Outline document. The assignment is based on them

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

For this assignment you will need to design and construct a basic math program which targets elementary school children. Your program must adhere to the following steps and require