logo

Crowdly

Browser

Add to Chrome

Course 28502

Looking for Course 28502 test answers and solutions? Browse our comprehensive collection of verified answers for Course 28502 at moodle.royalholloway.ac.uk.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Consider the following Prolog knowledge base:

 

bird(tweety).

bird(polly).

penguin(pingu).

can_fly(X) :- bird(X), \+ penguin(X).

 

For each of the following queries, select all queries that fail (i.e., Prolog answers false.).

100%
0%
100%
100%
0%
View this question

Consider the following Prolog program:

p(a).

p(b).

q(a).

q(b).

r(X,Y) :- p(X), !, q(Y).

What answers are produced by the following query?

 

?- r(X,Y).

0%
0%
0%
100%
View this question

Consider the following Prolog program:

test(X,Y) :-

     ( X > 0 -> Y = positive ; Y = nonpositive ).

What value(s), if any, will be returned for Y by the following query?

?- test(3,Y).

100%
0%
0%
0%
View this question

The Prolog goal \+ Goal succeeds when Prolog cannot prove Goal.

100%
0%
View this question

Consider the following query:

 

?- setof(X, member(X,[b,a,c,a]), L).

What is the value of L?

0%
0%
100%
0%
View this question

Prolog is a typed language because it supports argument mode annotations. For example, in a predicate specification such as ancestor(+Person, ?Ancestor)+Person means that Person must be instantiated at the time of the call, and +Ancestor means that Ancestor may be either input or output.

0%
100%
View this question

Prolog is a functional programming language because programs consist of rules that define how outputs are computed from inputs.

0%
100%
View this question

Want instant access to all verified answers on moodle.royalholloway.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome