SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
Write a Prolog program that implements a simple knowledge base for a pet store. Your program
should allow the user to define facts about pets, such as their name, species, and age, and should
be able to answer queries about these facts. Your program should include the following
predicates: pet(Name, Species, Age) (1 point) : This predicate should be true if a pet with the
given Name, Species, and Age exists in the pet store. species(Species, Count) ( 2 points) : This
predicate should be true if there are Count pets of the given Species in the pet store.
age_range(MinAge, MaxAge, Count) ( 3 points) : This predicate should be true if there are
Count pets in the pet store whose age is between MinAge and MaxAge. Your program should
include the following facts about pets in the pet store: pet(fido, dog, 3). pet(spot, dog, 5).
pet(mittens, cat, 2). pet(tweety, bird, 1). male(fido). male(spot). female(mittens).

Mais conteúdo relacionado

Mais de santosha5446

Which of the following is a motvation for visiting Culture Heritage V.pdf
 Which of the following is a motvation for visiting Culture Heritage V.pdf Which of the following is a motvation for visiting Culture Heritage V.pdf
Which of the following is a motvation for visiting Culture Heritage V.pdf
santosha5446
 
Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
 Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
santosha5446
 

Mais de santosha5446 (20)

Which of the following statements about cloud computing is incorrect.pdf
 Which of the following statements about cloud computing is incorrect.pdf Which of the following statements about cloud computing is incorrect.pdf
Which of the following statements about cloud computing is incorrect.pdf
 
Which one of the following statements is incorrect A. There are tw.pdf
 Which one of the following statements is incorrect A. There are tw.pdf Which one of the following statements is incorrect A. There are tw.pdf
Which one of the following statements is incorrect A. There are tw.pdf
 
Which of the following kinds of speech is given the most protection b.pdf
 Which of the following kinds of speech is given the most protection b.pdf Which of the following kinds of speech is given the most protection b.pdf
Which of the following kinds of speech is given the most protection b.pdf
 
Wildhorse Corporation provides the following information about its de.pdf
 Wildhorse Corporation provides the following information about its de.pdf Wildhorse Corporation provides the following information about its de.pdf
Wildhorse Corporation provides the following information about its de.pdf
 
Which of the following circumstances may lead to concern when analyzi.pdf
 Which of the following circumstances may lead to concern when analyzi.pdf Which of the following circumstances may lead to concern when analyzi.pdf
Which of the following circumstances may lead to concern when analyzi.pdf
 
Which of the following is a motvation for visiting Culture Heritage V.pdf
 Which of the following is a motvation for visiting Culture Heritage V.pdf Which of the following is a motvation for visiting Culture Heritage V.pdf
Which of the following is a motvation for visiting Culture Heritage V.pdf
 
Your Block class should exhibit the following features. Public child .pdf
 Your Block class should exhibit the following features. Public child .pdf Your Block class should exhibit the following features. Public child .pdf
Your Block class should exhibit the following features. Public child .pdf
 
Your are assigned to dentify the self-actualization need in UDEMY w.pdf
 Your are assigned to dentify the self-actualization need in UDEMY w.pdf Your are assigned to dentify the self-actualization need in UDEMY w.pdf
Your are assigned to dentify the self-actualization need in UDEMY w.pdf
 
You are to address the questions in each of the following problems. 1.pdf
 You are to address the questions in each of the following problems. 1.pdf You are to address the questions in each of the following problems. 1.pdf
You are to address the questions in each of the following problems. 1.pdf
 
Which of the following is FALSE about RBC contain a dimer of spectri.pdf
 Which of the following is FALSE about RBC contain a dimer of spectri.pdf Which of the following is FALSE about RBC contain a dimer of spectri.pdf
Which of the following is FALSE about RBC contain a dimer of spectri.pdf
 
Yoo hove learned obout the various straceyies thint companies underta.pdf
 Yoo hove learned obout the various straceyies thint companies underta.pdf Yoo hove learned obout the various straceyies thint companies underta.pdf
Yoo hove learned obout the various straceyies thint companies underta.pdf
 
Xavier and his wife Maria have total W-2 income of $96,002. They will.pdf
 Xavier and his wife Maria have total W-2 income of $96,002. They will.pdf Xavier and his wife Maria have total W-2 income of $96,002. They will.pdf
Xavier and his wife Maria have total W-2 income of $96,002. They will.pdf
 
Which of the following are potential medical consequences that can re.pdf
 Which of the following are potential medical consequences that can re.pdf Which of the following are potential medical consequences that can re.pdf
Which of the following are potential medical consequences that can re.pdf
 
Write a short response explaining in detail steps to compute for endi.pdf
 Write a short response explaining in detail steps to compute for endi.pdf Write a short response explaining in detail steps to compute for endi.pdf
Write a short response explaining in detail steps to compute for endi.pdf
 
Write a Matlab function f which takes a quadratic matrix A and a scal.pdf
 Write a Matlab function f which takes a quadratic matrix A and a scal.pdf Write a Matlab function f which takes a quadratic matrix A and a scal.pdf
Write a Matlab function f which takes a quadratic matrix A and a scal.pdf
 
Write a program that counts the number of characters and lines in the.pdf
 Write a program that counts the number of characters and lines in the.pdf Write a program that counts the number of characters and lines in the.pdf
Write a program that counts the number of characters and lines in the.pdf
 
Which of the following are likely to directly promote mRNA degradatio.pdf
 Which of the following are likely to directly promote mRNA degradatio.pdf Which of the following are likely to directly promote mRNA degradatio.pdf
Which of the following are likely to directly promote mRNA degradatio.pdf
 
Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
 Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
Word� balatn. Exp19_Word_Intro_Cap_Thinking.docx adl dosyay indiri.pdf
 
Which of the following accounts for the fluid aspect of the fluid mos.pdf
 Which of the following accounts for the fluid aspect of the fluid mos.pdf Which of the following accounts for the fluid aspect of the fluid mos.pdf
Which of the following accounts for the fluid aspect of the fluid mos.pdf
 
Which of the below statements is correct for P3 The packet is delete.pdf
 Which of the below statements is correct for P3 The packet is delete.pdf Which of the below statements is correct for P3 The packet is delete.pdf
Which of the below statements is correct for P3 The packet is delete.pdf
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 

Último (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Write a Prolog program that implements a simple knowledge base for a .pdf

  • 1. Write a Prolog program that implements a simple knowledge base for a pet store. Your program should allow the user to define facts about pets, such as their name, species, and age, and should be able to answer queries about these facts. Your program should include the following predicates: pet(Name, Species, Age) (1 point) : This predicate should be true if a pet with the given Name, Species, and Age exists in the pet store. species(Species, Count) ( 2 points) : This predicate should be true if there are Count pets of the given Species in the pet store. age_range(MinAge, MaxAge, Count) ( 3 points) : This predicate should be true if there are Count pets in the pet store whose age is between MinAge and MaxAge. Your program should include the following facts about pets in the pet store: pet(fido, dog, 3). pet(spot, dog, 5). pet(mittens, cat, 2). pet(tweety, bird, 1). male(fido). male(spot). female(mittens).