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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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