Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why not using Prolog for IF?

15 views
Skip to first unread message

MeiTien

unread,
Apr 4, 1995, 3:00:00 AM4/4/95
to
Have anyone considered using Prolog for IF writing? Pros and Cons?

Mei-Tien

Greg Ewing

unread,
Apr 5, 1995, 3:00:00 AM4/5/95
to

In article <3lscm1$4...@newsbf02.news.aol.com>, mei...@aol.com (MeiTien) writes:

|> Have anyone considered using Prolog for IF writing? Pros and Cons?

Yes, I've thought about this. Others have too - e.g. there is
a book called "Adventure in Prolog" by Dennis Merrit, which
uses a simple adventure game as a running example while
introducing Prolog.

Some pros:

* Prolog can express both attributes of single things and
relationships between more than one thing in a uniform
way. The object-oriented systems traditionally used tend
to handle the former well but not the latter.

* Most Prolog systems come with a package which makes it
easy to create very powerful parsers.

Some cons:

* It seems to be difficult to create a library which the
user can extend without knowing details of its implementation.
Often when adding a new rule it is necessary to know what
other rules there are with the same left hand side, and
insert the new rule in a particular place in the sequence,
in order to get the desired effect. This does not seem to
blend well with the idea of an include file of standard
stuff.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of Japan Inc.|
gr...@cosc.canterbury.ac.nz +--------------------------------------+

JeffJetton

unread,
Apr 6, 1995, 3:00:00 AM4/6/95
to
gr...@cosc.canterbury.ac.nz (Greg Ewing) wrote:

>there is a book called "Adventure in Prolog" by Dennis Merrit,
>which uses a simple adventure game as a running example
>while introducing Prolog.

This book sounds very interesting! Is it still in print? Who is the
publisher?

From what little I know of Prolog, it seems that it would not only lend
itself to adventure-type games, but also to not-yet-invented interactive
fiction, involving "intelligent" actors, etc.

TIA,

- Jeff (jeffj...@aol.com)

MeiTien

unread,
Apr 6, 1995, 3:00:00 AM4/6/95
to
Greg,

I see.

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?

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).

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?

Thanks.
Mei-Tien

Mads Haahr

unread,
Apr 7, 1995, 3:00:00 AM4/7/95
to
A friend of mine wrote a text adventure in Prolog some years back.

It was a small and rather ordinary game, around twenty locations or
so, in the usual fantasy-like setting. Neat, but nothing fancy, until
it occurred to him that if the game was invoked differently (with less
variables instantiated, I guess) the game could play itself!

Don't remember if it won, though.
--
Mads Haahr [<ha...@cs.ubc.ca>,<ma...@diku.dk>] | Humour
Department of Computer Science | may be
University of [British Columbia,Copenhagen] | unmarked
--
Mads Haahr [<ha...@cs.ubc.ca>,<ma...@diku.dk>] | Humour
Department of Computer Science | may be
University of [British Columbia,Copenhagen] | unmarked

John Baker

unread,
Apr 8, 1995, 3:00:00 AM4/8/95
to
In <HAAHR.95A...@cascade.cs.ubc.ca> ha...@cascade.cs.ubc.ca (Mads
Haahr) writes:
>A friend of mine wrote a text adventure in Prolog some years back.
>
>It was a small and rather ordinary game, around twenty locations or
>so, in the usual fantasy-like setting. Neat, but nothing fancy, until
>it occurred to him that if the game was invoked differently (with less
>variables instantiated, I guess) the game could play itself!

So when are you going to get him to upload the game (with source code
and notes) to ftp.gmd.de?
--
John Baker
"What the hell does that mean? Huh? 'China is here.'?
I don't even know what the hell that means!"
- Jack Burton

MeiTien

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to
Greg,

Thanks for your information. I have been reviewing Prolog for the past few
days. It seems so attractive for language parsing, but the modularity and
extension will indeed be an issue.

Mei-Tien

MeiTien

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to
I think you can gte it from Cogent Prolog 508 897 7332

MeiTien

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to
<Work on intelligent actors has been done by the Prolog community at
large.>

That is intesresting. Could you tell me more about it?

Mei-Tien

Greg Ewing

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to

In article <3m0pqe$l...@newsbf02.news.aol.com>, mei...@aol.com (MeiTien) writes:
|>
|> 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?

Possibly. But modularity and reusability still have
benefits even where only one author is involved.

On the plus side, the amount of library code actually
involved might be quite small. Many of the things
that require considerable amounts of support code
in traditional IF systems are so simple to implement
in Prolog that you don't really need library code
for them.

|> May be intelligent actors?

Could be, although I feel that the problems involved
with "intelligent" actors go a lot deeper than which
language is used to implement them.

|> Does Adventure in Prolog use Nani search game?

Yes.

|> Does it go into any depth
|> than its counter part of APT disk?

Can't say for sure (I haven't seen the version you mention)
but probably not. It's pretty basic - the author uses it
to teach prolog, not adventure game programming.

|> I wondr where else to find IF in Prolog?

I don't know - Merritt's book is the only place I've
ever seen the idea discussed, despite its obvious
potential.

|> Mei-Tien

Greg

Greg Ewing

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to

In article <3m04ui$j...@newsbf02.news.aol.com>, jeffj...@aol.com (JeffJetton) writes:
|>
|> This book sounds very interesting! Is it still in print? Who is the
|> publisher?

I don't know whether it's still in print. Here's what our
library catalogue here has to say about it:

Merritt, Dennis. Adventure in Prolog / Dennis Merritt. [1st ed.]. New York :
Springer-Verlag, c1990 (Springer Compass International)

|> - Jeff (jeffj...@aol.com)

Greg

Michael Van Biesbrouck

unread,
Apr 10, 1995, 3:00:00 AM4/10/95
to
In article <3m0pqe$l...@newsbf02.news.aol.com>, MeiTien <mei...@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/

David D. Peugh

unread,
Apr 13, 1995, 3:00:00 AM4/13/95
to

I've recently been looking to buy a book on Prolog ++.

This object oriented prolog, just may be what your looking for.

Dave.

MeiTien

unread,
Apr 13, 1995, 3:00:00 AM4/13/95
to
Dave,

I have seen Prolog++ in the bookstore once, but now it is no where to be
found. I don't remember what was in it. For some reason, the bookstore
here only carries LISP books but not much Prolog at all.

Why it is good for IF? Could you give me more details?

Thanks.
Mei-Tien

David D. Peugh

unread,
Apr 14, 1995, 3:00:00 AM4/14/95
to
MeiTien (mei...@aol.com) wrote:
: Dave,

: Thanks.
: Mei-Tien

I haven't seen much of Prolog++, but I'm pretty sure it includes an
Object Oriented extension to Prolog. This (should) solve many of
the problems brought up about using Prolog for IF. Most notably, creating
standard libraries. . .

I'm thinking about picking up the book from Borders tommorow. I
should have more information about it after I've read it.

David Peugh

(Incidentally, I'm not even sure if Prolog++ has been implemented yet.
But it is an interesting subject, if only for the theoretical implications)


MeiTien

unread,
Apr 15, 1995, 3:00:00 AM4/15/95
to
David,

I remember the book Prolog++ has a coupon to buy a special priced
Prolog++. I saw the book before, but it is not there anymore, out of
stock. Please let me know how do you think about the book, and then I may
order it from a local bookstore.

Prolog++ may not be compatible with other prolog implementations, I would
assume. I am rather new to Prolog and not ready for the challenge yet.

I put in an order for Amzi Cogent Prolog interpreter as a start, I should
get it soon.

Mei-Tien

0 new messages