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
Use recursion to de ne a function position which has as input an integer, a character and a string and returns the result of inserting the character in the string at the position s

I am building wpf application and i want to install this application on a server pc and share it to other pces on a net work , my question is i have static class that contain data

how can we get the data from data base to combo box in jsp page dynamically

Hi how can I upload my hw to you experts?

Task: This assignment is about writing programmes and Web Services in C#: 1) Develop a console programme that reads a sequence of integer numbers from the console and sorts

Describe URL and hostname part? The hostname part of the URL should be a valid Internet hostname. It can also be an IP address like as 204.29.207.217 or 128.235.252.184. The

Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides. A = adenine, C = cytosine,

Write a procedure named Str_concat that concatenates a source string to the end of a target string. Sufficient space must exist in the target string to accommodate the new characte

BACKGROUND: This assignment illustrates the power of mobile applications. OBJECTIVES: 1. Mobile applications DESCRIBED TASK: This is a single part assignment.

Write a Perl program that uses a hash structure. The program should use a larger number of operations (100 or more) on this hash. To do that, use a random number generator to creat