๐Ÿค–
B.TECH II YEAR โ€ข II SEMESTER โ€ข R22

Skill Development Course - Lab Manual

PROLOG / LISP / PySWIP โ€ข Program 1 Solution

๐Ÿ“˜ R22 Regulation ๐ŸŽ“ II Year ๐Ÿ“š II Semester ๐Ÿค– Skill Development Course ๐Ÿงช Lab Program 1
Aim

Write simple fact for following: A. Ram likes mango. B. Seema is a girl. C. Bill likes Cindy. D. Rose is red. E. John owns gold

โ† All Programs

๐Ÿ’ป Solution

week1.pl
% Facts

1. Ram likes mango.
2. Seema is a girl.
3. Bill likes Cindy.
4. Rose is red.
5. John owns gold.

% Clauses

 likes(ram ,mango).
 girl(seema).
 red(rose).
 likes(bill ,cindy).
 owns(john ,gold).

๐Ÿ“ค Output

w1.txt
% Queries

 ?-likes(ram,What).
 What= mango
 ?-likes(Who,cindy).
 Who= cindy

 ?-red(What).
 What= rose
 ?-owns(Who,What).
 Who= john
 What= gold
Program 2 โ†’
โ† Back to Skill Development Course Lab Programs ๐Ÿ“š All Lab Manuals