MAIN CAMPUS
San Roque, Sogod, Southern Leyte
Email:
[email protected] Website: www.southernleytestateu.edu.ph
Excellence | Service | Leadership and Good Governance | Innovation | Social Responsibility | Integrity | Professionalism | Spirituality
IT 405L – Logic Programming
First Semester, AY 2023-2024
LABORATORY ACTIVITY NO. 7
Activity Instruction:
This activity focuses on determining Kinship relationship.
Refering to the family tree and the table below, you will have to create your
knowledge base (facts and rules). Apply also the conjuction and disjunction
logic in joining your predicates.
Madrigal Family
John Maria
Peter Laura
James Jessa
Father Mother Child
John Maria Peter
John Maria Laura
Peter Erica James
Martin Laura Jessa
Create the following facts using these predicates:
parent( ), male( ), female( )
Create the following rules using these predicates of the head of the rules:
MAIN CAMPUS
San Roque, Sogod, Southern Leyte
Email: [email protected]
Website: www.southernleytestateu.edu.ph
Excellence | Service | Leadership and Good Governance | Innovation | Social Responsibility | Integrity | Professionalism | Spirituality
father( ), mother( ), child_of( ), grandfather( ),
grandmother( )
Once you have established your knowledge based, you should also
create a sample query that will trace the following:
If an individual person is the father of an individual child
If an individual person is the mother of an individual child
If an individual person has an individual child
If an individual person is the grandfather of an individual grandchild
If an individual person is the grandmother of an individual
grandchild
Save your Prolog program in the desktop with a filename: activity7_yourSurname.pl
Example: activity7_Siega.pl