Thursday, November 12, 2009

FINAL PROJECT 4

NOMOR 1 =

Soal =


























Jawab :

Contoh :
likes(john,X). Gunakan sisipan operator — > john likes X dog(fred). Gunakan awalan operator –> isa_dog(fred). Gunakan awalan operator –> fred is_a_dog Jika ditemukan : likes(john,X):-is_female(X),owns(X,Y),isa_cat(Y).
Dengan kata lain :
john likes X:- X is_female, X owns Y, Y isa_cat.

















NOMOR 2 =

Define and test a predicate which takes two arguments, both numbers, and calculates and outputs the following values :

a. their average

b. the square root of their product

c. the larger of a and b










0 comments:

Post a Comment