users-prolog
[Top][All Lists]
Advanced

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

Re: Gnu prolog as rule evaluator for small C virtual-world game.


From: Vic Bancroft
Subject: Re: Gnu prolog as rule evaluator for small C virtual-world game.
Date: Thu, 10 Apr 2003 10:06:07 -0400 (EDT)

On Thu, 10 Apr 2003, Lindsey Spratt wrote:

> 
> On Wednesday, April 9, 2003, at 09:35  AM, address@hidden wrote:
> 
> > I am aware of Pl_Query, the problem is that I do not know in advance 
> > (compile-time) which facts will be asserted to prolog.

You can go meta-fact and have all your facts use the same structure, then you
could have fact/3 declared dynamic,

:- dynamic( fact/3 ).

Let the first term be the type of fact, the second term be some key and the last
term be the instance data.  Then your assert would be the equivalent of 

| ?- assertz( fact( credits, player1, 1000 ) )

> > I am only trying to add new facts runtime, not present new queries.

For prolog interaction, _everything_ is a query !  
 
> Vic provided an explicit simple approach to solving this problem, adequate
> to your problem but less general than Jerry Gerstmann's solution.

Heheh, same approach, different day.  Perhaps we can help Jerry port his 
code to GNU prolog !  I still have an old Quintus Prolog Release 3.3 to 
do comparisions.

more,
l8r,

------------------------------------------------------------------- 
Victor Bancroft, Principal Engineer, Zvolve Systems [v]770.551.4505 
1050 Crown Pointe Pkwy, Suite 300, Atlanta GA 30338 [f]770.551.4509 
Fellow, Artificial Intelligence Center              [v]706.542-0358 
Athens, Georgia  30602, U.S.A           http://ai.uga.edu/~bancroft 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]