Professional Documents
Culture Documents
Lab 1-3
Lab 1-3
Exercise: 1.
∙ Prolog++
∙ ASP (Answer Set Programming)
∙ Alma-0
∙ Prolog
∙ F-logic
∙ Alice
PROCEDURAL DECLARATIVE
4. Relationships can also depict rules. Give 2 examples (other than those specified in Lab
1).
Example: 01
Two people are sisters if
are both female and
they have the same parents.
Example:02
Advantages of Prolog:
∙ This compiler is working fast and hustle-free.
∙ The prolog programming has powerful interfaces between the prolog and C programming
language.
The prolog language does not use complex algorithms and coding.
∙ The prolog programming language maintains and operates data lists with easy coding.
Limitations of Prolog:
∙ The prolog programming does not support graphics features. If you need graphics then
∙ The prolog programming language does not support the “OR” logical conditions. This
∙ The prolog programming language does not support the “NOT” logical condition. This
∙ The LISP language dominates and overcomes input and output features.
Q2: Enter the above program into Prolog and execute the queries shown below:
phone_number(rm303a, 5949).
at(dr_jones, rm303g).
at(dr_mike, rm303a).
visiting(dr_mike, dr_jones).
Queries.
?- location(dr_bottaci, Pl).
?- ring(dr_mike, Number).
?- ring(Person, 5767).
?- ring(Person, Number).
?- ring(dr_jones, 999).
Prolog Program : -
LAB 3
Q1: Write a prolog program to create a family tree by creating facts and rules based on
the information given below:
Talib is male.
Babar is male.
Parveen is female.
Lubna is female.
FACTS & RULES: -
female(parveen).
female(lubna).
male(talib).
male(baber).
parent(talib,baber).
parent(parveen,lubna).
parent(talib,lubna).
parent(parveen,baber).
son(X,Y):-male(X) ,parent(Y,X).