Write prolog clauses to express the relationships

Assignment Help Programming Languages
Reference no: EM13708765

Program: Write prolog clauses to express the subsequent relationships, given the parent relationship: grand-parent, sibling, cousin.

so far i have:

ancestor(X,X).

ancestor(X,Y) :- ancestor(X, Z), parent(Z, Y).

PLEASE make sure it compiles and write the full program to receive full credit. Thank you so much for your help.

Reference no: EM13708765

Questions Cloud

Write a prolog program that finds the ast item in a list : Write a Prolog program that finds the ast item in a list. Add a test query.
Determine the electron geometry and molecular geometry : Question- Determine the electron geometry, molecular geometry, and idealized bond angles for each of the following molecules.
Write a program that asks the user to enter two numbers : Write a program that asks the user to enter two numbers. The program should use the conditional operator to find which number is the smaller and which is the larger.
Classify the bonds formed between each pair of elements : Question- Classify the bonds formed between each pair of elements based on electronegativity values in the following table: Element Sc, Be, H, P, S, I, Br, Cl, O, F. Electronegativity 1.3, 1.5, 2.1, 2.1, 2.5, 2.5,2.8, 3.0, 3.5, 4.0
Write prolog clauses to express the relationships : Write prolog clauses to express the relationships, given the parent relationship: grand-parent, sibling, cousin.
What is the molecular formula of the dissolved s molecules : The boiling point of pure CS2 is 46.30 oC, and its boiling point elevation constant Kb is 2.34 oC/m. A solution of sulfur in liquid CS2, which was prepared by dissolving 2.26 g S in 50.0 g CS2, boils at 46.71oC. What is the molecular formula of th..
What is the ph change of citric acid : Question- What is the pH change of a 0.300M solution of citric acid (pKa=4.77) if citrate is added to a concentration of 0.155M with no change in volume
Change the image to a black-to-green scale image : Call a method that will change the image to a "black-to-green scale" image - Call a method that will change the image to a version of a green scale image.(green to white).
What is cd2+ in the resulting mixture : Question- A 100.0 ml solution of 0.50M Cd(NO3)2 is mixed with 100.0 ml of 6.0 M ammonia solution. What is [Cd2+] in the resulting mixture?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write prolog clauses to define the relationships

Using Prolog, establish a database of facts and rules for the following predicates.

  Decrypt all entries of username variable

Need a another cgi file to decrypt all entries of ' username ' variable and restore it to original plain/text, it should be start restoring the inputs to original text the cgi file

  Design architecture of system to accept natural language

Using the generic model of a language processing system presented here, design the architecture of a system that accepts natural language commands and translates.

  Write a program that asks how many tickets sales

Write a program that asks how many tickets sales. Format your dollar amount in a fixed-point notation with two decimal points and make sure the decimal point is always displayed.

  Write a driver program to test class

Create a class called Rational for performing arithmetic with fractions. Write a driver program to test your class. Use integer variables to represent the private instance variables of the class-the numerator and the denominator.

  Building instruction set simulators

Building Instruction Set Simulators

  Prepare clear button which will clear result text box

Make the compute button the Accept button. Prepare Clear button which will clear result text box and reset all text boxes, 4. controls, and internal variables used.

  Write vl program to convert leagues-number of nautical miles

Write a VL program which will convert 20,000 leagues to number of nautical miles. Your program requires no input elements, just elements to compute result and output how many nautical miles is equivalent to 20,000 leagues.

  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.

  Display information about users that are currently logged in

Create a new file titled TestWork.scr Change the permissions on this new file to add the execute bit for user, group, and owner. Edit your new file using Gedit or VI and change it so it performs the following actions:

  Write class to hold hourly rate of pay

Write down the class which comprises variables which hold your hourly rate of pay and number of hours that you worked. Illustrate your gross pay.

  Write a function called stream-map

Write a function that produces a stream of positive prime numbers . Use that stream to create a list of the product of all pairs of consecutive prime numbers up to a given value.

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