logo

Crowdly

Browser

Додати до Chrome

Course 28502

Шукаєте відповіді та рішення тестів для Course 28502? Перегляньте нашу велику колекцію перевірених відповідей для Course 28502 в moodle.royalholloway.ac.uk.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Consider the following knowledge base

represented as a set of Prolog facts:

age(harry,13).

age(draco,14).

age(ron,13).

age(hermione,13).

age(dumbledore,60).

age(hagrid,30).

Which of the following queries return in a single answer

all

the age numbers recorded in the knowledge base? (A solution which returns duplicates is equally acceptable with one that does not).

100%
0%
0%
100%
Переглянути це питання

Consider the following program:

likes(marie, pizza).

likes(marco, pizza).

likes(Person, pizza) :- italian(Person).

italian(marco).

 

What would the output of the following

query be?

?- setof(Person, likes(Person, pizza), Persons).

 

100%
0%
0%
0%
Переглянути це питання

Consider the following Prolog program:

       

all_0s([ ]).

       

all_0s([0|Tail]) :- all_0s(Tail).

We query the above program with the

following goal:

                          ?-

all_0s([0, 0,

1, 0]). 

Which

of the following are possible derived queries for this goal?

0%
100%
100%
0%
Переглянути це питання

Which of the following is not

a

valid constant in Prolog?

0%
0%
100%
0%
Переглянути це питання

Which of the following pairs of terms can unify?

A) cd(29, beatles, sgt_pepper).

     cd(A,B, help).

B) f(foo, _).

     f(A1, bar).

0%
0%
0%
100%
Переглянути це питання

Choose all the queries that will not

succeed.

100%
0%
0%
100%
Переглянути це питання

Consider the following program:

likes(marie, pizza).

likes(marco, pizza).

likes(Person, pizza) :- italian(Person).

italian(marco).

What would the output of the following

query be?

?- findall(Person, likes(Person, pizza), Persons).

0%
100%
0%
0%
Переглянути це питання

If the query below is executed in Prolog:

?- [X|L] = [1,2,3,4,5].

which of the following instantiations correspond

to the right answer?

0%
0%
0%
100%
Переглянути це питання

Which of the following programs represent

the specification:

p holds if q and r hold; otherwise, if q

does not hold p holds if s holds.

0%
100%
100%
Переглянути це питання

Consider the following Prolog program:

teaches(chris, history).

teaches(chris, english).

teaches(chris, drama).

teaches(maria, physics).              

studies(alice, english).

studies(jake, english).

studies(emily, drama).

studies(alex, physics).

What is an expected output of the query

below, which uses a cut (!)?

?- teaches(chris, Course), !, studies(Student, Course).

0%
100%
0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.royalholloway.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome