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


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
Get step-by-step solutions from verified subject matter experts
