Write a prolog predicate has duplicates, Programming Languages

Assignment Help:

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

 


Related Discussions:- Write a prolog predicate has duplicates

Read file in Perl, These are the specifications for your Perl program: 1. ...

These are the specifications for your Perl program: 1. The file containing your program must be named cookiemgr.pl 2. It must be invoked as: cookiemgr.pl cookies_file [options]

Write a program to use a robot to move, Write a program to use a robot to m...

Write a program to use a robot to move the stack of blocks from a source location to a target location, based. Movement of robot arms, picking and dropping, can be controlled usi

Develop a mobile phone application for games, You have been asked to set up...

You have been asked to set up a project plan for developing a mobile phone application for London Olympics. Major tasks include conducting some research into different mobile ph

C program with creation of child process using fork system, Problem 6. ...

Problem 6. Demonstrate how and when can you use the commands- vi, cat, chmod, grep, man, pwd, ps, kill, mkdir, rm demonstrating how and when the above 10 commands can be

Explain inheritance and polymorphism in lingo programming, Question: (a...

Question: (a) Explain the concepts of Inheritance and Polymorphism in Lingo programming. (b) Write short descriptions on parent scripts and child objects in Lingo object

Define functions with no arguments and no return values, Define Functions w...

Define Functions with no arguments and no return values? When a function has no arguments it doesn't receive any data from the calling function. Likewise, it doesn't return any

econometrics using r, EF308 Assignment 2 Due: 3pm, 26 April 2012 Introduct...

EF308 Assignment 2 Due: 3pm, 26 April 2012 Introduction This assignment is loosely based on Cheung et al. (2005) and Molodtsova and Papell (2009) and examines the out-of- sample pr

Shell script to print multiplication table of given number, Normal 0 ...

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

how to store multidimensional array in a single column in m, how to store ...

how to store multidimensional array in a single column in mysql database using MATLAB?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd