From: Lucca Hirschi Date: Mon, 2 Jul 2012 09:00:42 +0000 (+0200) Subject: Implem of Asta.print X-Git-Tag: Core~21 X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=commitdiff_plain;h=8beacdfe24b6e93a7c1a4faee4c5587104f5c1ad Implem of Asta.print --- diff --git a/src/asta.ml b/src/asta.ml index 4e53bcd..cb4521e 100644 --- a/src/asta.ml +++ b/src/asta.ml @@ -2,7 +2,7 @@ (* *) (* TAToo *) (* *) -(* ? *) +(* Lucca Hirschi, ? *) (* ? *) (* *) (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *) @@ -34,6 +34,11 @@ struct let st (st,la,f) = st let la (st,la,f) = la let fo (st,la,f) = f + let print fmt (st,la,f) = + Format.fprintf fmt "(%a,%s,%a)" + State.print st + "TODO la" + Formula.print f end module SetT = @@ -42,11 +47,11 @@ struct end type t = { - reco : StateSet.t; - selec : StateSet.t; - bottom : StateSet.t; - top : StateSet.t; - trans : SetT.t; + mutable reco : StateSet.t; + mutable selec : StateSet.t; + mutable bottom : StateSet.t; + mutable top : StateSet.t; + mutable trans : SetT.t; } exception Not_found_transition @@ -68,6 +73,21 @@ let transitions asta st = | (a,s,l) :: tl -> (s,l) :: (remove_states tl) in remove_states (SetT.elements (SetT.filter filter asta.trans)) -let print fmt asta = () + +let print fmt asta = + let pp = Format.fprintf fmt in + pp "Recognizing states: "; + StateSet.print fmt asta.reco; + pp "\nSelecting states: "; + StateSet.print fmt asta.selec; + pp "\nBottom states: "; + StateSet.print fmt asta.bottom; + pp "\nTop states: "; + StateSet.print fmt asta.top; + pp "\nTransitions: \n"; + Format.fprintf fmt "{@[ %a @]}" (* todo: check boxes *) + (Pretty.print_list ~sep:"@, " (Transition.print)) + (SetT.elements (asta.trans)) + let to_file out asta = () diff --git a/src/asta.mli b/src/asta.mli index 76957e6..0dd1994 100644 --- a/src/asta.mli +++ b/src/asta.mli @@ -15,6 +15,7 @@ (** Implementation of alternating selecting tree automata (ASTA) *) + type state (** The type of states *) diff --git a/src/test.ml b/src/test.ml index 465e409..df5b112 100644 --- a/src/test.ml +++ b/src/test.ml @@ -20,6 +20,8 @@ *) module F = Formula +module G = Asta + (* to force ocaml build to add Formula to the dependency chain even if we don't use it yet*)