Write a prolog relation remove

Assignment Help Programming Languages
Reference no: EM13333370

Write a Prolog relation remove(E,L,R) that is true if R is the list which results from removing one instance of E from list L. The relation is false if E isn't a member of L.

What are all of the answers to the following queries?

ask remove(a,[b,a,d,a],R).
ask remove(E,[b,a,d,a],R).
ask remove(E,L,[b,a,d]).
ask remove(p(X),[a,p(a),p(p(a)),p(p(p(a)))],R).

 

Reference no: EM13333370

Questions Cloud

Define using chemical equations, show how the triprotic acid : Using chemical equations, show how the triprotic acid H3PO4 ionizes in water. Phases such as (l) or (aq) are optional Ka1 = ? Ka2 = ? Ka3 = ?
Write a prolog relation that returns a list : Write another relation (anything you want) that does something not performed above. Explain what your relation does.
Locate the final image relative to the lens on the right : Two converging lenses (f1 = 9.00 cm and f2 = 6.00 cm) are separated by 18.0 cm. The lens on the left has the longer focal length, Locate the final image relative to the lens on the right
Evaluate the hardness as ppm caco3 : A 250.0-mL sample of water was adjusted to pH 10 with ammonia buffer and calmagite indicator was added. The prepared sample required 30.84 mL of 0.00802 M EDTA for titration to the endpoint. Calculate the hardness as ppm CaCO3
Write a prolog relation remove : Write a Prolog relation remove(E,L,R) that is true if R is the list which results from removing one instance of E from list L. The relation is false if E isn't a member of L.
Define prolog relations for the following : Provide some facts for the father, mother, male, and female predicates and then test the entire thing using Prolog.
Explain what is the ph of a 0.0700 m solution of h2a : What is the pH of a 0.0700 M solution of H2A? What are the equilibrium conecntrations of H2A and A^2- in this solution? pH = ? [H2A} = ? [A^2-] = ?
What is the speed of the large cart after the collision : A small, 300g cart is moving at 1.30m/s on an air track when it collides with a larger, 5.00kg cart at rest. What is the speed of the large cart after the collision
Write a prolog relation subsequence : Write a Prolog relation remove(E,L,R) that is true if R is the list which results from removing one instance of E from list L. The relation is false if E isn't a member of L.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that prompts for and reads an amount

Write a program that prompts for and reads an amount (integer) for Canadian dollars and convert the amount to Euros. The exchange rate is 1.

  Create link invisible to begin-display after submit button

Create link invisible to begin but display it after Submit button has been clicked. Confirmation page should say "Thank you for your order".

  Program-calculate power loss-transmitted-power generating

Write a program to calculate power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generating station.

  Write the program which processes test data

Write the program which processes test data. Output must be student's ID, followed by answers, followed by test score, followed by test grade. Suppose the following grade scale.

  Determine branch folding for unconditional branches

Determine the improvement from branch folding for unconditional branches. Assume a 90% hit rate, a base CPI without unconditional branch stalls of 1.

  Write a program that exploit string library functions

Write a program that exploit string library functions to do the following: -prompt the user to enter his name (of four parts) -count the number of characters in his name (excluding the white spaces).

  Write program to prompt user to enter a hex digit character

Write a program which will prompt user to enter ahex digit character ("0" ..."9" or "A" .."F") ,display it on next line in decimal, and ask user if he or she wants to do it again.

  Write application that inputs a telephone number as string

Write an application that inputs a telephone number as a string in the form (555) 555-5555. The application should String method split to extract the area code as a token.

  State space search using prolog and lisp

State Space Search using Prolog and LISP - solve problem using the Prolog computer programming language

  Parking garage program to permit user to enter type of car

Parking garage program to permit user to enter type of car in addition to number of hours in parking garage. Program can be use for any number of customers.

  Definition of function quadratic receives double parameters

Write down definition of function named quadratic which receives 3 double parameters a , b , c . If value of a is 0 then function prints the message "no solution for a=0"

  Ruby on rials to design app

Use ruby on rials to design app. It has to have a database and at least 4 pages Style is free you can design it as the way that you like

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