Simon McGregor on Wed, 4 Aug 2010 07:18:57 -0700 (MST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [game-lang] a survey of previous work


On Wed, Aug 4, 2010 at 11:08 AM, Joel Uckelman <uckelman@xxxxxxxxx> wrote:
> Thus spake Simon McGregor:
>>
>> GALA also shows up the holes in my grasp of logic programming. The
>> paper says that they model a game as paths through a program (using
>> the "choose" operator, which is nondeterministic). But it makes it
>> sound like this is an execution path, and I can't quite get my head
>> around how one executes a declarative program. Incidentally, GALA
>> (like GDL?) is based on PROLOG - a language I've never used.

> Have a look at the article in Wikipedia. on Prolog. A Prolog program
> itself doesn't do anything. It's the queries you supply which cause
> any computation to happen. A (very) simple example:
>
>  cat(Widget).
>  animal(X) :- cat(X).
>
> This program does nothing. However, when I add a query, something
> happens. The query is the first line, the output from the Prolog
> interpreter the second:
>
>  ?- animal(Widget).
>  Yes

That's what I'd imagined. Hence my confusion at the GALA paper's
description of execution paths through a program. I'm clearly missing
something...

> In our case, a query could be a game state, I think, while the
> program would be the game rules:
>
>  ?- legal(...).
>  Yes

And

?- legal(X, now)

would give the list of moves which are legal now?


Simon
_______________________________________________
game-lang mailing list
game-lang@xxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/game-lang