| Cameron Hughes 2004-03-27, 12:11 am |
| Bart Demoen wrote:
>
> Christopher Browne wrote:
>
>
> Example(s) please :-)
> And just not to waste time, tell us also what you meant by "natural".
> Maybe that will explain more than the examples.
>
> Cheers
>
> Bart Demoen
The focus seems to be on recursion but actually the unification, pattern
matching, and dynamic structures of
Prolog are as much of a part of Prolog as recursion is. Also in addition
to Prolog's declarative interpretation
Prolog has an procedural interpretation.
Prolog can express many things in a procedural way. I can't figure out
why we often want to equate procedural
programming with (while/for loops). As if procedural programming does
not involve recursion or backtracking.
Languages such as C++/C/Pascal etc have no problem implementing
recursion and all the graph and tree programming
I've ever done in any of those languages used a lot of DFS, BFS etc.
How repetition is accomplished is only a part of the issue. The real
question is how are problems and solutions
modelled in a language. Whether some problems are best represented
using the ideas of recursion/induction. Also
whether some solutions are best describe using the ideas of
recursion/induction.
And what of hybrid problems/solutions where the processing is iterative
(while/for loop) and the
data structures involved are recursive in nature or where the data
structure is linear and non recursive
but the processing requires recursion or induction. What's natural in
this case?
The procedural(misnomer) vs recursive is really only meaningful in the
most academic considerations. Problems and
solutions beyond the trivial tend to have multiple paradigms present.
C/C++ can implement recursive algorithms
and Prolog can implement sequential sequence.
Eventually we'll realize that the holy grail will require multiple
languages and multiple paradigms. And that
what we should be working on is standard ways to integrate the
languages. Prolog from Fortran, Fortran from C++
C++ from Prolog etc. As opposed to getting bogged down on the Algebra
vs Trigonometry debate.
Cameron
------------ And now a word from our sponsor ------------------
For a quality usenet news server, try DNEWS, easy to install,
fast, efficient and reliable. For home servers or carrier class
installations with millions of users it will allow you to grow!
---- See http://netwinsite.com/sponsor/sponsor_dnews.htm ----
|