Changeset 2996


Ignore:
Timestamp:
Mar 28, 2013, 10:22:29 AM (4 years ago)
Author:
sacerdot
Message:

Printing of graphs now starts from the entry point.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extracted/joint_printer.ml

    r2987 r2996  
    10571057                                                                  -> __ ->
    10581058                                                                  __) -> __
    1059                                                                   -> __ ->
    1060                                                                   __);
     1059                                                                  -> __ -> __
     1060                                                                  -> __);
    10611061                                                      print_statementT :
    10621062                                                      ('statementT ->
     
    10651065(** val code_iteration_params_rect_Type4 :
    10661066    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1067     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1068     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1067    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1068    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    10691069let rec code_iteration_params_rect_Type4 p globals h_mk_code_iteration_params x_367 =
    10701070  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    10761076(** val code_iteration_params_rect_Type5 :
    10771077    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1078     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1079     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1078    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1079    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    10801080let rec code_iteration_params_rect_Type5 p globals h_mk_code_iteration_params x_369 =
    10811081  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    10871087(** val code_iteration_params_rect_Type3 :
    10881088    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1089     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1090     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1089    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1090    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    10911091let rec code_iteration_params_rect_Type3 p globals h_mk_code_iteration_params x_371 =
    10921092  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    10981098(** val code_iteration_params_rect_Type2 :
    10991099    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1100     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1101     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1100    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1101    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    11021102let rec code_iteration_params_rect_Type2 p globals h_mk_code_iteration_params x_373 =
    11031103  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    11091109(** val code_iteration_params_rect_Type1 :
    11101110    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1111     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1112     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1111    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1112    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    11131113let rec code_iteration_params_rect_Type1 p globals h_mk_code_iteration_params x_375 =
    11141114  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    11201120(** val code_iteration_params_rect_Type0 :
    11211121    Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    1122     (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    1123     -> ('a1, 'a2) code_iteration_params -> 'a3 **)
     1122    (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1)
     1123    -> 'a3) -> ('a1, 'a2) code_iteration_params -> 'a3 **)
    11241124let rec code_iteration_params_rect_Type0 p globals h_mk_code_iteration_params x_377 =
    11251125  let { cip_print_serialization_params = cip_print_serialization_params0;
     
    11371137(** val fold_code0 :
    11381138    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    1139     -> (__ -> 'a2 -> 'a3 -> 'a3) -> __ -> 'a3 -> 'a3 **)
    1140 let rec fold_code0 p globals xxx x_392 x_393 x_394 =
     1139    -> (__ -> 'a2 -> 'a3 -> 'a3) -> __ -> __ -> 'a3 -> 'a3 **)
     1140let rec fold_code0 p globals xxx x_392 x_393 x_394 x_395 =
    11411141  (let { cip_print_serialization_params = x; fold_code = yyy;
    11421142     print_statementT = x0 } = xxx
    11431143   in
    1144   Obj.magic yyy) __ x_392 x_393 x_394
     1144  Obj.magic yyy) __ x_392 x_393 x_394 x_395
    11451145
    11461146(** val print_statementT :
     
    11531153    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    11541154    -> ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) ->
    1155     __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
     1155    __ -> __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
    11561156let code_iteration_params_inv_rect_Type4 x2 x4 hterm h1 =
    11571157  let hcut = code_iteration_params_rect_Type4 x2 x4 h1 hterm in hcut __
     
    11601160    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    11611161    -> ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) ->
    1162     __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
     1162    __ -> __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
    11631163let code_iteration_params_inv_rect_Type3 x2 x4 hterm h1 =
    11641164  let hcut = code_iteration_params_rect_Type3 x2 x4 h1 hterm in hcut __
     
    11671167    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    11681168    -> ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) ->
    1169     __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
     1169    __ -> __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
    11701170let code_iteration_params_inv_rect_Type2 x2 x4 hterm h1 =
    11711171  let hcut = code_iteration_params_rect_Type2 x2 x4 h1 hterm in hcut __
     
    11741174    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    11751175    -> ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) ->
    1176     __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
     1176    __ -> __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
    11771177let code_iteration_params_inv_rect_Type1 x2 x4 hterm h1 =
    11781178  let hcut = code_iteration_params_rect_Type1 x2 x4 h1 hterm in hcut __
     
    11811181    Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params
    11821182    -> ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) ->
    1183     __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
     1183    __ -> __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3 **)
    11841184let code_iteration_params_inv_rect_Type0 x2 x4 hterm h1 =
    11851185  let hcut = code_iteration_params_rect_Type0 x2 x4 h1 hterm in hcut __
     
    13611361let graph_code_iteration_params gp globals pp =
    13621362  { cip_print_serialization_params =
    1363     (graph_print_serialization_params gp pp); fold_code = (fun _ f m a ->
     1363    (graph_print_serialization_params gp pp); fold_code =
     1364    (fun _ f m initl a ->
    13641365    visit_graph (fun stmt ->
    13651366      match Joint.stmt_implicit_label (Joint.gp_to_p__o__stmt_pars gp)
     
    13671368      | Types.None -> Types.None
    13681369      | Types.Some label -> let p = label in Types.Some p) (fun n ->
    1369       Obj.magic f n) a (Types.Some Positive.One) (let m' = Obj.magic m in m')
     1370      Obj.magic f n) a (Types.Some
     1371      (Identifiers.word_of_identifier PreIdentifiers.LabelTag
     1372        (Obj.magic initl))) (let m' = Obj.magic m in m')
    13701373      (Identifiers.id_map_size PreIdentifiers.LabelTag (Obj.magic m)));
    13711374    print_statementT =
     
    13851388let lin_code_iteration_params lp globals pp =
    13861389  { cip_print_serialization_params = (lin_print_serialization_params lp pp);
    1387     fold_code = (fun _ f m a ->
    1388     (Util.foldl (fun res x ->
     1390    fold_code = (fun _ f m x a ->
     1391    (Util.foldl (fun res x0 ->
    13891392      let { Types.fst = pc; Types.snd = res' } = res in
    1390       { Types.fst = (Nat.S pc); Types.snd = (Obj.magic f pc x res') })
     1393      { Types.fst = (Nat.S pc); Types.snd = (Obj.magic f pc x0 res') })
    13911394      { Types.fst = Nat.O; Types.snd = a } (Obj.magic m)).Types.snd);
    13921395    print_statementT = (fun linstr ->
     
    14101413       ((cip.cip_print_serialization_params.print_code_point cp), (List.Cons
    14111414       ((cip.print_statementT stmt), List.Nil))))), acc))
    1412     f.Joint.joint_if_code List.Nil
     1415    f.Joint.joint_if_code f.Joint.joint_if_entry List.Nil
    14131416
    14141417(** val print_joint_function :
  • extracted/joint_printer.mli

    r2982 r2996  
    551551                                                                  -> __ ->
    552552                                                                  __) -> __
    553                                                                   -> __ ->
    554                                                                   __);
     553                                                                  -> __ -> __
     554                                                                  -> __);
    555555                                                      print_statementT :
    556556                                                      ('statementT ->
     
    559559val code_iteration_params_rect_Type4 :
    560560  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    561   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    562   -> ('a1, 'a2) code_iteration_params -> 'a3
     561  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     562  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    563563
    564564val code_iteration_params_rect_Type5 :
    565565  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    566   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    567   -> ('a1, 'a2) code_iteration_params -> 'a3
     566  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     567  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    568568
    569569val code_iteration_params_rect_Type3 :
    570570  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    571   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    572   -> ('a1, 'a2) code_iteration_params -> 'a3
     571  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     572  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    573573
    574574val code_iteration_params_rect_Type2 :
    575575  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    576   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    577   -> ('a1, 'a2) code_iteration_params -> 'a3
     576  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     577  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    578578
    579579val code_iteration_params_rect_Type1 :
    580580  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    581   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    582   -> ('a1, 'a2) code_iteration_params -> 'a3
     581  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     582  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    583583
    584584val code_iteration_params_rect_Type0 :
    585585  Joint.params -> AST.ident List.list -> ('a1 print_serialization_params ->
    586   (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __) -> ('a2 -> 'a1) -> 'a3)
    587   -> ('a1, 'a2) code_iteration_params -> 'a3
     586  (__ -> (__ -> 'a2 -> __ -> __) -> __ -> __ -> __ -> __) -> ('a2 -> 'a1) ->
     587  'a3) -> ('a1, 'a2) code_iteration_params -> 'a3
    588588
    589589val cip_print_serialization_params :
     
    593593val fold_code0 :
    594594  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    595   (__ -> 'a2 -> 'a3 -> 'a3) -> __ -> 'a3 -> 'a3
     595  (__ -> 'a2 -> 'a3 -> 'a3) -> __ -> __ -> 'a3 -> 'a3
    596596
    597597val print_statementT :
     
    602602  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    603603  ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) -> __ ->
    604   __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
     604  __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
    605605
    606606val code_iteration_params_inv_rect_Type3 :
    607607  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    608608  ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) -> __ ->
    609   __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
     609  __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
    610610
    611611val code_iteration_params_inv_rect_Type2 :
    612612  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    613613  ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) -> __ ->
    614   __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
     614  __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
    615615
    616616val code_iteration_params_inv_rect_Type1 :
    617617  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    618618  ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) -> __ ->
    619   __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
     619  __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
    620620
    621621val code_iteration_params_inv_rect_Type0 :
    622622  Joint.params -> AST.ident List.list -> ('a1, 'a2) code_iteration_params ->
    623623  ('a1 print_serialization_params -> (__ -> (__ -> 'a2 -> __ -> __) -> __ ->
    624   __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
     624  __ -> __ -> __) -> ('a2 -> 'a1) -> __ -> 'a3) -> 'a3
    625625
    626626val code_iteration_params_jmdiscr :
  • src/joint/joint_printer.ma

    r2985 r2996  
    7676 { cip_print_serialization_params :> print_serialization_params string p
    7777 ; fold_code:
    78     ∀A:Type[0]. (code_point p → statementT → A → A) → codeT p globals → A → A
     78    ∀A:Type[0]. (code_point p → statementT → A → A) → codeT p globals →
     79     code_point p → A → A
    7980 ; print_statementT: statementT → string
    8081 }.
     
    237238  mk_code_iteration_params …
    238239   (graph_print_serialization_params … pp)
    239    (λA.λf:code_point (graph_params_to_params …) → ?.λM.λa.
     240   (λA.λf:code_point (graph_params_to_params …) → ?.λM.λinitl.λa.
    240241     visit_graph (joint_statement … gp globals)
    241242     (λstmt. match stmt_implicit_label ?? stmt with
    242243       [ None ⇒ None … | Some label ⇒ match label with [an_identifier p ⇒ Some … p]])
    243      ? (λn. f (an_identifier … n)) a (Some … one)
     244     ? (λn. f (an_identifier … n)) a
     245     (Some … (word_of_identifier … initl))
    244246     (match M with [an_id_map M' ⇒ M']) (id_map_size … M))
    245247     (print_joint_statement … pp … (graph_print_serialization_params … pp)).
     
    259261  mk_code_iteration_params ?? (? × (joint_statement ??)) ?
    260262   (lin_print_serialization_params … pp)
    261    (λA.λf:code_point (lin_params_to_params …) → ?.λM:codeT lp globals.
     263   (λA.λf:code_point (lin_params_to_params …) → ?.λM:codeT lp globals.λ_.
    262264    λa.
    263265     \snd (foldl ??
     
    284286       [ print_code_point … cip cp;
    285287         print_statementT … cip stmt ]::acc)
    286     (joint_if_code … f) [].
     288    (joint_if_code … f) (joint_if_entry … f) [].
    287289
    288290definition print_joint_function:
Note: See TracChangeset for help on using the changeset viewer.