[eclipse-clp-users] A complex Problem

From: Christian Wirth <tyrion_at_geek-squad.de>
Date: Mon, 08 Feb 2010 15:35:29 +0100
i have a complex problem, i dont even have a clue how to start solving it

.. hopefully i can explain it somehow understandable. I have terms 
describing states of games. those are not grounded.
The terms are like this:
State = [location(_73, _264, _265), blockednorth(_264, _265)]
now i want to determine all possible effects in this state with a given 
move. This can be done by this call:
d_next(Effect,[does(Player,Move)]-State), but d_next is dynamic compiled 
out of the game description.
.. to get all possible effects, i use 
findall(Effect,(d_next(Effect,[does(Player,Move)]-State)),Effects) (or 
bagof)

.. but now i have the variables bound, and the state looks like this:
State = [location(bomberman, 1, 1), blockednorth(_491, _492)]
That should not happen !

The only additional thing i know, that helps is this:
If a condition is true in a given state is checked by

:- mode d_true(?, +).
d_true(F,_-Z) :-
    member(F,Z).

my current ideas are

a) get a list of all grounded facts and remove them for befor calling 
the predicate. Was not able to do this, because i dont know how to get 
the lis

b) changing the d_true predicate in a way that it does not binds 
variables ??


.. i know this mailing list is not exactly the right place, but here i 
got the best answers to prolog problems till now ....
Received on Mon Feb 08 2010 - 14:35:43 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET