Write prolog clauses to define the relationships

Assignment Help Programming Languages
Reference no: EM13335245

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

father(X,Y) /* X is the father of Y */
mother(X,Y) /* X is the mother of Y */
male(X) /* X is male */
female(X) /* X is female */
parent(X, Y) /* X is the parent of Y */
difference(X,Y) /* X and Y are different */

Write Prolog clauses to define the following relationships:

is_mother(X) /* X is a mother */
is_father(X) /* X is a father */
aunt(X, Y) /* X is an aunt of Y */
uncle(X, Y) /* X is an uncle of Y */
sister_of(X,Y) /* X is a sister of Y */
grandfather_of(X, Y) /* X is a grandfather of Y */
grandmother_of(X, Y) /* X is a grandmother of Y */
grandchild(X,Y) /* X is a grandchild of Y */
sibling(X,Y) /* X is a sibling of Y, i.e they have the same parents */
half_sibling(X,Y) /*they have same mother but different fathers or
same father, different mothers */
related(X,Y) /* X is related to Y */
ancestor(X, Y) /* X is an ancestor of Y */
descendant(X,Y) /* X is a descendant of Y */

 

Reference no: EM13335245

Questions Cloud

What is the effective cost of borrowing in the case : Your firm has an average collection period of 20 days. Current practice is to factor all receivables immediately at a 1.00 percent discount.
What are the potential benefits of the domestic securities : What are the potential benefits of the domestic securities market to those investing in the foreign securities market and what are some examples
What some of the factors that a finance manager considers : What some of the factors that a finance manager considers in choosing an appropriate discount rate for a capital investment project
How much free cash flow did the firm generate during 2011 : Net income = $600; after-tax operating income [EBIT (1-T)] = $700; and Total assets = $2,000. Information for 2011 is as follows: Net income = $825; after-tax operating income [EBIT (1-T)] = $1,125;
Write prolog clauses to define the relationships : Using Prolog, establish a database of facts and rules for the following predicates.
Determine what must the beta of the stock be : A stock has an expected return of 13.6%, the risk-free rate is 3.7%, and the market risk premium is 7.1%. What must the beta of this stock be
Raise prices when facing an elastic demand curve : Why is that a profit maximizing businessman would always raise prices when facing an inelastic demand curve, but might or might not raise prices when facing an elastic demand curve? explain and justify your answers in detail.
Compute zachs apparent weight while the elevator is braking : Zach, whose mass is 64kg , is in an elevator descending at 10m/s. What is Zach's apparent weight while the elevator is braking
Write a function that uses stream-map : Now write a function that uses stream-map to produce the sum of two streams element by element for the first x elements . Be sure to test with several different types of streams (for example, you could sum together the odd and even numbers betwee..

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to calculate overtime pay for salary based employee

To calculate overtime pay for a salary based employee, first find hourly rate by dividing gross pay by 40, and then calculate overtime pay.

  Program to divide string based on some delimiter string

StringTokenizer is a class in the java.util library that can divide a String based on some delimiter String (a delimiter is a separator). If the instruction StringTokener st = new StringTokenizer.

  Prepare console application to examine contents of text file

Prepare the C++ console application which examines the contents of a text file. Your program must count the number of: * lines (hint: use getline).

  Design-write program to enter score repetition structure

Design and write a program that asks the user to enter five test scores using a repetition structure. The program should display the letter grade for each score and the average test score at the end of the program.

  Write advantages of external css and internal css

Write down the advantages of external CSS compared to internal CSS? Describe conditions in which each is suitable type.

  Write program to calculate cost of flowers sold at stand

Write down the program in class FlowerCounter which calculates the cost of flowers sold at flower stand. Five types of flowers-petunia, pansy, rose, violet, and camation- are stocked and cost.

  Write a program in q basic that accept student name

Write a program in Q basic that accept a student name,score obtained in 5 course and compute the average score of the student and my program must display the name of the student

  Write down program which declares integer variables

Write down complete program which declares the integer variable, reads value from the keyboard into that variable, andwrites to standard output variable's value, twice the value.

  Program that asks for user-s age

Write a program that asks for user's age. Based on their response print "You can vote" (18 years old or older) or "You can't vote".

  Determine recursive procedure and iterative procedure

Determine the example or recursive procedure and represent it as iterative procedure. Also, select the iterative procedure which you would re-write as recursive.

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

  Write program to read data for employee and print name

Write a program which reads data for employee and prints name and salary of employee. Data read is: Name. Number of hours worked.

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