Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Given the Prolog facts in Example 28, what would Prolog

return given these queries?

a) ?instructor(chan,math273)

b) ?instructor(patel,cs301)

c) ?enrolled(X,cs301)

d) ?enrolled(kiko,Y)

e) ?teaches(grossman,Y)

Short Answer

Expert verified

a) Yes

b) No

c) Juana and Kiko

d) math273 and cs301

e) Juana and Kiko

Step by step solution

01

Prolog return in ?instructor(chan,math273)

Instructor(chan,math273) is a fact given to prolog and Prolog then returns ?instructor(chan,math273) as yes.

02

Prolog return in ?instructor(patel,cs301)

Instructor(patel,cs301) is not a fact given to prolog and Prolog then returns ?Instructor(patel,cs301) as no.

03

Prolog return in ?enrolled(X,cs301)

Prolog will determine every student that is enrolled in cs301

04

Prolog return in ?enrolled(kiko,Y)

Prolog will determine every course that student kiko is enrolled in.

05

Prolog return in ?teaches(grossman,Y)

Prolog will determine the students that the teacher Grossman teaches.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free