Re: Lisp/AI, Carnegie Mellon University
From: Aaron Sloman (A.Sloman_at_cs.bham.ac.uk)
Date: 05/17/04
- Next message: Daniel Barlow: "Re: Starting out - how to?"
- Previous message: Barry Margolin: "Re: macro-biology"
- In reply to: Don Geddis: "Re: Lisp/AI, Carnegie Mellon University"
- Next in thread: Mannr_at_uwaterloo.ca: "Re: Lisp/AI, Carnegie Mellon University"
- Reply: Mannr_at_uwaterloo.ca: "Re: Lisp/AI, Carnegie Mellon University"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 16 May 2004 22:21:38 GMT
Don Geddis <don@geddis.org> writes:
> ....
> ....
> Yes, Prolog "allows" procedural programming. But my point was that if you
> happen to be encoding a procedural algorithm, Prolog is not the most
> convenient form to encode it.
I tend to feel the same way about prolog, but people who are very fluent
with it will find it convenient for far more than those who are less
fluent.
Convenience is a bit like beauty: in the eye of the beholder.
> Prolog's bias is clearly towards declarative rules, non-determinism, and
> backtracking. If that doesn't match your problem domain, then Prolog is
> more awkward than other alternatives.
In addition, prolog's use of unification is very powerful in some
contexts, e.g. parsing, symbolic algebra various algorithms for matching
and transforming structures.
In particular, whereas ordinary pattern matching does not allow two
variables to be matched, prolog allows two variables to be 'unified' so
that if one ever subsequently gets instantiated the other will also. In
other languages you have to do this sort of thing by explicitly
associating some data-structure (e.g. a reference) with both variables.
Prolog does that automatically 'behind the syntax' including
automatically undoing the assignment during backtracking.
> >> A good procedural language is better. And Lisp is one of the
> >> best.
> >
> > I don't buy that either. Firstly, Lisp is a functional, not
> > a procedural, language.
>
> You seem to have unfortunate misconceptions of Lisp that are decades out of
> date (if they were ever true).
Yes: I often hear it said that Lisp is a functional language: somehow
that untruth has got into the folklore of computer science and has
spread. I guess it may be partly because Lisp has a core that can be
used for a functional programming style, somewhat like Scheme, which is
closer to a pure functional language. But Lisp has much much more in
addition, as you say.
(However Lisp and Scheme both lack the strong syntactic type mechanisms
of what theoretical computer scientists call 'functional languages',
e.g. Haskell, Miranda, ML).
>
> Common Lisp, the most popular and industrial-strength variety, is a
> multi-paradigm language.
This is a very important point. However I find that that concept is not
generally taught to computer scientists, and some of those who encounter
it think its a bad thing because they hanker after elegance and purity
-- partly because that means mathematical analysis of programs easier.
Mathematical analysability and pragmatic power seem to vary inversely.
(Compare predicate calculas and natural languages).
> It is far from purely "functional" as a programming
> language, and in fact is often used in a straightforward
> procedural fashion.
I agree that Common Lisp is a multi-paradigm language, as is Pop11,
which developed largely in parallel with Common lisp, but has some
differences in syntax (e.g. more conventional format) and semantics,
e.g. use of open stack (like Forth), which goes along with a very useful
class of closures using 'partial application'.
Both Lisp and Pop11 also allow syntactic extensions that extend the
paradigms that are well supported, including macros whose behaviour can
depend on previously compiled procedures, unlike macros permitted in
most programming languages.
Pop11 also allows extensions that are not translatable into pop11, but
incrementally compile to an intermediate level virtual machine.
Both languages are available in Poplog, which used to be an expensive
AI development package but is now free and open source:
http://www.cs.bham.ac.uk/research/poplog/freepoplog.html
http://www.cs.bham.ac.uk/research/poplog/primer/START.html
> > Secondly, GUI's are better done in an object oriented or procedural
> > language, as are _some_ solutions to algorithmic problems.
>
> Common Lisp includes CLOS, one of the best-designed object oriented systems
> out there. If your goal is a combination object oriented/procedural
> language, Common Lisp would seem to fit the bill.
Pop11 partly followed Common Lisp in this when the Objectclass library
was added, providing similar functionarity (multiple inheritance,
generic functions), but more attuned to the pop11 design philosophy.
(There aren't meta-objects.) This OOP extension made it much easier
to use pop11 to develop the graphical interface tools demonstrated in
the rclib and simagent sub-directories here:
http://www.cs.bham.ac.uk/research/poplog/figs/
> > The truth is that most AI/CI problems are better tackled by using a
> > combination of programming languages.
>
> A combination of programming styles, perhaps.
Important distinction.
> As it turns out, Common Lisp is
> an excellent substrate for a variety of different programming styles (e.g.
> functional, procedural, object-oriented, etc.).
>
> Common Lisp's main failures are the tightness of interaction with the rest of
> the computing world, for example the underlying operating system or perhaps
> some needed pre-existing libraries. In addition, it isn't very popular in the
> world today, and there are a variety of 2nd-order negative consequences to
> choosing to work with an unpopular language. (Note that this is independent
> of the quality of the language's design.)
Yes: in part there are fashions, both in industry and in academe and the
fashions don't necessarily correspond to the best choices for a deep
education in AI.
Here at the University of Birmingham we still use pop11 to introduce
the AI half degree, even though Java is used to introduce general
Computer science and Software engineering. If pop11 were not available I
would recommend Lisp.
> But for a standalone programming project, it's hard to beat. Since this whole
> thread came up in the context of why (some) university AI projects "still"
> use Lisp, the answer is still that it's a pretty darn good language for almost
> any programming project. And university AI projects are often very hard
> but standalone problems, which is a good match for Lisp's strengths.
For first year AI students I have a set of slides (in PDF) for a lecture
on how AI differs from Software engineering, and explaining how some
of those differences imply different requirements in programming
languages.
One of the crucial differences is that whereas SE is generally concerned
to make something useful, meeting some relatively well defined
specification, AI is often an open-ended search for a working
explanation of some very complex naturally occurring phenomenon, e.g.
some aspect of human or animal intelligence whose scope is not well
understood. What is the ability to see? or to understand language?
(Of course, some Applied AI is software engineering.)
Talk 11, on AI development environments, attempts to explain this for
beginners:
http://www.cs.bham.ac.uk/research/cogaff/talks/
Talk 10 attempts to answer the question 'What is AI?' for novices.
It's only a partial answer.
Aaron
===
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
FREE BOOK: http://www.cs.bham.ac.uk/research/cogaff/crp/
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html
[ comp.ai is moderated. To submit, just post and be patient, or if ]
[ that fails mail your article to <comp-ai@moderators.isc.org>, and ]
[ ask your news administrator to fix the problems with your system. ]
- Next message: Daniel Barlow: "Re: Starting out - how to?"
- Previous message: Barry Margolin: "Re: macro-biology"
- In reply to: Don Geddis: "Re: Lisp/AI, Carnegie Mellon University"
- Next in thread: Mannr_at_uwaterloo.ca: "Re: Lisp/AI, Carnegie Mellon University"
- Reply: Mannr_at_uwaterloo.ca: "Re: Lisp/AI, Carnegie Mellon University"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|