[Haskell-cafe] Wumpus World
Benjamin L. Russell
dekudekuplex at yahoo.com
Wed Mar 26 23:23:48 EDT 2008
After briefly searching the Internet and coming up
with a page entitled "CIS587: The Wumpus World"
(http://www.cis.temple.edu/~ingargio/cis587/readings/wumpus.shtml),
I think that since the statement of this problem
there, involving the Situation Calculus, chiefly
involves a sequence of logical statements with truth
values and the relations between the statements, the
statements there could perhaps initially be more
directly applied with Prolog than with Haskell.
However, note that it has been demonstrated in the
following book that it is possible to consider logic
programming as a natural extension of functional
programming as well (although this book is on Scheme,
the concepts can be extended to Haskell as well):
* Daniel P. Friedman, William E. Byrd and Oleg
Kiselyov. _The Reasoned Schemer._ Cambridge, MA: The
MIT Press, July 2005.
ISBN-10: 0-262-56214-6
ISBN-13: 978-0-262-56214-0
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10663
I would suggest that you read about both Prolog and
Haskell, take a look at the above book (after first
looking at its prerequisite, _The Little Schemer_),
and then compare whether you would prefer more
directly applying Prolog or using the above book and
extending it to apply Haskell.
Also, you may wish to keep in mind the following
differences between Haskell and Prolog:
* Prolog is initially better suited to representing
knowledge originally represented as a sequence of
logic statements and the relations among them
* Haskell is well-suited to writing programs that can
be expressed as mathematical functions, and
incorporates lazy evaluation, which allows delaying
the evaluation of an argument until evaluation is
required
* Haskell code tends to be more succinct (as Paul
Johnson mentioned)
* Haskell code tends to run faster, and can often be
optimized to run at a speed on par with OCaml
* Prolog tends to be one of the slowest-running
programming languages
I would also suggest that you take a look at the
HaskellWiki
(http://www.haskell.org/haskellwiki/Haskell), and in
particular, at the following example related to logic
programming:
* HaskellWiki Logic programming example:
http://www.haskell.org/haskellwiki/Logic_programming_example
Compare this example to examples of Prolog code, and
see which one suits your taste.
Lastly, when learning Haskell, please try to learn
from books, not tutorials. Haskell has a very steep
learning curve, and is very difficult to cover
adequately in a short tutorial. In particular, I
recommend the following titles:
* Hudak, Paul. _The Haskell School of Expression._
New York: Cambridge University Press, 2000.
http://www.haskell.org/soe/
(Just make sure that you review your trigonometry
before reading this book, because some of the
exercises in it assume knowledge of trigonometry. I
found this book extremely interesting, but discovered
that it does assume some domain knowledge in that
area.)
* Kees Doets and Jan van Eijck. _The Haskell Road to
Logic, Maths and Programming._ College Publications,
April 2004.
http://homepages.cwi.nl/~jve/HR/
A book that uses Haskell as a tool for learning about
logic and mathematics. Nevertheless, the book is
highly readable, and does a good job of introducing
Haskell. It also assumes less domain knowledge than
the above book.
(Write to me personally if you want more information
about this book.)
Good luck!
Benjamin L. Russell
--- Paul Johnson <paul at cogito.org.uk> wrote:
> iliali16 wrote:
> > Hi guys I have to build the wumpus world problem.
> I didn't start yet since
> > this is the first time in my life I have to do
> something like that and I
> > feel not confident in starting it. So I have basic
> idea of what prolog and
> > haskell can do and I know a bit of Java. I am
> wandering if you can tell me
> > which one is best to use to build this
> problem.Thanks couse I am really
> > confused
> >
> This sounds like a homework problem. Any of those
> languages will do.
> Of course Haskell will be shorter.
>
> Jump in, get started. The way to solve a problem
> you don't understand
> is to do any bit of it you do understand, and then
> look at the problem
> again.
>
> Paul.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
More information about the Haskell-Cafe
mailing list