[Toss-devel-svn] SF.net SVN: toss:[1512] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2011-07-14 15:52:00
|
Revision: 1512
http://toss.svn.sourceforge.net/toss/?rev=1512&view=rev
Author: lukaszkaiser
Date: 2011-07-14 15:51:48 +0000 (Thu, 14 Jul 2011)
Log Message:
-----------
Small changes to sync compile stuff.
Modified Paths:
--------------
trunk/Toss/GGP/GDL.ml
trunk/Toss/GGP/GDL.mli
trunk/Toss/GGP/TranslateGame.mli
trunk/Toss/Server/ReqHandler.mli
trunk/Toss/Solver/Structure.ml
Modified: trunk/Toss/GGP/GDL.ml
===================================================================
--- trunk/Toss/GGP/GDL.ml 2011-07-13 09:55:22 UTC (rev 1511)
+++ trunk/Toss/GGP/GDL.ml 2011-07-14 15:51:48 UTC (rev 1512)
@@ -57,14 +57,16 @@
| Const c -> c
| Var v -> "?"^v
| Func (f, args) ->
- "(" ^ f ^ " " ^ String.concat " " (List.map term_str args) ^ ")"
+ "(" ^ f ^ " " ^
+ String.concat " " (List.map term_str (Array.to_list args)) ^ ")"
let rec term_to_name ?(nested=false) = function
| Const c -> c
| Var v -> v
| Func (f, args) ->
f ^ "_" ^ (if nested then "_S_" else "") ^
- String.concat "_" (List.map (term_to_name ~nested:true) args) ^
+ String.concat "_" (List.map (term_to_name ~nested:true)
+ (Array.to_list args)) ^
(if nested then "_Z_" else "")
let rec term_vars = function
@@ -74,7 +76,7 @@
and terms_vars args =
List.fold_left Aux.Strings.union Aux.Strings.empty
- (List.map term_vars args)
+ (List.map term_vars (Array.to_list args))
let rel_of_atom = function
Modified: trunk/Toss/GGP/GDL.mli
===================================================================
--- trunk/Toss/GGP/GDL.mli 2011-07-13 09:55:22 UTC (rev 1511)
+++ trunk/Toss/GGP/GDL.mli 2011-07-14 15:51:48 UTC (rev 1512)
@@ -104,3 +104,16 @@
term list * (term list list list * term list list)
val find_cycle : term option list -> term option list
+
+
+(** A path is a position in a tree together with labels on nodes from
+ the root to that position (but excluding the position). *)
+type path = (string * int) list
+
+(** A trie representing a set of paths. *)
+type path_set =
+ | Empty
+ | Here (** Singleton $\{\epsilon\}$. *)
+ | Below of (string * path_set array) list
+ | Here_and_below of (string * path_set array) list
+(* Subtries are in sorted order. *)
Modified: trunk/Toss/GGP/TranslateGame.mli
===================================================================
--- trunk/Toss/GGP/TranslateGame.mli 2011-07-13 09:55:22 UTC (rev 1511)
+++ trunk/Toss/GGP/TranslateGame.mli 2011-07-14 15:51:48 UTC (rev 1512)
@@ -1,4 +1,3 @@
-
type tossrule_data = {
lead_legal : GDL.term;
(* the "legal"/"does" term of the player that performs the move, we
@@ -10,7 +9,7 @@
terms *)
struc_elems : string list;
fixvar_elemvars :
- (string * (term * (string * string list) list) list) list;
+ (string * (GDL.term * (string * string list) list) list) list;
(* "state" terms indexed by variables that they contain, together
with the mask-path of the variable *)
elemvars : GDL.term Aux.StrMap.t;
@@ -21,7 +20,7 @@
type gdl_translation = {
(* map between structure elements and their term representations;
the reverse direction is by using element names *)
- elem_term_map : term Aux.IntMap.t;
+ elem_term_map : GDL.term Aux.IntMap.t;
f_paths : GDL.path_set;
m_paths : GDL.path_set;
masks : GDL.term list;
@@ -31,4 +30,4 @@
val translate_game :
- clause list -> gdl_translation * (Arena.game * Arena.game_state)
+ GDL.clause list -> gdl_translation * (Arena.game * Arena.game_state)
Modified: trunk/Toss/Server/ReqHandler.mli
===================================================================
--- trunk/Toss/Server/ReqHandler.mli 2011-07-13 09:55:22 UTC (rev 1511)
+++ trunk/Toss/Server/ReqHandler.mli 2011-07-14 15:51:48 UTC (rev 1512)
@@ -18,7 +18,7 @@
Formula.real_expr array array option (** heuristic option *)
* bool (** game modified *)
* (Arena.game * Arena.game_state) (** game and state *)
- * Translate.gdl_translation (** current gdl translation *)
+ * TranslateGame.gdl_translation (** current gdl translation *)
* int (** playclock *)
val init_state : req_state
Modified: trunk/Toss/Solver/Structure.ml
===================================================================
--- trunk/Toss/Solver/Structure.ml 2011-07-13 09:55:22 UTC (rev 1511)
+++ trunk/Toss/Solver/Structure.ml 2011-07-14 15:51:48 UTC (rev 1512)
@@ -264,10 +264,10 @@
(* Add tuple [tp] to relation [rn] in structure [struc]. *)
let add_rel_named_elems struc rn tp =
let new_struc, tp =
- Array.fold_right (fun (struc, tp) e ->
+ Array.fold_right (fun e (struc, tp) ->
let struc, e = find_or_new_elem struc e in
- struc, e::tp)
- (add_rel_name rn (Array.length tp) struc) tp in
+ struc, e::tp) tp
+ ((add_rel_name rn (Array.length tp) struc), []) in
let tp = Array.of_list tp in
let add_to_relmap rmap =
let tps = StringMap.find rn rmap in
@@ -275,14 +275,14 @@
let new_rel = add_to_relmap new_struc.relations in
let add_to_imap imap e =
try
- IntMap.add e (Tuples.add tp (IntMap.find e imap)) imap
+ TIntMap.add e (Tuples.add tp (TIntMap.find e imap)) imap
with Not_found ->
- IntMap.add e (Tuples.singleton tp) imap in
+ TIntMap.add e (Tuples.singleton tp) imap in
let new_incidence_imap =
try
Array.fold_left add_to_imap (StringMap.find rn new_struc.incidence) tp
with Not_found ->
- Array.fold_left add_to_imap IntMap.empty tp in
+ Array.fold_left add_to_imap TIntMap.empty tp in
let new_incidence = StringMap.add rn new_incidence_imap new_struc.incidence in
{ new_struc with relations = new_rel ; incidence = new_incidence }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|