mtcrya01@scilab.uct.ac.za (Ryan Mitchley) writes:
> Date: Mon, 16 Oct 1995 07:43:54 GMT
> Organization: University of Cape Town
>
> In article <9528313.6839@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
> >From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
> >Subject: Re: Wanted: programming language for 9 yr old
> >Date: Tue, 10 Oct 1995 03:38:49 GMT
>
> >The problem with Prolog is *not* that predicate logic is hard.
> >What makes learning Prolog hard is that there is in fact a large
> >gulf between the declarative semantics and the operational semantics.
> >In order to program in Prolog, you need to know Prolog's complex
> >operational semantics.
>
> I agree with you about the gap between the declarative semantics and the
> operational semantics, but I really don't feel that it makes much of a
> difference on the level that a 9 yr old would be taught. What it really
> boils down to is what you mean by "programming in Prolog". Programming WHAT
> in Prolog ?
I did not see the start of this thread. My impression is that for
most 9 year olds what is most important is not the choice of
language, but what they are asked/invited/allowed to do, and whether
the initial tasks are both motivating and sufficiently easy that
they don't get too dispirited.
In some cases this can be achieved by starting with a language that
is too low level to be useful on its own, but which allows easily
accessible libraries to be added, which the learner can use without
necessarily understanding how they are implemented, as long as the
child can understand what they achieve, and wants to achieve that
sort of thing.
This is, I believe, the (implicit or explicit) philosophy behind
much of the use of Logo for children.
During the 70s I was at Sussex University where we were extending
the Edinburgh AI language Pop2 for teaching non-scientific
undergraduates AI. The result was Pop-11 (so-called because it ran
on a DEC PDP11). We found that it was a nice language for beginners
because it had constructs that were easy to map onto already
familiar ways of describing processes. (Recursion, backtracking and
unificiation, the main features which give Prolog its power, are NOT
already familiar to most beginners.)
Anyhow, when developing teaching materials in the late 70s and early
80s I used our two boys as test cases: one was born in 1967 and one
in 1973. As long as the exercises were fun and they got help when
they were really stuck they seemed to be able to learn quite a lot
by simply working with online "teach" files.
E.g. one such file used a library program to model the ontology of
the world for the river puzzle (get a man, fox, chicken, grain
across a river using a boat that holds at most two items man + one
other, and without ever leaving fox alone with chicken or chicken
alone with grain.)
Another teach file introduced a simple eliza-like program using the
Pop-11 pattern matcher. We also had a simple graphical library for
drawing into a 2-D character array, which could then be printed out,
as we did not then have proper graphics terminals.
I still use revised extended versions of these exercises, based on
the more powerful Poplog Pop-11, for teaching undergraduates and MSc
students an introductory AI programming course. I believe much of
the material could be used for much younger learners!
All my introductory teach files (which could be revised for Prolog,
Basic, Lisp, or any other interactive language) are accessible by
ftp from the Birmingham Poplog ftp directory, in the "teach/"
subdirectory:
ftp://ftp.cs.bham.ac.uk/pub/dist/poplog
That URL should work in any internet browser. Progressively more
difficult files in the "teach" directory are
river
respond
river2
riverchat
grammar
tower
searching
sets
sets2
newsolver
rulebase
oop
advent_objectclass
waltz
and others. (I guess only a subset would be appropriate for a 9 year
old unless he/she was extraordinarily bright!).
All of these files should work in the free Linux Poplog available by
ftp from Sussex University in
ftp://ftp.cogs.sussex.ac.uk/pub/poplog/poplog15.0
which includes Pop-11 (along with Prolog, Lisp, and ML).
Anyone who so desires may freely copy and modify teaching material
with my name on it. I'd be interested to hear if you find any of it
useful. (There are also two introductions to Unix, in the help
subdirectory help/shell and help/unix.commands ).
> As an 11 yr old, I was able to write several interesting
> programs (to me) without being confused by the operational semantics (for
> that matter, without even knowing about them). So, to an extent, I have to
> disagree with you. I've been there. I did start to have problems, however,
> when I tried to emulate 'for' loops and other constructs that I had learned
> in BASIC.
There's an initial subset of prolog that is very easy to learn and
which can be fun for children, e.g. stuff about factual databases
with simple inferences. However, I've seen more than one beginner
trip over things like this:
brother(X,Y):-male(X),brother(Y,X).
which would be fine in logic. Also using recursion and unification
to construct structured objects is not easy for people to learn.
Compare the code for creating a list of numbers from 30 to 50 in
steps of 5:
[% for x from 30 by 5 to 50 do x endfor %]
or the code for making a new list containing the doubles of the
numbers in an original list:
[% for x in list do x*2 endfor %]
One of the most powerful features of Prolog is the pattern matching.
However, for many purposes the fact that the only place a segment
variable can occur is as the tail of a list can be very restrictive
for eliza-like (and other) programs. Pop-11 uses a one-way matcher
which allows segment variables anywhere. So to make a list of all
the words between I and you in a sentence and assign them to the
variable words you can do things like this:
if sentence matches [I ??words you] then
[perhaps you suspect I also ??words someone] =>
elseif ...
Thus if sentence was the list [I like talking to you] then the
above would construct and print out
[perhaps you suspect I also like talking to someone]
This use of segment variables in the pattern matcher eliminates a
lot of code for searching in lists, and supports a lot of fun
programming.
> Surely a version of Prolog could be written which adopts a Micro-Prolog
> style simplified syntax, fixes up negation-as-failure (as far as is
> possible), and takes away the reliance on sequential execution of clauses (
> maybe by forcing the programmer to write specific tests for the validity of
> each clause at its start). Maybe an object-oriented framework could be
> added. Who knows ?
Who knows?
By the way, I am not claiming that Pop-11 is unique, or best. Just
that it seems to work. I like to teach it before teaching Prolog.
Aaron
---
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs )
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk
Phone: +44-121-414-4775 (Sec 3711) Fax: +44-121-414-4281
|