Write a prolog predicate for a list, 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/22/2013 5:54:31 AM | Location : United States







Related Discussions:- Write a prolog predicate for a list, Assignment Help, Ask Question on Write a prolog predicate for a list, Get Answer, Expert's Help, Write a prolog predicate for a list Discussions

Write discussion on Write a prolog predicate for a list
Your posts are moderated
Related Questions
depth estimation from block matching algorithm motion estimation


As an XML expert you are required to model a system for an online bookshop. After an interview with the shop manager you have the following information: The detail of th

Can you please make my assignment in 3 days?I will pay you good

A large offshore accommodation barge is to be converted into a floating luxury hotel.  It will be connected to a single point mooring buoy (SPM) in a beautiful inland loch where th

Write an interactive C program which prompts the user with the following options on the opening menu: 1) Student information 2) Theory counselling batch-scheduling

Write a program to compute: 1.)    Mixing ratio, W=.622[Vapor pressure/(pressure-vapor pressure)] 2.)    Virtual temperature, VT=T(1+0.61 mixing ratio) = T(1+.61W) 3.)

ADO. NET ADO.NET (ActiveX Information Things for .NET) is a set of programs elements that developers can use to accessibility data and data solutions. It is an element of the platf


Write a program that will input two numbers from the keyboard and execute each of the signed and unsigned multiply and divide instructions.  For each instruction, the program shoul