Question 2(b) 2018 · October-November · Paper 42 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 1
ma
Show text version of question
Question 2
Part (b)
Question 2
A declarative language is used to represent facts and rules about dogs that perform tasks to help
people.
01 type(pointer, gundog). 02 type(flushing, gundog). 03 type(retriever, gundog). 04 05 is_a(labrador, retriever). 06 is_a(newfoundland, retriever). 07 is_a(cocker_spaniel, flushing). 08 is_a(springer_spaniel, flushing). 09 is_a(king_charles, flushing). 10 is_a(english_setter, pointer). 11 is_a(irish_setter, pointer).
Question 12
13 fav_bird(pointer, grouse). 14 fav_bird(flushing, pheasant). 15 fav_bird(retriever, waterfowl).
Question 16
17 type(X, Y) IF is_a(Z, X) AND type(Z, Y).
These clauses have the following meaning:
Clause Explanation 01 A pointer is a type of gundog. 05 A labrador is an example of a retriever. 13 The favourite bird of a pointer is a grouse. 17 X is a type of Y if Z is an example of X and Z is a type of Y.
Part (b)
Using the variable P, the goal
is_a(P, retriever)
returns
P = labrador, newfoundland
Write the result returned by the goal
is_a(H, pointer)
H = ......................................................................................................................................
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_w18_qp_42.pdf
