SlideShare a Scribd company logo
Then we need the rules that will allow for the queries that will answer the following:
Find the Father of any of the man.
Find the Sons of any man
Find the Grandfather of any of the man
Find the Mother of any man.
Display a list of all the pairs of siblings.
Display a list of all the men.
in my program the
findson and list_siblings predicates care not working
find son should look like
findson(jacob).
and then list all of jacobs sons
list_siblings should look like
perez and zerah are siblings. judah and reuban are siblings, etc....
please use this code to modify and include it in your answer :) i dont want to make too much of a
drastic change unless necessary.
gender(male,[abraham, isaac, jacob,judah, reuben, simeon, levi, dan, naphtali, gad, asher,
issachar, zebulun, joseph, benjamin, perez, zerah, hezron, ram,amminadab,nahshon,
salmon,
boaz, obed, jesse, david, solomon, rehoboam, abijah, asa, jehoshaphat, jehoram,
uzziah,jotham,ahaz,
hezehiah, manasseh, amon,
josiah,jeconiah,shealtiel,zerubbabel,abihud,eliakim,azor,zadok,akim,
elihud, eleazar,matthan,jacob,joseph,jesus]).
gender(female,[dinah,tamar,rahab,ruth,bathsheeba,mary]).
%father facts
father(abraham, isaac).
father(isaac, jacob).
father(jacob, judah).
father(jacob, reuben).
father(jacob, simeon).
father(jacob, levi).
father(jacob, dan).
father(jacob, naphtali).
father(jacob, gad).
father(jacob, asher).
father(jacob, issachar).
father(jacob, zebulun).
father(jacob, dinah).
father(jacob, joseph).
father(jacob, benjamin).
father(judah, perez).
father(judah, zerah).
father(perez, hezron).
father(herzon, ram).
father(ram, amminadab).
father(amminadab, nahshon).
father(nahshon, salmon).
father(salmon, boaz).
father(boaz, obed).
father(obed, jesse).
father(jesse, david).
father(david, solomon).
father(solomon, rehoboam).
father(rehoboam, abijah).
father(abijah, asa).
father(asa, jehoshaphat).
father(jehoshaphat, jehoram).
father(jehoram, uzziah).
father(uzziah, jotham).
father(jotham, ahaz).
father(ahaz, hezekiah).
father(hezekiah, manasseh).
father(manasseh, amon).
father(amon, josiah).
father(josiah, jeconiah).
father(jeconiah, shealtiel).
father(shealtiel, zerubbabel).
father(zerubbabel, abihud).
father(abihud, eliakim).
father(eliakim, azor).
father(azor, zadok).
father(zadok, akim).
father(akim, elihud).
father(elihud, eleazar).
father(eleazar, matthan).
father(matthan, jacobNew).%New for new Testement - fixes duplicates
father(jacobNew, josephNew).
father(josephNew, jesus).
%mother facts
mother(tamar, zerah).
mother(tamar, perez).
mother(rahab, boaz).
mother(ruth, obed).
mother(bathsheeba, solomon).
mother(mary, jesus).
sibling(X, Y) :- father(Z, X), father(Z, Y), X = Y.
sibling(X, Y) :- mother(Z, X), mother(Z, Y), X = Y.
grandfather(X, Y) :- father(X, Z), father(Z, Y).
grandfather(X, Y) :- father(X, Z), mother(Z, Y).
son(X, Y) :- father(Y, X).
son(X, Y) :- mother(Y, X).
findson(X):-father(X,Y), siblings(Y,Z), format("~w are the sons of ~w",[Z,X]). %find multiple
sons
findfather(X) :- father(Y, X), write(Y), write(' is the father of '), write(X), nl.
findsons(X) :- son(Y, X), write(Y), write(' is a son of '), write(X), nl.
findgrandfather(X) :- grandfather(Y, X), write(Y), write(' is the grandfather of '), write(X), nl.
findmother(X) :- mother(Y, X), write(Y), write(' is the mother of '), write(X), nl.
list_siblings :- sibling(X, Y), write(X), write(' and '), write(Y), write(' are siblings.'), nl.
displaymales:- X = male,format("The males are:n"),forall(gender(X,Y),writeln(Y)).%displays
all males.
displayfemales:- Y = female,format("The females
are:n"),forall(gender(Y,X),writeln(X)).%displays all females.

More Related Content

More from ambikagarmentsjdp

There is no more information provided to me other then what i alread.pdf
There is no more information provided to me other then what i alread.pdfThere is no more information provided to me other then what i alread.pdf
There is no more information provided to me other then what i alread.pdf
ambikagarmentsjdp
 
There is no more information provided to me. Determine the value of .pdf
There is no more information provided to me. Determine the value of .pdfThere is no more information provided to me. Determine the value of .pdf
There is no more information provided to me. Determine the value of .pdf
ambikagarmentsjdp
 
There is a period between when animals become infected and when they.pdf
There is a period between when animals become infected and when they.pdfThere is a period between when animals become infected and when they.pdf
There is a period between when animals become infected and when they.pdf
ambikagarmentsjdp
 
There is a link between security and quality.1. Examine the relati.pdf
There is a link between security and quality.1. Examine the relati.pdfThere is a link between security and quality.1. Examine the relati.pdf
There is a link between security and quality.1. Examine the relati.pdf
ambikagarmentsjdp
 
There are advantages to buying an existing business. Which of the fo.pdf
There are advantages to buying an existing business. Which of the fo.pdfThere are advantages to buying an existing business. Which of the fo.pdf
There are advantages to buying an existing business. Which of the fo.pdf
ambikagarmentsjdp
 
There are different types of Intrusion DetectionPrevention Systems..pdf
There are different types of Intrusion DetectionPrevention Systems..pdfThere are different types of Intrusion DetectionPrevention Systems..pdf
There are different types of Intrusion DetectionPrevention Systems..pdf
ambikagarmentsjdp
 
There are 4200 college instructors in Canada that teach at local com.pdf
There are 4200 college instructors in Canada that teach at local com.pdfThere are 4200 college instructors in Canada that teach at local com.pdf
There are 4200 college instructors in Canada that teach at local com.pdf
ambikagarmentsjdp
 
The X axis shows how far away from the equator the population lives..pdf
The X axis shows how far away from the equator the population lives..pdfThe X axis shows how far away from the equator the population lives..pdf
The X axis shows how far away from the equator the population lives..pdf
ambikagarmentsjdp
 
The World Values Survey interviewed a random sample of people from n.pdf
The World Values Survey interviewed a random sample of people from n.pdfThe World Values Survey interviewed a random sample of people from n.pdf
The World Values Survey interviewed a random sample of people from n.pdf
ambikagarmentsjdp
 
The Yellow Company made year-end adjusting entries affecting each of.pdf
The Yellow Company made year-end adjusting entries affecting each of.pdfThe Yellow Company made year-end adjusting entries affecting each of.pdf
The Yellow Company made year-end adjusting entries affecting each of.pdf
ambikagarmentsjdp
 
The Worst Part Was That She Often Was Right. The Winston County Bank.pdf
The Worst Part Was That She Often Was Right. The Winston County Bank.pdfThe Worst Part Was That She Often Was Right. The Winston County Bank.pdf
The Worst Part Was That She Often Was Right. The Winston County Bank.pdf
ambikagarmentsjdp
 
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdfThe Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
ambikagarmentsjdp
 
The West Coast City (City) had a staff of 7325 with an annual budget.pdf
The West Coast City (City) had a staff of 7325 with an annual budget.pdfThe West Coast City (City) had a staff of 7325 with an annual budget.pdf
The West Coast City (City) had a staff of 7325 with an annual budget.pdf
ambikagarmentsjdp
 
The task is to match the phrases with the concepts.Group of answer.pdf
The task is to match the phrases with the concepts.Group of answer.pdfThe task is to match the phrases with the concepts.Group of answer.pdf
The task is to match the phrases with the concepts.Group of answer.pdf
ambikagarmentsjdp
 
The University of the East Europe is interested in the overall perfo.pdf
The University of the East Europe is interested in the overall perfo.pdfThe University of the East Europe is interested in the overall perfo.pdf
The University of the East Europe is interested in the overall perfo.pdf
ambikagarmentsjdp
 
The user name and password for the database connection is embedded i.pdf
The user name and password for the database connection is embedded i.pdfThe user name and password for the database connection is embedded i.pdf
The user name and password for the database connection is embedded i.pdf
ambikagarmentsjdp
 
The United States federal government is currently concerned with enc.pdf
The United States federal government is currently concerned with enc.pdfThe United States federal government is currently concerned with enc.pdf
The United States federal government is currently concerned with enc.pdf
ambikagarmentsjdp
 
The U.S. government funds deficit spending byissuing bondsselli.pdf
The U.S. government funds deficit spending byissuing bondsselli.pdfThe U.S. government funds deficit spending byissuing bondsselli.pdf
The U.S. government funds deficit spending byissuing bondsselli.pdf
ambikagarmentsjdp
 
The question is for genetics Cross together two double heterozygous.pdf
The question is for genetics  Cross together two double heterozygous.pdfThe question is for genetics  Cross together two double heterozygous.pdf
The question is for genetics Cross together two double heterozygous.pdf
ambikagarmentsjdp
 
The total mass of all living things on Earth is 545 Gigatons.Part .pdf
The total mass of all living things on Earth is 545 Gigatons.Part .pdfThe total mass of all living things on Earth is 545 Gigatons.Part .pdf
The total mass of all living things on Earth is 545 Gigatons.Part .pdf
ambikagarmentsjdp
 

More from ambikagarmentsjdp (20)

There is no more information provided to me other then what i alread.pdf
There is no more information provided to me other then what i alread.pdfThere is no more information provided to me other then what i alread.pdf
There is no more information provided to me other then what i alread.pdf
 
There is no more information provided to me. Determine the value of .pdf
There is no more information provided to me. Determine the value of .pdfThere is no more information provided to me. Determine the value of .pdf
There is no more information provided to me. Determine the value of .pdf
 
There is a period between when animals become infected and when they.pdf
There is a period between when animals become infected and when they.pdfThere is a period between when animals become infected and when they.pdf
There is a period between when animals become infected and when they.pdf
 
There is a link between security and quality.1. Examine the relati.pdf
There is a link between security and quality.1. Examine the relati.pdfThere is a link between security and quality.1. Examine the relati.pdf
There is a link between security and quality.1. Examine the relati.pdf
 
There are advantages to buying an existing business. Which of the fo.pdf
There are advantages to buying an existing business. Which of the fo.pdfThere are advantages to buying an existing business. Which of the fo.pdf
There are advantages to buying an existing business. Which of the fo.pdf
 
There are different types of Intrusion DetectionPrevention Systems..pdf
There are different types of Intrusion DetectionPrevention Systems..pdfThere are different types of Intrusion DetectionPrevention Systems..pdf
There are different types of Intrusion DetectionPrevention Systems..pdf
 
There are 4200 college instructors in Canada that teach at local com.pdf
There are 4200 college instructors in Canada that teach at local com.pdfThere are 4200 college instructors in Canada that teach at local com.pdf
There are 4200 college instructors in Canada that teach at local com.pdf
 
The X axis shows how far away from the equator the population lives..pdf
The X axis shows how far away from the equator the population lives..pdfThe X axis shows how far away from the equator the population lives..pdf
The X axis shows how far away from the equator the population lives..pdf
 
The World Values Survey interviewed a random sample of people from n.pdf
The World Values Survey interviewed a random sample of people from n.pdfThe World Values Survey interviewed a random sample of people from n.pdf
The World Values Survey interviewed a random sample of people from n.pdf
 
The Yellow Company made year-end adjusting entries affecting each of.pdf
The Yellow Company made year-end adjusting entries affecting each of.pdfThe Yellow Company made year-end adjusting entries affecting each of.pdf
The Yellow Company made year-end adjusting entries affecting each of.pdf
 
The Worst Part Was That She Often Was Right. The Winston County Bank.pdf
The Worst Part Was That She Often Was Right. The Winston County Bank.pdfThe Worst Part Was That She Often Was Right. The Winston County Bank.pdf
The Worst Part Was That She Often Was Right. The Winston County Bank.pdf
 
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdfThe Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
The Western Spruce Budworm, Choristoneura occidentalis Freeman, is a.pdf
 
The West Coast City (City) had a staff of 7325 with an annual budget.pdf
The West Coast City (City) had a staff of 7325 with an annual budget.pdfThe West Coast City (City) had a staff of 7325 with an annual budget.pdf
The West Coast City (City) had a staff of 7325 with an annual budget.pdf
 
The task is to match the phrases with the concepts.Group of answer.pdf
The task is to match the phrases with the concepts.Group of answer.pdfThe task is to match the phrases with the concepts.Group of answer.pdf
The task is to match the phrases with the concepts.Group of answer.pdf
 
The University of the East Europe is interested in the overall perfo.pdf
The University of the East Europe is interested in the overall perfo.pdfThe University of the East Europe is interested in the overall perfo.pdf
The University of the East Europe is interested in the overall perfo.pdf
 
The user name and password for the database connection is embedded i.pdf
The user name and password for the database connection is embedded i.pdfThe user name and password for the database connection is embedded i.pdf
The user name and password for the database connection is embedded i.pdf
 
The United States federal government is currently concerned with enc.pdf
The United States federal government is currently concerned with enc.pdfThe United States federal government is currently concerned with enc.pdf
The United States federal government is currently concerned with enc.pdf
 
The U.S. government funds deficit spending byissuing bondsselli.pdf
The U.S. government funds deficit spending byissuing bondsselli.pdfThe U.S. government funds deficit spending byissuing bondsselli.pdf
The U.S. government funds deficit spending byissuing bondsselli.pdf
 
The question is for genetics Cross together two double heterozygous.pdf
The question is for genetics  Cross together two double heterozygous.pdfThe question is for genetics  Cross together two double heterozygous.pdf
The question is for genetics Cross together two double heterozygous.pdf
 
The total mass of all living things on Earth is 545 Gigatons.Part .pdf
The total mass of all living things on Earth is 545 Gigatons.Part .pdfThe total mass of all living things on Earth is 545 Gigatons.Part .pdf
The total mass of all living things on Earth is 545 Gigatons.Part .pdf
 

Recently uploaded

Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 

Recently uploaded (20)

Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 

Then we need the rules that will allow for the queries that will ans.pdf

  • 1. Then we need the rules that will allow for the queries that will answer the following: Find the Father of any of the man. Find the Sons of any man Find the Grandfather of any of the man Find the Mother of any man. Display a list of all the pairs of siblings. Display a list of all the men. in my program the findson and list_siblings predicates care not working find son should look like findson(jacob). and then list all of jacobs sons list_siblings should look like perez and zerah are siblings. judah and reuban are siblings, etc.... please use this code to modify and include it in your answer :) i dont want to make too much of a drastic change unless necessary. gender(male,[abraham, isaac, jacob,judah, reuben, simeon, levi, dan, naphtali, gad, asher, issachar, zebulun, joseph, benjamin, perez, zerah, hezron, ram,amminadab,nahshon, salmon, boaz, obed, jesse, david, solomon, rehoboam, abijah, asa, jehoshaphat, jehoram, uzziah,jotham,ahaz, hezehiah, manasseh, amon, josiah,jeconiah,shealtiel,zerubbabel,abihud,eliakim,azor,zadok,akim, elihud, eleazar,matthan,jacob,joseph,jesus]). gender(female,[dinah,tamar,rahab,ruth,bathsheeba,mary]). %father facts father(abraham, isaac). father(isaac, jacob). father(jacob, judah). father(jacob, reuben). father(jacob, simeon). father(jacob, levi). father(jacob, dan). father(jacob, naphtali).
  • 2. father(jacob, gad). father(jacob, asher). father(jacob, issachar). father(jacob, zebulun). father(jacob, dinah). father(jacob, joseph). father(jacob, benjamin). father(judah, perez). father(judah, zerah). father(perez, hezron). father(herzon, ram). father(ram, amminadab). father(amminadab, nahshon). father(nahshon, salmon). father(salmon, boaz). father(boaz, obed). father(obed, jesse). father(jesse, david). father(david, solomon). father(solomon, rehoboam). father(rehoboam, abijah). father(abijah, asa). father(asa, jehoshaphat). father(jehoshaphat, jehoram). father(jehoram, uzziah). father(uzziah, jotham). father(jotham, ahaz). father(ahaz, hezekiah). father(hezekiah, manasseh). father(manasseh, amon). father(amon, josiah). father(josiah, jeconiah). father(jeconiah, shealtiel). father(shealtiel, zerubbabel). father(zerubbabel, abihud). father(abihud, eliakim).
  • 3. father(eliakim, azor). father(azor, zadok). father(zadok, akim). father(akim, elihud). father(elihud, eleazar). father(eleazar, matthan). father(matthan, jacobNew).%New for new Testement - fixes duplicates father(jacobNew, josephNew). father(josephNew, jesus). %mother facts mother(tamar, zerah). mother(tamar, perez). mother(rahab, boaz). mother(ruth, obed). mother(bathsheeba, solomon). mother(mary, jesus). sibling(X, Y) :- father(Z, X), father(Z, Y), X = Y. sibling(X, Y) :- mother(Z, X), mother(Z, Y), X = Y. grandfather(X, Y) :- father(X, Z), father(Z, Y). grandfather(X, Y) :- father(X, Z), mother(Z, Y). son(X, Y) :- father(Y, X). son(X, Y) :- mother(Y, X). findson(X):-father(X,Y), siblings(Y,Z), format("~w are the sons of ~w",[Z,X]). %find multiple sons findfather(X) :- father(Y, X), write(Y), write(' is the father of '), write(X), nl. findsons(X) :- son(Y, X), write(Y), write(' is a son of '), write(X), nl. findgrandfather(X) :- grandfather(Y, X), write(Y), write(' is the grandfather of '), write(X), nl. findmother(X) :- mother(Y, X), write(Y), write(' is the mother of '), write(X), nl. list_siblings :- sibling(X, Y), write(X), write(' and '), write(Y), write(' are siblings.'), nl. displaymales:- X = male,format("The males are:n"),forall(gender(X,Y),writeln(Y)).%displays all males. displayfemales:- Y = female,format("The females are:n"),forall(gender(Y,X),writeln(X)).%displays all females.