Question: USE PROLOG LANGUAGE TO SOLVE THIS PROBLEM 3 ) Consider the following database for the two animals, Jack and Lucy [15 points] Jack Category: canidae
USE PROLOG LANGUAGE TO SOLVE THIS PROBLEM
3 ) Consider the following database for the two animals, Jack and Lucy [15 points]
Jack
Category: canidae
details:
dog_type
- Labrador
- Black
dog_age
- 5
Lucy
Category: felidae
details: cat_type
- Persian
- White
cat_age
- 2
3.1 Create facts for the animals category: category(X, Y) where X is the animal (Jack or Lucy) and Y is the category(canidae or felidae). Create facts for the animals details: details(X, Y) where X is the animal (Jack or Lucy) and Y is the details (dog_type,dog_age or cat_type cat_age).
Create facts for the animals type : type(X, Y) where X is the type (dog_type or cat_type) and Y is the type details (Labrador, black or Persian, white). [3]
Create facts for the animals age: age (X,Y) where X is the (dog_age or cat_age) and Y is the age (5 or 2).
3.2 Create a rule info(X, Y), where X is the animal (Jack or Lucy) and Y is the info for the animal. For example, info(Jack, X) should return the info: canidae, dog type, dog age. [5]
3.3 Create a rule bio(X, Y), where X is the animal (Jack or Lucy) and Y is the bio (Labrador, Black, 5 or Persian, White, 2). For example, bio(Jack, X) should return Labrador, Balck and 5.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
