Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 (20 pts) Queries in Prolog Assume we have the following database in a Prolog program: course( hit transfer, mechanical). course(web_design.computer). course(design methods, fine-arts).

image text in transcribedimage text in transcribed

Question 3 (20 pts) Queries in Prolog Assume we have the following database in a Prolog program: course( hit transfer, mechanical). course(web_design.computer). course(design methods, fine-arts). course(poetry, literature) course(leadership, management). course(biology.medicin). lab number(mechanical,15). lab _number(fine_arts, 10). lab _number(X, Z) :-course(X, Y), lab number(Y, Z). field(mechanical,engineering). field(computer, engineering) field(fine-arts, art). field(literature, social). field(management, buisiness). field(X, Y)cours(X, Z), field(Z, Y). student(anna, hit _transfer). student(daniel, hit transfer). student(adrian, web_design). student(ava, design methods). student(jack, poetry). student(lee, leadership). student(X, Y):- field(Z, Y), student(X, Z). student(X)- student(X_). Determine the type of each of the following queries (groundon-ground), and explain what will Prolog respond for each of these queries (write all the steps of unifications and resolutions for each query)? ? field(hit transfer,engineering). ? lab number(fine arts,X). ? field(computer, literature). ? course(X,Y). ? student(adrian). ? student(anna, engineering). ?student(X, engineering) ? student(X,fine-arts), course(fine arts, Y ? fieldX) ? lab_number_X), field(X,Y). ? lab_number(X,15), field(X,Y). ? student(X), , student(X,-). % note to cut here ? student(X), student(X,), !. ? course(X,-), l+ student(-X), %1+ is for negation (not)

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

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions