Prolog predicate to remove nth element, Programming Languages

Assignment Help:

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

 


Related Discussions:- Prolog predicate to remove nth element

Explain the booch methodology, Problem 1 Explain the Booch Methodology ...

Problem 1 Explain the Booch Methodology 2 Why does every interaction diagram need a written description? Explain 3 Explain the five core workflows of the Unified Process

Implement a lunar lander simulation, 1. Modify your solution to #8 so that ...

1. Modify your solution to #8 so that if an ellipse is touched by the mouse, it turns permanently green.Bonus (up to +5): a green ellipse stops moving, but recovers after 5 seconds

Develop an html document with a nested list, 1. Develop a Web page, indicat...

1. Develop a Web page, indicating an ordered list of the names of your five friends. 2. Develop an HTML document with a nested list indicating the content page of any book 3.

Program on car purchasing simulation, Introduction A new online syst...

Introduction A new online system for purchasing carsis being designed and you have been contracted to write a C# console application program that models the proposed functio

Wsdl service architecture in uml, Design the proposed implementation using ...

Design the proposed implementation using the contract first approach and object oriented approaches.  At a minimum, you must provide an overview of the services in the service arch

Create an xslt stylesheet-attributes to elements , Attributes to Elements ...

Attributes to Elements Create an XSLT stylesheet that converts all attributes found in a given XML document to elements.Use the sample instance from question 2 to test the tra

Matlab fem, I need a program that writes the first column of the matrix. T...

I need a program that writes the first column of the matrix. The numbers in this column follow the pattern below: 1. Numbers start at 1 and count up to ''nels'' in increments of

Type of linear programming - dea, Type of Linear Programming - DEA The ...

Type of Linear Programming - DEA The Express Dry Cleaners currently has four locations in the Chicago area and willing be opening the fifth in the very near future.  Mr. James,

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

Prepare notes on the logical storage manager, Question: (i) Prepare bri...

Question: (i) Prepare brief notes on the Logical Storage Manager. (ii) Show benefits that can be achieve by using the LSM Manager. (iii) LSM organizes and optimizes disk

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