[Toss-devel-svn] SF.net SVN: toss:[1386] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2011-03-24 16:08:10
|
Revision: 1386
http://toss.svn.sourceforge.net/toss/?rev=1386&view=rev
Author: lukstafi
Date: 2011-03-24 16:08:04 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
Diagnostic display of cardinality of graphs of all relations in GDL translation result.
Modified Paths:
--------------
trunk/Toss/GGP/GDL.ml
trunk/Toss/Solver/Structure.ml
trunk/Toss/Solver/Structure.mli
Modified: trunk/Toss/GGP/GDL.ml
===================================================================
--- trunk/Toss/GGP/GDL.ml 2011-03-24 13:27:48 UTC (rev 1385)
+++ trunk/Toss/GGP/GDL.ml 2011-03-24 16:08:04 UTC (rev 1386)
@@ -3491,13 +3491,19 @@
| Some ([_; lead_term], _, _) -> Some lead_term
| _ -> None
) loc_noop_legal in
- (* {{{ log entry *)
+ (* {{{ log entry *)
(match !generate_test_case with
| None -> ()
| Some game_name ->
let file = open_out ("./GGP/tests/"^game_name^"-simpl.toss") in
output_string file (Arena.state_str result);
close_out file);
+ if !debug_level > -1 then (
+ Printf.printf "\n\nGDL.translate_game: simplified rel sizes --\n%s\n%!"
+ (String.concat ", "(List.map (fun (rel,ar) ->
+ rel^":"^string_of_int ar) (Structure.rel_sizes
+ (snd result).Arena.struc)))
+ );
if !debug_level > 1 then (
Printf.printf "\n\nGDL.translate_game: after simplification --\n%s\n%!"
(Arena.sprint_state result)
Modified: trunk/Toss/Solver/Structure.ml
===================================================================
--- trunk/Toss/Solver/Structure.ml 2011-03-24 13:27:48 UTC (rev 1385)
+++ trunk/Toss/Solver/Structure.ml 2011-03-24 16:08:04 UTC (rev 1386)
@@ -80,7 +80,11 @@
StringMap.fold (fun r ar si -> (r,ar)::si)
struc.rel_signature []
+let rel_sizes struc =
+ StringMap.fold (fun r tups si -> (r,Tuples.cardinal tups)::si)
+ struc.relations []
+
(* Return the list of relation tuples incident to an element [e] in [struc]. *)
let incident struc e =
let acc_incident rname inc_map acc =
Modified: trunk/Toss/Solver/Structure.mli
===================================================================
--- trunk/Toss/Solver/Structure.mli 2011-03-24 13:27:48 UTC (rev 1385)
+++ trunk/Toss/Solver/Structure.mli 2011-03-24 16:08:04 UTC (rev 1386)
@@ -61,6 +61,9 @@
val rel_signature : structure -> (string * int) list
+(** Cardinality of graphs of all relations in the structure. *)
+val rel_sizes : structure -> (string * int) list
+
(** {2 Printing structures} *)
(** Print the elements [e] as string. *)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|