Home » CSCI 421 Representing Relations in Prolog Questions

CSCI 421 Representing Relations in Prolog Questions

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.3. Represent the following in Prolog:a) Butch is a killer.b) Mia and Marsellus are married.c) Zed is dead.d) Marsellus kills everyone who gives Mia a foot massage.e) Mia loves everyone who is a good dancer.f) Jules eats anything that is nutritious or tasty.4. Murder MysteryFour guests (Colonel Mustard, Professor Plum, Miss Scarlett, Ms. Green) attend a dinner party at the home of Mr. Boddy. Suddenly, the lights go out!When they come back, Mr. Boddy lies dead in the middle of the table.Everyone is a suspect.Upon further examination, the following facts come to light:- Mr. Boddy was having an affair with Ms. Green.- Professor Plum is married to Ms. Green.- Mr. Boddy was very rich.- Colonel Mustard is very greedy.- Miss Scarlett was also having an affair with Mr. Boddy.There are two possible motives for the murder: hatred and greed. Someone hates someone else if that other person is having an affair with his/her spouse. Someone is willing to commit murder if he/she is greedy and not rich, and the victim is rich.Who are the suspects?

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 30% with the discount code ESSAYHELP