Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the Prolog program (see images below) to answer the following questions: A) Prolog is said to run under the closed world assumption - what

image text in transcribed

image text in transcribed

Consider the Prolog program (see images below) to answer the following questions: A) Prolog is said to run under the closed world assumption - what does this mean? Can you give an example from this program showing it is the case? B) What will the query '?- baby (x), logical(x).' return? What would you say is the difference between the way you processed that question and the way Prolog would have processed it? C) What will the query '?- own (jean, tabitha) return? Why? D) The query?- all pets_in_danger (ListofPets). returns L = [tabitha, tabitha, tabitha, tabitha, tabitha, tabitha, tabitha, tabitha, sherryLinda].' There are 2 bugs here: 1- There should not be so many duplicates of "tabitha': D1) What do you think is making it so in the code? How you would fix it? 2- 'blacky' should be part of the list: D2) What is the bug in the code that prevents "blacky' from appearing in the list? 14 15 16 17 18 19 28 21 22 23 24 25 26 27 28 29 38 31 32 33 34 35 36 37 38 39 40 41 42 person(Lauren). person(hugo). person(esther). person(nadeleine). person(anselne). person(genevieve). person(jean). chicken(blacky). chicken(hoper). chicken(twinkle). chicken(night). chicken(sherryLinda). cat(tabitha). 57 58 59 60 61 62 63 64 65 66 logical(x) :- person(x), age (X,A), A > 6. baby(x) :- person(x), age(x,A), A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions