Artifical Intelligence Programming Group Assignment
Artifical Intelligence Programming Group Assignment
ASSIGNMENT
GROUP MEMBERS
EUGENE GITONGA – 18/02682
BOAZ LELEINA – 18/02445
LYNNE BIWOTT –18/02368
JANNELLE OMOLE – 18/02359
DORANI LEPIIR – 18/02595
ANASTACIA MURAYA – 18/02670
AYUB OTIENO – 18/02368
KENEDY KIPROP – 18/02361
VICTORIA MAINA – 18/02559
WENDY ACHIENG – 18/02403
QUESTION ONE
Represent the following facts using the language of predicate logic
i. If someone needs a bike then they may borrow jane’s
soln
∃x∀y needs(x,bike) borrow(y,Jane)
ii. You are liable to be fined if your car is untaxed
Soln
fined(person x):-
untaxed (car)
iii. John travels to Nairobi by train
Soln
∃x : to_Nairobi(x) travels(John,x) ∧ use_train(John,x)
iv. Two people are siblings if they have the same parents
Soln
sibling(person1,person2):-
same_parents(person1,person2)
v. Two people live in the same house if they have the same address
Soln
same_house(person1,person2):-
same_address(person1,person2)
QUESTION TWO
Consider the following sentences
• Armstrong is married to Lynne who has a daughter Peris.
• Ayub is the son of Yusuf who is married to Peris.
• The parent of one's parent is his/her grandparent.
• If a person is married to another person who has a child then the
first person is also a parent of the child.
• If a person is married to another person then the latter person is
married to the former
REQUIRED
i. Change these sentences to predicate form, by using the
standard form of logic and the following predicates: parent(X,
Y), grandparent(X, Y), and married_to(X, Y).
Soln
(i) married_to(Armstrong,Lynne) ∧ parent(Lynne,Peris)
Conc:- parent(Armstrong,Peris)
parent(Peris,Ayub)
grandparent(Armstrong,Ayub)
grandparent(Lynne,Ayub)
parent(person1,person2):-
married_to(person1,person3)
parent(person1,person2):-
parent(person3,person2)
married_to(person1,person3):-
married_to(person3,person1)
parent(person1,person3):-
married_to(person1,person2)
Grandparent(person1,person3):-
parent(person1,person2)
Parent(Armstrong,Peris)
Parent(peris,Ayub)
Grandparent(Armstrong,Ayub)