0% found this document useful (0 votes)
18 views

Activity 7 Logic Programming

This document provides instructions for a laboratory activity focusing on determining kinship relationships. Students are given a family tree and table of family members and are asked to: 1. Create facts and rules in Prolog representing relationships like parent, male, female using the given information. 2. Write queries to determine if a person is the father/mother, grandparent of another individual. 3. Save the Prolog program on their desktop with a specified file name format.

Uploaded by

Richard Bito
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Activity 7 Logic Programming

This document provides instructions for a laboratory activity focusing on determining kinship relationships. Students are given a family tree and table of family members and are asked to: 1. Create facts and rules in Prolog representing relationships like parent, male, female using the given information. 2. Write queries to determine if a person is the father/mother, grandparent of another individual. 3. Save the Prolog program on their desktop with a specified file name format.

Uploaded by

Richard Bito
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like