Re: Why not using Prolog for IF?


Mon, 10 Apr 1995 06:10:52 GMT

In article <3m0pqe$l3j@newsbf02.news.aol.com>, MeiTien <meitien@aol.com> wrote:
:
>But, if the IF writer knows Prolog, and the prolog code is intended for
>one author to change, then the problems of extensions seem lessened?

There are two ways that I can see for handling additions. One way is to
simply sort rules from the most specific to the most gerneral. If your
Prolog compiler supports include files you might do something like:

include special cases for just this game
include special cases from author's bag of tricks
include standard library
include generalities from author's bag of tricks
include generalities for just this game

The standard library would define things such as looking, putting and
basic objects. Hence it would know that rocks are normally grey, boring
things and that you can't put anything in them. The Stone, however, is
defined just for one game such that it has an inscription, Arthur can
pull a sword out of it, etc. Since the Stone also has the properties ofoa
rock (when not over-ridden) kicking it will cause you to stub your
toe.... [This assumes that you are using cuts or some magical cut
replacement such as ->.]

The other way is to provide a game description language that is either
compiled into Prolog or interpreted on the fly. This can hide tricky
things like cuts and order rules properly.

>I would assume the initial set up of the framework for the IF will be
>greater than Inform, but, the Prolog skill can be applied to many areas of
>work instead of just IF as it is designed. May be intelligent actors?
>Especially the parsing can be more flexible and powerful( as much as the
>author is willing to spend time on).

Work on intelligent actors has been done by the Prolog community at
large. Note that actors that plan complex actions require that you do
two things. First implement a planning mechanism (probably just how
can I accomplish X? or given my current state what can I do?). The
second and more difficult thing to do is to write all of your actions
(opening doors, moving picking things up) so that the results are
accessible to the actors. Heuristics can be used either to replace the
latter task or to supplement it.

>Does Adventure in Prolog use Nani search game? Does it go into any depth
>than its counter part of APT disk? I wondr where else to find IF in
>Prolog?

The only thing that a I really liked about that book was that it showed
several implementations of the game. Unfortunately it never got beyond
very simple tasks.

About a year ago someone had an interesting package in a Prolog-like
language. I can't remember enough of the details to grep the archives
of this newsgroup.

One interesting implementation issue to consider is handling failures.
A simple method is to use cuts so that special failures (like getting
killed) prevent later success rules from be used. Or perhaps all types
of ``failure'' other than ``I can't do that/I don't know what you mean''
are actually successful uses of rules.

-- 
"You're obviously on drugs,      Michael Van Biesbrouck
but not the right ones."         Once and Future CSC Librarian
-- bwross about mlvanbie         http://csclub.uwaterloo.ca/u/mlvanbie/