Computers and Technology

Family Given are some facts in the following form.

male(jack).
male(oliver).
male(ali).
male(james).
male(simon).
male(harry).
female(helen).
female(sophie).
female(jess).
female(lily).
parent(jack, jess).
parent(jack, lily).
parent(helen, jess).
parent(helen, lily).
parent(oliver, james).
parent(sophie, james).
parent(jess, simon).
parent(ali, simon).
parent(lily, harry).
parent(james, harry).

where male/1 and female/1 state the gender of a person, and parent/2 means that the first argument is a parent of the second (in this case Jack is a parent of Jess).

Write the following predicates:
β€’ mother/2
β€’ father/2
β€’ grandmother/2
β€’ grandfather/2
β€’ ancestor/2

Example execution:

?- father(ali, X)
X = simon

?- grandfather(jack, X).
X = simon
X = harry

?- ancestor(X, Y).
X = jack, Y = jess
X = jack, Y = lily
X = helen, Y = jess
…

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 10:30, pino40
Which of the following types of software is most applicable to the promotion of new products through advertising? a. databases b. spreadsheets c. web design programs d. word processing tools
Answers: 2
image
Computers and Technology, 24.06.2019 14:00, makaylahunt
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
image
Computers and Technology, 25.06.2019 10:40, ooEVAoo
If you're using the paintbrush tool and want to change the color of the paint being used what should you change
Answers: 1
image
Computers and Technology, 25.06.2019 12:30, kamilagreyes9
Why is outfitting a workspace with video games in technology development company considered a strategic use of money
Answers: 2
Do you know the correct answer?
Family Given are some facts in the following form.

male(jack).
male(oliver).

Questions in other subjects: