X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Frun.ml;h=444cce790723ef93d02c70f39c87f5f3c54545c6;hb=445457b2dc5ca11cb3d305c346fe7937f29ba2a9;hp=e24462f47f09a7de102139812fc037163e18d109;hpb=6b4b9309e0f49f9a87d97ea87829aa74614dedb7;p=tatoo.git diff --git a/src/run.ml b/src/run.ml index e24462f..444cce7 100644 --- a/src/run.ml +++ b/src/run.ml @@ -11,8 +11,40 @@ (* *) (***********************************************************************) -type t = int - -let compute tree asta = 0 - -let print fmt run = () +module Node = +struct + type t = int + let hash n = n + let compare n1 n2 = n1 - n2 + let equal n1 n2 = n1 = n2 +end + +module NodeHash = Hashtbl.Make (Node) + +type t = (StateSet.t*StateSet.t) NodeHash.t +(** Map from node to query and recognizing states *) + +let compute tree asta = + let size_tree = 10000 in (* todo *) + let map = NodeHash.create size_tree in + + + map + +let print fmt run = + let print_d_set fmt (s_1,s_2) = + Format.fprintf fmt "@[(%a,@ %a)@]" + StateSet.print s_1 StateSet.print s_2 in + let print_map fmt run = + let pp = Format.fprintf fmt in + if NodeHash.length run = 0 + then Format.fprintf fmt "ø" + else + NodeHash.iter (fun cle set -> pp "| %i-->%a@ " cle print_d_set set) + run in + let print_box fmt run = + let pp = Format.fprintf fmt in + pp "@[# Mapping: %a@ @]" + print_map run + in + Format.fprintf fmt "@[##### RUN #####@, %a@ @]@." print_box run