SlideShare a Scribd company logo
Prolog Code [Family Tree] by Shahzeb Pirzada
male(anwar).
male(nadeem).
male(waseem).
male(saleem).
male(faheem).
male(saad).
male(fahad)
female(firdos).
female(atiya).
female(fozia).
female(sadaf).
female(sonia).
female(fatima).
parent(anwar,firdos,nadeem).
parent(anwar,firdos,waseem).
parent(nadeem,atiya,faheem).
parent(waseem,fozia,saleem).
parent(waseem,fozia,sadaf).
brother(nadeem,waseem).
brother(waseem,nadeem).
brother(faheem,saleem).
brother(saleem,faheem).
sister(sadaf,saleem).
sister(sadaf,faheem).
wife(anwar,firdos).
wife(nadeem,atiya).
husband(firdos,anwar).
husband(atiya,nadeem).
husband(fozia,waseem).
aunt(sonia,saad).
uncle(fahad,fatima).
grandmother(anwar,sadaf).
father(X,Y) :- parent(X,Z,Y).
mother(X,Y) :- parent(Z,X,Y).
son(X,Y,Z) :- male(X),father(Y,X),mother(Z,X).
daughter(X,Y,Z) :- female(X),father(Y,X),mother(Z,X).
wife(X,Y) :- female(X),parent(Y,X,Z).
husband(X,Y) :- male(X),parent(Y,X,Z).
grandfather(X,Y) :- male(X),father(X,Z),father(Z,Y).
grandmother(X,Y) :- female(Y),mother(Y,Z),mother(Z,Y).
uncle(X,Y) :- husband(X,Z),aunt(Z,Y).
aunt(X,Y) :- wife(X,Z),uncle(Z,Y).
cousin(X,Y) :- father(Z,X),brother(Z,W),father(W,Y).
ancestor(X,Y,Z) :- parent(X,Y,Z).
ancestor(X,Y,Z) :- parent(X,Y,W),ancestor(W,U,Z).
brother(X,Y) :- male(X),parent(X,Y).

More Related Content

PPTX
Artificial Bee Colony: An introduction
PPTX
Artificial bee colony algorithm
PDF
Introduction to Multimodal LLMs with LLaVA
PDF
Voice phishing prevention application through real-time voice call analysis :...
PPTX
How Change Happens
PPTX
Cuckoo search
PPTX
14. mohsin dalvi artificial neural networks presentation
PDF
Unleashing the force of AI-powered intelligent document processing
Artificial Bee Colony: An introduction
Artificial bee colony algorithm
Introduction to Multimodal LLMs with LLaVA
Voice phishing prevention application through real-time voice call analysis :...
How Change Happens
Cuckoo search
14. mohsin dalvi artificial neural networks presentation
Unleashing the force of AI-powered intelligent document processing

What's hot (20)

PPT
Artificial bee colony (abc)
PPTX
Cuckoo Optimization ppt
PPT
Ant colony Optimization
PDF
Tcc plano de controle de emergencia senai aracruz
PPT
Cuckoo search
PDF
Introduction to ML and Decision Tree
PDF
What are Honeypots? and how are they deployed?
PPTX
Single Image Super-Resolution from Transformed Self-Exemplars (CVPR 2015)
PPT
Artificial Intelligence
PDF
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...
PPTX
Image processing
PDF
Threat Detection in Surveillance Videos
PPTX
AI and the Impact on Cybersecurity
PDF
Introduction to Deep Neural Network
PDF
AI meets Big Data
PPTX
Captcha as graphical password
PPT
Social Recommender Systems Tutorial - WWW 2011
PDF
AMHARIC TEXT TO SPEECH SYNTHESIS FOR SYSTEM DEVELOPMENT
PPTX
Sistem pengenalan wajah
PDF
Feature Extraction
Artificial bee colony (abc)
Cuckoo Optimization ppt
Ant colony Optimization
Tcc plano de controle de emergencia senai aracruz
Cuckoo search
Introduction to ML and Decision Tree
What are Honeypots? and how are they deployed?
Single Image Super-Resolution from Transformed Self-Exemplars (CVPR 2015)
Artificial Intelligence
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...
Image processing
Threat Detection in Surveillance Videos
AI and the Impact on Cybersecurity
Introduction to Deep Neural Network
AI meets Big Data
Captcha as graphical password
Social Recommender Systems Tutorial - WWW 2011
AMHARIC TEXT TO SPEECH SYNTHESIS FOR SYSTEM DEVELOPMENT
Sistem pengenalan wajah
Feature Extraction
Ad

More from Shahzeb Pirzada (20)

PDF
Sigma Society Inauguration
PDF
Newton's Ninja - Combat'13
DOCX
The Open Systems Interconnect (OSI) Model - IS AUDIT
DOCX
RAID - IS AUDIT
DOCX
Process Improvement Techniques - IS AUDIT
DOCX
Project Management Certifications - IS AUDIT
DOCX
Computer Assisted Audit Techniques (CAATS) - IS AUDIT
DOCX
Certifications on Security - IS AUDIT
DOCX
Google Advance Searching- Information System Audit & Control Report
DOCX
What is Fuzzy Logic?
DOCX
Elements of Quality Management System
DOCX
City School Network- Routing & Switching Final Report
PPT
THE SEVEN HABITS OF HIGHLY EFFECTIVE TEENS
DOCX
Entrepreneurial Leadership-FINAL REPORT
DOCX
SP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final Report
PPTX
White collar vs Blue collar
DOC
Story Narration Competition -Script
DOC
Declamation Contest Script for Moc
PPTX
BOOTABLE OPERATING SYSTEM PPT
DOCX
BOOTABLE OPERATING SYSTEM
Sigma Society Inauguration
Newton's Ninja - Combat'13
The Open Systems Interconnect (OSI) Model - IS AUDIT
RAID - IS AUDIT
Process Improvement Techniques - IS AUDIT
Project Management Certifications - IS AUDIT
Computer Assisted Audit Techniques (CAATS) - IS AUDIT
Certifications on Security - IS AUDIT
Google Advance Searching- Information System Audit & Control Report
What is Fuzzy Logic?
Elements of Quality Management System
City School Network- Routing & Switching Final Report
THE SEVEN HABITS OF HIGHLY EFFECTIVE TEENS
Entrepreneurial Leadership-FINAL REPORT
SP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final Report
White collar vs Blue collar
Story Narration Competition -Script
Declamation Contest Script for Moc
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM
Ad

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Digital Strategies for Manufacturing Companies
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
AI in Product Development-omnex systems
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
medical staffing services at VALiNTRY
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Introduction to Artificial Intelligence
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PTS Company Brochure 2025 (1).pdf.......
Digital Strategies for Manufacturing Companies
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Navsoft: AI-Powered Business Solutions & Custom Software Development
AI in Product Development-omnex systems
How to Migrate SBCGlobal Email to Yahoo Easily
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Softaken Excel to vCard Converter Software.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Introduction to Artificial Intelligence
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025

Prolog Code [Family Tree] by Shahzeb Pirzada

  • 1. Prolog Code [Family Tree] by Shahzeb Pirzada male(anwar). male(nadeem). male(waseem). male(saleem). male(faheem). male(saad). male(fahad) female(firdos). female(atiya). female(fozia). female(sadaf). female(sonia). female(fatima). parent(anwar,firdos,nadeem). parent(anwar,firdos,waseem). parent(nadeem,atiya,faheem). parent(waseem,fozia,saleem). parent(waseem,fozia,sadaf). brother(nadeem,waseem). brother(waseem,nadeem). brother(faheem,saleem). brother(saleem,faheem). sister(sadaf,saleem). sister(sadaf,faheem). wife(anwar,firdos). wife(nadeem,atiya). husband(firdos,anwar). husband(atiya,nadeem). husband(fozia,waseem). aunt(sonia,saad). uncle(fahad,fatima). grandmother(anwar,sadaf). father(X,Y) :- parent(X,Z,Y). mother(X,Y) :- parent(Z,X,Y). son(X,Y,Z) :- male(X),father(Y,X),mother(Z,X). daughter(X,Y,Z) :- female(X),father(Y,X),mother(Z,X). wife(X,Y) :- female(X),parent(Y,X,Z). husband(X,Y) :- male(X),parent(Y,X,Z). grandfather(X,Y) :- male(X),father(X,Z),father(Z,Y). grandmother(X,Y) :- female(Y),mother(Y,Z),mother(Z,Y). uncle(X,Y) :- husband(X,Z),aunt(Z,Y). aunt(X,Y) :- wife(X,Z),uncle(Z,Y). cousin(X,Y) :- father(Z,X),brother(Z,W),father(W,Y). ancestor(X,Y,Z) :- parent(X,Y,Z). ancestor(X,Y,Z) :- parent(X,Y,W),ancestor(W,U,Z). brother(X,Y) :- male(X),parent(X,Y).