Prolog predicate to remove nth element, Programming Languages

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail. You can assume that N is strictly greater than 0. For instance:

?- remove_nth(4,[a,e,e,d,s,e],L).

L = [a,e,e,s,e] ;

No

?- remove_nth(6,[a,b],L).

No

 

Posted Date: 3/28/2013 3:53:18 AM | Location : United States







Related Discussions:- Prolog predicate to remove nth element, Assignment Help, Ask Question on Prolog predicate to remove nth element, Get Answer, Expert's Help, Prolog predicate to remove nth element Discussions

Write discussion on Prolog predicate to remove nth element
Your posts are moderated
Related Questions
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

what is the code to copy code on 1 jsp page to others

I have to create a bank atm machine using MS-DOS. I am struggling to create LIST ALL ACCOUNTS ROLL-BACK TRANSACTIONS ACCESS AN ACCOUNT

MVC Framework The ASP.NET MVC Structure is a web program framework that tools the model-view-controller (MVC) design. According to ASP.NET, it allows application designers to devel

Design an object definition named Pet, which should have the following fields: name: The name field holds the name of a Pet type: The type field holds the type of anima

Name : Jaya Malathy IC No : 99011460923 Quiz 1 : 20.5 Quiz 2 : 22.5 Quiz 3 40.5 Total marks = 83.5 Name IC No Quiz1 Quiz2 Quiz3 Grade --- ---- ---- ---- ---- ---- Jaya 990

Class a Abstract Data Type: is a template for creating objects. A class describes a collection of related objects i.e. instances of the classes. Basically classes are user-defined

We now require starting looking into finding a particular solution for n th order differential equations. The two ways which we'll be looking at are similar as those which we look

Explain what is HTML language with an example? HTML is the HyperText Markup Language. HTML files are text files featuring semantically tagged elements. HTML filenames are suff

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