Professional Documents
Culture Documents
David Callear
University of Portsmouth
Department of Information Systems
Burnaby Terrace, PO1 3AE
David.Callear@port.ac.uk
http://www.dis.port.ac.uk/~callear
ABSTRACT
Prolog (Programming in Logic) is the language of
Artificial Intelligence (AI), and is renowned as a
difficult language to learn. It embodies a
programming paradigm that is radically different
from the usual procedural languages, and even
students who find other languages easy can
struggle with Prolog. It is so different that students
have to learn it as a completely new experience,
even if they have reached a competent level in
procedural languages.
Recently more programming paradigms have made
an appearance. Currently there is a fashion for
teaching Java, much sought-after by students, who
see it as the internet language, but found very
difficult when they come to learn it, especially if they
encounter it as a first language.
This paper outlines some strategies that have been
found successful with Prolog, and extrapolates them
to the teaching of programming generally. The
suggestions are backed up by the findings of a
survey of Prolog lecturers and students carried out
in a recent project. The paper also makes
suggestions about which languages we should be
teaching, and which ones we should be teaching
first.
Keywords
Prolog, Java, Logic Programming,
Languages, Declarative Programming.
Computer
1. INTRODUCTION
Certain problems have been associated with the
teaching of Prolog, a language which has been
around since the early seventies. Many of these are
problems associated with any new language which
represents a substantial paradigm-shift. Some of the
problems are apparent with new object-oriented
Permission to make digital or hard copies of all or part of this
work for personal or classroom use is granted without fee
provided that copies are not made or distributed for profit or
commercial advantage and that copies bear this notice and the
full citation on the first page. To copy otherwise, to republish, to
post on servers or to redistribute to lists, requires prior specific
permission.
th
2. THE BACKGROUND
Logic Programming, in the form of Prolog, is now
widely taught in UK universities. In fact it is claimed
that Prolog is taught in more UK universities than any
other programming language [1]. This may have
something to do with the fact that the opposition is
divided, but there is no doubt that Prolog is now very
well-established in academic circles.
Prolog has been used recently for programming the
database of the hugely successful Human Genome
Project. Some who have had a great deal of contact
with Prolog believed, in fact, when it appeared, that
it had the potential to become the most commonly
used programming language of all, as well as the
most widely taught. In a pilot scheme at Imperial
College which was ahead of its time, Robert
Kowalski and Richard Ennals devised a version of
Prolog for children called micro-Prolog [2]. It met
with good response, but did not gain ground in
schools because BASIC won the battle for hearts
and minds.
Prolog is gaining ground in industry, but at an almost
imperceptible pace. The faith put into it by the
academic world in teaching it on all those courses is
not mirrored to any appreciable extent in industry. The
reason is not hard to find. Students do not gain from
their courses an appreciation of Prolog.
Why are all those students studying Prolog, but failing
to be impressed by it? The inference is inescapable
that in the universities our teaching of Prolog is
inadequate, or misconceived, or both.
3. AN ANALOGY
Let us suppose for a moment that until now the world
has been without Algebra, which in fact we all learned
at school. (Algebra is not unlike a computer language,
being part of the language of Mathematics.) A group
of academics comes along with Algebra.
(b)
(c)
(d)
(e)
Structured
10
Non-Struct
5
0
Very
Easy
Very
Hard
Figure 1
Structured
15
Non-Struct
10
5
0
Very
Easy
Very
Hard
Figure 2
Structured
20
Non-Struct
10
0
Prolog
Other
Langs
Figure 3
8. SOME CONCLUSIONS
A predictable process is repeated fairly regularly when
a new language comes along. The language is used
by those who invented or designed it; its use spreads
to other academics; books are written, by academics
for other academics; the language begins to be
taught; it is taught by academics who base their
teaching on the academic books; students struggle
with the language; books begin to be written for
students, in simpler language but keeping the same
structure as the academic books; only after some
years do books appear which are properly structured
for learning the language.
A book setting out the credo of a new language tries
to show its structure, its differences from other
languages, and its advantages. It aims to set out
everything in the language and often resembles a
specification. A book for students, on the other hand,
should present things in a sequence of steps of
gradually increasing complexity and difficulty. The
9. REFERENCES
[1] Scowen, R., Prolog Standard, paper at
Conference on Industrial Exploitation of Prolog,
organised by ALP-UK, at DTI Offices,
Buckingham Palace Road, London (1993).