Write a prolog relation that returns a list

Assignment Help Programming Languages
Reference no: EM13333373

Write a Prolog relation subsequence(L1,L2) that is true if list L1 contains a subset of the elements of L2 in the same order.

How many different proofs are there for each of the following queries?

ask subsequence([a,d],[b,a,d,a]).
ask subsequence([b,a],[b,a,d,a]).
ask subsequence([X,Y],[b,a,d,a]).
ask subsequence(S,[b,a,d,a]).

Explain why there are that many.

1. Write a Prolog relation that returns a list containing the union of the elements of two given lists.

2. Write another relation (anything you want) that does something not performed above. Explain what your relation does.

 

Reference no: EM13333373

Questions Cloud

Explain the ph of the resulting solution is 2.31 : Enough of a monproctic acid is dissolve in water to produce a 0.0147 M solution. The pH of the resulting solution is 2.31. Calculate the Ka for the acid.
How would each economist explain unemployment and what : How would each economist explain unemployment and what policies would each advocate?
How much work did the friction do in stopping the car : A car is moving along a straight stretch of road at 60 mph [ 26.7 meters/sec ]. how much work did the friction do in stopping the car
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.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create program which lists total points scored

Create program which lists total points scored for each of 30 classrooms. Include invalid input check if a proper room number is not entered.

  Create test application that creates objects of type book

Create a test application that creates several objects of type book class and adds each Book to an ArrayList. Your test application should then do the following.

  Create program in visual studio-produce summary of ammounts

Create the program in Visual Studio, C#, 3.5 .Net that will produce the summary of amounts due for Pat's Auto Repair Shop. Display splash screen first.

  Explaining data-driven multicast routing paradigm

The data-driven multicast routing paradigm works best on local networks that have low delay and excess capacity, while the demand driven paradigm works best in a wide are environment.

  Confi gure the repository and define the repository

Configure the repository and define the repository usernames and passwords - Install the subversion package.

  Write a program for a calculator

Write a program for a Calculator that can do two operations, + and -. This calculator should be able to add or subtract two numbers of any size. You may use Recursion if you want.

  Explain relationship between xbrl and semantic web

How do HTML 5, RDF (Resource Description Framework), and OWL (Web Ontology Language) relate to the semantic web? Explain the relationship between XBRL and the semantic web.

  Program to print chains of numbers within a range

Write a program to print the chains for the numbers within a range that the user specifies.

  Write program to permit user to enter last names

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

  Illustrate whether program will fit in address space

Will this program fit in address space? If page size were 512 bytes, would it fit? Remember that page may not contain parts of two different segments.

  Create a program to compute car-s miles-per-gallon

Create a program which ask's the user for number of miles driven and gallons of gas used. It must compute the car's miles-per-gallon and show the result on the screen.

  Write the ruby source code for problem

Write the Ruby source code for Problem - Write a PhoneContact class that gets initialized with a phone number and a label.

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