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
Use recursion to de ne a function position which has as input an integer, a character and a string and returns the result of inserting the character in the string at the position s

Develop a Windows Forms Application by creating a new project named "xxxxxxxx" in a new folder named "xxxxxxxxas3" where xxxxxxxx is your student id. You should delete file(s) with

1. Write a program that figures out how long it will take to pay off a credit card by making payments of $10 each month. Take care to avoid infinite loops. (How would a bank preven

Windows Communication Foundation The Microsoft windows Interaction or communication foundation (or WCF), formerly known as "Indigo", is an application selection program (API) in th

Expertsmind.com is expert in java assignment help JAVA Virtual Machine A Java exclusive device or java virtual machine (JVM) is an exclusive device able of undertaking Jav

The last matrix operation which we'll see is matrix multiplication. Now there we will start along with two matrices, A nxp and B pxm . Remember hat A must have similar number of c

specify the function of the instruction and also specify whether its right or wrong-: (5) 1) MOV [BX],AX? Register Indirect addressing 2) MOV CX,[BX+DI]?Base plus index add

How does a program provide "input" to one of its functions?

Question 1 What is CISC & RISC? Explain their addressing modes Question 2 Discuss the following- Design Specification of Assembler Design of Single Pass Assembler

The program presents mainframe contains two button new user, existing user PART ONE: CLICKING ON NEW USER New window appear contains: text field represent username,