ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions

Higher Computing Science 2015 Question 4 (CfE)

2 marks · Programming paradigms

One feature of a declarative language is the use of facts. Three facts are shown in lines one to three below: Line 1 human(einstein). Line 2 human(pascal). Line 3 human(lovelace). Line 4 mortal(X):-human(X). State the feature being used in line 4 and explain a benefit of its use.

Marking scheme

Feature • Rule • Uses capital letter to identify variables to allow for instantiation Benefits • Adds information/meaning based on other facts/rules • Reduces need for repetition of facts/rules or improves efficiency by reducing code • Facilitates queries • Use of variables allow values to be returned • Any other valid Any 2 bullet – 1 mark each

Previous question: Higher Computing Science 2015 Question 3 (CfE)

Next question: Higher Computing Science 2015 Question 5 (CfE)