logo

Crowdly

Browser

Додати до Chrome

Course 28502

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

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

Consider the following program which finds the larger of two numbers:

larger(X,Y,Z):- X>Y, !, Z=X.

larger(X,Y,Y):- X \= Y.

Which of the following queries return true?

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

Attempting to unify in Prolog an expression

of the form 

X = f(X)

results in the “occurs check”.

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

Consider the following Prolog program:

 

parent_of(john,mary).

parent_of(john,peter).

parent_of(susan,mary).

What is the result of the following query?

?- findall(X, parent_of(john,X), L).

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

Consider the following Prolog program:

 

 

choose(a) :- !.

choose(b).

 

What answers does Prolog produce for the query?

 

 

?- choose(X).

 

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

Consider the following Prolog program:

 

parent_of(john,mary).

parent_of(john,peter).

parent_of(susan,mary).

ancestor_of(X,Y) :- parent_of(X,Y).

ancestor_of(X,Y) :- parent_of(X,Z), ancestor_of(Z,Y).

 

The query below produces exactly two answers.

?- ancestor_of(john,Y).

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

Which of the following Prolog goals succeed (i.e., unify successfully)?

Select all that apply.

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

What is the result of the following query?

 

?- f(Y,Y,Y) = f(a,b,c).

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

Select the valid Prolog rules from the list below:

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

Please select which facts below will not cause a Prolog syntax error:

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

Consider the following Prolog rule:

 

ancestor_of(X,Y) :- parent_of(X,Y).

 

and the query:

 

 

?- ancestor_of(john,Z).

 

Which query is derived after unification of the above query with the rule head?

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

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

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

Browser

Додати до Chrome