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
Expertsmind brings you unique solution in java assignments Reflection API Uses of Reflection with java assignment help Reflection is widely used by applications which

Given strings s 1 and s 2 of lengths m and n respectively, a minimum cover of s 1 by s 2 is a decomposition s1 = w 1 w 2 .... wk, where each w i is a non-empty substring of s

1 Real and 2 Complex Eigenvalues    From the real eigenvalue/vector pair, l 1 and ?h 1 e l1 t ?h 1 We find the other two solutions in identical manner which we did

1. Logon to Linux. 2. Create a directory "Unix" under your home directory. Command(s): …………………………………………. 3. Create four sub-directories bin, conf, docs

Create a visualization (programming project) and demonstrate it in the class. The project should be related to distributed systems. (A distributed system consists of multiple auton

I do have an assignment in operating systems programming ... how can i attach my file?

Write a detailed description on how you would go about planning information system for an organisation

How to lunch webcame via viusal studio 2012

Explain the Goto Statement - Computer Programming? The goto statement is employed to alter the normal sequence of program execution by transferring control to some other part o

For this assignment you will use the robot/maze simulation example introduced in mini-assignments 0625ma-0627ma to develop a maze-solving program. The program will read a file cont