2010/2/8 Christian Wirth <tyrion_at_...215...>: > 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 ! > Why? You could first copy State term (using copy_term predicate) and use a copy in findall. > 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). > What is a connection between d_true/2 and d_next/2 predicates? What is F in d_next predicate? > 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 > Where are facts stored? What do you mean by removing them? I do not see what is the algorithm. How are predicates called and what they do? Maybe providing us with a simple example would be a good idea? > .. i know this mailing list is not exactly the right place, but here i > got the best answers to prolog problems till now .... > You can try comp.lang.prolog too. Best regards -- [ Wit Jakuczun http://wlogsolutions.com ]Received on Tue Feb 09 2010 - 05:38:26 CET
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST