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

What's hot

Greedy method class 11
Greedy method class 11Greedy method class 11
Greedy method class 11Kumar
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design IntroductionKuppusamy P
 
Memory map
Memory mapMemory map
Memory mapaviban
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examplesSharif Omar Salem
 
Ch03 Mining Massive Data Sets stanford
Ch03 Mining Massive Data Sets  stanfordCh03 Mining Massive Data Sets  stanford
Ch03 Mining Massive Data Sets stanfordSakthivel C R
 
Digital modeling of speech signal
Digital modeling of speech signalDigital modeling of speech signal
Digital modeling of speech signalVinodhini
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI Hanif Durad
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...vikas dhakane
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic SequencesArrow Devices
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design PatternsAshwin Shiv
 

What's hot (20)

Greedy method class 11
Greedy method class 11Greedy method class 11
Greedy method class 11
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Line coding
Line codingLine coding
Line coding
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design Introduction
 
Memory map
Memory mapMemory map
Memory map
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Adaptive Huffman Coding
Adaptive Huffman CodingAdaptive Huffman Coding
Adaptive Huffman Coding
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examples
 
Ch03 Mining Massive Data Sets stanford
Ch03 Mining Massive Data Sets  stanfordCh03 Mining Massive Data Sets  stanford
Ch03 Mining Massive Data Sets stanford
 
Digital modeling of speech signal
Digital modeling of speech signalDigital modeling of speech signal
Digital modeling of speech signal
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
Rabin karp string matcher
Rabin karp string matcherRabin karp string matcher
Rabin karp string matcher
 
AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
 

More from Shahzeb Pirzada

Sigma Society Inauguration
Sigma Society Inauguration Sigma Society Inauguration
Sigma Society Inauguration Shahzeb Pirzada
 
Newton's Ninja - Combat'13
Newton's Ninja - Combat'13Newton's Ninja - Combat'13
Newton's Ninja - Combat'13Shahzeb Pirzada
 
The Open Systems Interconnect (OSI) Model - IS AUDIT
The Open Systems Interconnect (OSI) Model - IS AUDITThe Open Systems Interconnect (OSI) Model - IS AUDIT
The Open Systems Interconnect (OSI) Model - IS AUDITShahzeb Pirzada
 
Process Improvement Techniques - IS AUDIT
Process Improvement Techniques - IS AUDITProcess Improvement Techniques - IS AUDIT
Process Improvement Techniques - IS AUDITShahzeb Pirzada
 
Project Management Certifications - IS AUDIT
Project Management Certifications - IS AUDITProject Management Certifications - IS AUDIT
Project Management Certifications - IS AUDITShahzeb Pirzada
 
Computer Assisted Audit Techniques (CAATS) - IS AUDIT
Computer Assisted Audit Techniques (CAATS) - IS AUDITComputer Assisted Audit Techniques (CAATS) - IS AUDIT
Computer Assisted Audit Techniques (CAATS) - IS AUDITShahzeb Pirzada
 
Certifications on Security - IS AUDIT
Certifications on Security - IS AUDITCertifications on Security - IS AUDIT
Certifications on Security - IS AUDITShahzeb Pirzada
 
Google Advance Searching- Information System Audit & Control Report
Google Advance Searching- Information System Audit & Control ReportGoogle Advance Searching- Information System Audit & Control Report
Google Advance Searching- Information System Audit & Control ReportShahzeb Pirzada
 
Elements of Quality Management System
Elements of Quality Management SystemElements of Quality Management System
Elements of Quality Management SystemShahzeb Pirzada
 
City School Network- Routing & Switching Final Report
City School Network- Routing & Switching Final ReportCity School Network- Routing & Switching Final Report
City School Network- Routing & Switching Final ReportShahzeb Pirzada
 
THE SEVEN HABITS OF HIGHLY EFFECTIVE TEENS
THE SEVEN HABITS OF HIGHLY EFFECTIVE TEENSTHE SEVEN HABITS OF HIGHLY EFFECTIVE TEENS
THE SEVEN HABITS OF HIGHLY EFFECTIVE TEENSShahzeb Pirzada
 
Entrepreneurial Leadership-FINAL REPORT
Entrepreneurial Leadership-FINAL REPORTEntrepreneurial Leadership-FINAL REPORT
Entrepreneurial Leadership-FINAL REPORTShahzeb Pirzada
 
SP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final Report
SP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final ReportSP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final Report
SP STUDENT MANAGEMENT SYSTEM-Human Computer Interaction Final ReportShahzeb Pirzada
 
White collar vs Blue collar
White collar vs Blue collarWhite collar vs Blue collar
White collar vs Blue collarShahzeb Pirzada
 
Story Narration Competition -Script
Story Narration Competition -Script Story Narration Competition -Script
Story Narration Competition -Script Shahzeb Pirzada
 
Declamation Contest Script for Moc
Declamation Contest Script for MocDeclamation Contest Script for Moc
Declamation Contest Script for MocShahzeb Pirzada
 
BOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTBOOTABLE OPERATING SYSTEM PPT
BOOTABLE OPERATING SYSTEM PPTShahzeb Pirzada
 
BOOTABLE OPERATING SYSTEM
BOOTABLE OPERATING SYSTEMBOOTABLE OPERATING SYSTEM
BOOTABLE OPERATING SYSTEMShahzeb Pirzada
 

More from Shahzeb Pirzada (20)

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

Recently uploaded

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisNeo4j
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of ProgrammingMatt Welsh
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfMeon Technology
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageGlobus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandIES VE
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfAMB-Review
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 

Recently uploaded (20)

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 

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).