Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Suppose we are working with the following knowledge base: wizard(ron). wizard(X) :- hasBroom(X),hasWand(X). hasWand(harry). quidditchPlayer(harry). hasBroom(X) :- quidditchPlayer(X). How does Prolog respond to the

1) Suppose we are working with the following knowledge base: wizard(ron). wizard(X) :- hasBroom(X),hasWand(X). hasWand(harry). quidditchPlayer(harry). hasBroom(X) :- quidditchPlayer(X).

How does Prolog respond to the following queries? 1) wizard(ron). 2) witch(ron). 3) wizard(hermione). 4) witch(hermione). 5) wizard(harry). 6) wizard(Y). 7) witch(Y).

2) Here is a tiny lexicon and mini grammar with only one rule which defines a sentence as consisting of five words: an article, a noun, a verb, and again an article and a noun. word(article,a). word(article,every). word(noun,criminal). word(noun,'big kahuna burger'). word(verb,eats). word(verb,likes). sentence(Word1,Word2,Word3,Word4,Word5) :- word(article,Word1), word(noun,Word2), word(verb,Word3), word(article,Word4), word(noun,Word5). 1) What query do you have to pose in order to find out which sentences the grammar can generate? 2) List the first five sentences that this grammar can generate in the order Prolog will generate them. Make sure that you understand why Prolog generates them in this order.

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

How would you rank the others?

Answered: 1 week ago

Question

Which is the best idea?

Answered: 1 week ago

Question

Which is the worst idea? Why?

Answered: 1 week ago