[Toss-devel-svn] SF.net SVN: toss:[1511] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2011-07-13 09:55:34
|
Revision: 1511
http://toss.svn.sourceforge.net/toss/?rev=1511&view=rev
Author: lukstafi
Date: 2011-07-13 09:55:22 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
GDL translation work in progress. Does not compile yet.
Modified Paths:
--------------
trunk/Toss/GGP/TranslateGame.ml
trunk/Toss/www/reference/reference.tex
Modified: trunk/Toss/GGP/TranslateGame.ml
===================================================================
--- trunk/Toss/GGP/TranslateGame.ml 2011-07-13 09:54:19 UTC (rev 1510)
+++ trunk/Toss/GGP/TranslateGame.ml 2011-07-13 09:55:22 UTC (rev 1511)
@@ -556,8 +556,20 @@
loc_players, loc_noops
-let loc_graph_turn_based loc_players loc_noops rule_cands =
-
+let loc_graph_turn_based player_nums
+ player_payoffs loc_players loc_noops rule_cands =
+ let graph = Array.mapi
+ (fun loc player ->
+ let player_num = List.assoc (term_to_name player) player_nums in
+ let pl_moves =
+ Array.mapi
+ (fun pl_num payoff ->
+ {Arena.payoff = payoff;
+ view = [];
+ heur = [];
+ moves = if pl_num = player_num then pl_moves else []})
+ players)
+ loc_players in
let loc_graph_general_int =
failwith "GDL: General Interaction Games not implemented yet"
@@ -601,7 +613,7 @@
let graph (*: player_loc array array*) =
match turn_data, rule_cands with
| Some (loc_players, loc_noops), Left cands ->
- loc_graph_turn_based loc_players loc_noops cands
+ loc_graph_turn_based players loc_players loc_noops cands
| None, Left cands ->
loc_graph_general_int
| None, Right cands
Modified: trunk/Toss/www/reference/reference.tex
===================================================================
--- trunk/Toss/www/reference/reference.tex 2011-07-13 09:54:19 UTC (rev 1510)
+++ trunk/Toss/www/reference/reference.tex 2011-07-13 09:55:22 UTC (rev 1511)
@@ -1719,7 +1719,16 @@
we first need to compute erasure clauses to prevent constructing
too general rules in the end.
+\paragraph{Concurrent Moves Games} Introduced in
+Section~\ref{subsec-concurrency}, concurrent moves games use a
+factored approach: since the $d_i$ never share variables,
+\texttt{legal} and \texttt{next} clauses are assigned to players and
+the whole construction of structure rewriting rules is done separately
+for each player. Clauses without a \texttt{does} atom are assigned to
+the ``environment''. (In the interpretation, to reuse code, we simply
+build single-term \texttt{legal} tuples for concurrent moves games.)
+
\subsubsection{Erasure Clauses}
So far, we have not accounted for the fact that rewrite rules of Toss
@@ -1794,11 +1803,8 @@
For each suitable tuple $\ol{\calC}, \ol{\calN}$ we have now created
the unifier $\sigma_{\ol{\calC}, \ol{\calN}}$ and computed the erasure
-clauses $\calE_{\ol{\calC}, \ol{\calN}}$. At this point, clauses
-$\ol{\calC}, \ol{\calN}$ are optionally divided according to the
-player of the \texttt{does} relation atom in them, see
-Section~\ref{subsec-concurrency}. To create the rules, we need to
-further partition the \emph{rule clauses} $\sigma_{\ol{\calC},
+clauses $\calE_{\ol{\calC}, \ol{\calN}}$. To create the rules, we need
+to further partition the \emph{rule clauses} $\sigma_{\ol{\calC},
\ol{\calN}}(\calC_i), \sigma_{\ol{\calC}, \ol{\calN}}(\calN_i)$ and
$\calE_{\ol{\calC}, \ol{\calN}}$, and augment them with further
conditions. The reason is that the prepared rule clauses may have
@@ -2071,8 +2077,8 @@
default way of defining simultaneous moves in Toss. We now elaborate
on three modes of building the game graph in the translated game.
-\subsubsection{Turn-based Games} are games where in any game state there
-is at most a single player having genuine choice. Rather than
+\subsubsection{Turn-based Games} are games where in any game state
+there is at most a single player having genuine choice. Rather than
attempting a complex analysis to detect as many turn-based games as
possible, we recognize some cases where in all states, all players but
one have a single legal move that is a constant (term of size
@@ -2084,7 +2090,9 @@
single-player game is also a turn-based game, as another example in a
three-player game the first player may intersperse the moves of second
and third player). We build a corresponding cyclic graph of Toss
-locations.
+locations. We limit the turn-based translation to the case where all
+rule clauses have exactly one \texttt{does} atom (\ie can be
+attributed to exactly one of the players).
\subsubsection{Concurrent Moves Games} \label{par-concurrent-moves}
When translation as a turn-based game fails, but all rule clauses have
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|