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
Given a file named maze1.txt whose contents is 1 0 2 2 1 2 3 0 3 2 2 1 2 0 2 2 3 0 1 1 3 1 0 0 2 0 3 0 0 1 2 0 3 2 2 0 1 2 3 2 1 0 0 1 1 0 0 0 your program when run as a.out

Complete the following program to move a value of 0xFFH to PORTB LIST p=18f4550 #include org 0x0000 movlw 0x00 _________ movlw 0xFF movwf PORTB end .

You will be working on creating both a realistic project environment and on adding new features to a simple shell implementation provided in shell.tar.z. After you un-tar it, let's

Explain, in your own words, how web designers can deal with CSS conflict resolution. What is the order of precedence between the different types of CSS (inline, embedded and extern

analyse the information need in the different functional area in any organization

Lazytown Constabulary are concerned that young people in the town are unaware of the sorts of crime that they might encounter in their daily lives and are concerned that they may b

Extend the AirRaid game, so that the planes drop a bomb on the gun as they go over it. The gun has to move out of the way otherwise it will be destroyed if hit. Provide three lives

I have assignment about python language . Could you helpe me to built it

Write three functions, statistics, average, and sD as follows. The statistics function returns no value and has six parameters: four scores followed by their average and standard d

What are the string data transfer instruction in assembly language? Explain all types of string data transfer instructions with examples of each? What will be the behavior of direc