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
I need help for C# XNA 2Dimension Game Development. I am gonna send the question and my solution(incomplete). I need you to complete it. Can you help me about that. I have 6-7 days

Produce a hierarchy chart, a structured flowchart, and a Pascal program (with appropriate comments) to generate the Sales Commission Report shown below. The commission for each sal

Determine the address accessed by each of the following instruction if DS=1100H, BX=0200H, LIST=0250H AND SI=0500H-: 1) MOV LIST[SI],EDX?0250+0500+11000=11750 2

The ATM will simulate a real world automated teller machine that supports safe access to accounts from multiple concurrent clients.

You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner (SLLx,SLLy), and the len

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

SailDublin Ferry provides ferries to mainland Britain, Europe and America. Having observed the success of Irish ferries and Stennaline online booking system; SailDublin ferry has d

AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embedded Linux Development Kit (ELDK), and Xenomai A. Description of the Project The project's objective is to design a set of

i want another php script like that one in assignment: EM201484 SA727PHP i want to parse out an urls form log file i will post attachments for a demo

This assignment is divided into two parts. The goal is to write a Java program that calculates capital gain on a stock market, see Lab 7. When a share of common stock of some co