Write a prolog predicate for a list, 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:- Write a prolog predicate for a list

Dating game program, You are to write a program that determines the day of ...

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following i

Inheritance, The Lost Bay Software Coop purchased EnviroMeasurements, a sma...

The Lost Bay Software Coop purchased EnviroMeasurements, a small startup with a product, GreenStation, that measures pollen count and air quality. The company has ventured

Output for the following instruction if CX=9087H AX=9090H, What will be the...

What will be the output for the following instruction if CX=9087H and AX=9090H? 1) BTR AH,2? 10010000=10010000 2) BTC CX,9?1001000010000111=1001000110000111 3) NEG AX?

Program to create multithreaded calculator, Multithreaded Calculator I...

Multithreaded Calculator In this Lab, you will be implementing a simple multithreaded calculator. Our calculator will accept expressions as infix notation text strings consist

What is .net?, What is .NET? It is a foundation fairly neutral structure...

What is .NET? It is a foundation fairly neutral structure. Is a coating between the son and the selection language? It can handle many selection dialects, such as VB.NET,

Vbs, Add macros to MS word 2010 according to A PARTICULAR FORMAT

Add macros to MS word 2010 according to A PARTICULAR FORMAT

What are program visible and invisible resisters, What are program visible ...

What are program visible and invisible resisters? A4) Program visible is those registers that can be programmed by the users, or which are customizable, whereas Program invisible

Write a program to build bcd countdown timer, Many applications require ent...

Many applications require entering a number from a button and then the device counts that number down.  If it is a 2 digit number it can be stored in a single register.  If it is l

CMIS 102, Calculate the total price based on several key parts required to ...

Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts.

Pattern matching program in xhtml, Part 1 Given the following Regular Exp...

Part 1 Given the following Regular Expressions, explain in detail the pattern accepted by each. Pay attention to all the characters being used. Your answers need not appear with

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