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

  Hubspot: inbound marketing and web 2.0

Hubspot: Inbound Marketing and Web 2.0

  How large a value can be stored in an integer variable

Describe a representation for integers that has no size restriction (other than the limits of the computer's available main memory)

  Draw application to display button and label on a screen

Draw and implement application which displays a button and a label on a screen. Every time button is pushed, the label will display random number between 1 and 1000,

  Write a program to prints the sum of all elements with an

write a program to prints the sum of all elements with an even index and all elements with an odd index of the

  Create nested menus interface for a check-in hotel

Create a nested menus interface for a check-in and check-out hotel reservation system that can be used internationally. Use numbers to select a menu item.

  Program to read employee information in the array of objects

Let the program which will read employee information into the array of objects, sort array by employee identification number, write the sorted array.

  Write a program that will use the four sorting algorithm

Write a program that will use the four sorts (Selection sort, Heap Sort, Quicksort and Merge Sort). Each of the four sorts should be TIMED on three different lists of integers.

  When the program starts the user is asked to seed the

write a program that lets the user play the game of rock paper scissors against the computer. the program should work

  Write down program which permits to play tic tac toe game

Write down the program which permits 2 players to play tic tac toe game. Program should contain class tictactoe to implement tictactoe object.

  Use a switch statement to calculate a letter grade

Use a switch statement to calculate a letter grade based on a numeric average up to 100. Allow the numeric score to be entered in a text field. A Grade button will display the corresponding letter grade in a label.

  Design a class-based solution to a problem

To design a class-based solution to a problem using multiple data structures.

  Write a function prime that takes a single integer

Write a higher order function list To that takes a function f and a number n and uses list comprehension to return a list of all the numbers from 1 to n for which the function f evaluates to True.

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