Project

General

Profile

Download (2.15 KB) Statistics
| Branch: | Tag: | Revision:
1 93119c3f ploc
open Basetypes
2
3 ca7ff3f7 Lélio Brun
type mode_t = Outer | Inner | Enter
4 93119c3f ploc
5
type 't success_t = path_t -> 't
6 ca7ff3f7 Lélio Brun
7
type 't fail_t = { local : 't; global : 't }
8
9 93119c3f ploc
type 't wrapper_t = path_t -> 't -> 't
10
11
type ('a, 'b, 't) tag_t =
12
  | E : (path_t, path_t -> frontier_t -> 't, 't) tag_t
13
  | D : (path_t, 't, 't) tag_t
14
  | X : (path_t, frontier_t -> 't, 't) tag_t
15 ca7ff3f7 Lélio Brun
  | J
16
      : ( junction_name_t,
17
          't wrapper_t -> 't success_t -> 't fail_t -> 't,
18
          't )
19
        tag_t
20 93119c3f ploc
21
type ('a, 'b, 't) theta_t = ('a, 'b, 't) tag_t -> 'a -> 'b
22
23 ca7ff3f7 Lélio Brun
module type ThetaType = sig
24 93119c3f ploc
  type t
25 ca7ff3f7 Lélio Brun
26 93119c3f ploc
  val theta : ('a, 'b, t) theta_t
27
end
28
29
let pp_mode fmt mode =
30
  match mode with
31 ca7ff3f7 Lélio Brun
  | Outer ->
32
    Format.fprintf fmt "Outer"
33
  | Inner ->
34
    Format.fprintf fmt "Inner"
35
  | Enter ->
36
    Format.fprintf fmt "Enter"
37 93119c3f ploc
38
let pp_tag : type a b t. Format.formatter -> (a, b, t) tag_t -> unit =
39 ca7ff3f7 Lélio Brun
 fun fmt tag ->
40
  match tag with
41
  | E ->
42
    Format.fprintf fmt "e"
43
  | D ->
44
    Format.fprintf fmt "d"
45
  | X ->
46
    Format.fprintf fmt "x"
47
  | J ->
48
    Format.fprintf fmt "j"
49
50
module TransformerStub = struct
51 93119c3f ploc
  type act_t = Action.t
52 ca7ff3f7 Lélio Brun
53 93119c3f ploc
  type cond_t = Condition.t
54
55
  let nil = Action.nil
56 ca7ff3f7 Lélio Brun
57 93119c3f ploc
  let aquote = Action.aquote
58 ca7ff3f7 Lélio Brun
59 93119c3f ploc
  let open_path = Action.open_path
60 ca7ff3f7 Lélio Brun
61 93119c3f ploc
  let close_path = Action.close_path
62 ca7ff3f7 Lélio Brun
63 93119c3f ploc
  let call = Action.call
64 ca7ff3f7 Lélio Brun
65 93119c3f ploc
  let pp_act = Action.pp_act
66
67
  let cquote = Condition.cquote
68 ca7ff3f7 Lélio Brun
69 93119c3f ploc
  let tru = Condition.tru
70 ca7ff3f7 Lélio Brun
71 93119c3f ploc
  let event = Condition.event
72 ca7ff3f7 Lélio Brun
73 93119c3f ploc
  let active = Condition.active
74 ca7ff3f7 Lélio Brun
75 93119c3f ploc
  let ( && ) = Condition.( && )
76 ca7ff3f7 Lélio Brun
77 93119c3f ploc
  let neg = Condition.neg
78 ca7ff3f7 Lélio Brun
79 93119c3f ploc
  let pp_cond = Condition.pp_cond
80
end
81
82 ca7ff3f7 Lélio Brun
module type TransformerType = sig
83 93119c3f ploc
  type act_t = Action.t
84 ca7ff3f7 Lélio Brun
85 93119c3f ploc
  type cond_t = Condition.t
86 ca7ff3f7 Lélio Brun
87 93119c3f ploc
  type t
88
89
  include ActionType with type t := act_t
90 ca7ff3f7 Lélio Brun
91 93119c3f ploc
  include ConditionType with type t := cond_t
92
93
  val null : t
94 ca7ff3f7 Lélio Brun
95 93119c3f ploc
  val bot : t
96 ca7ff3f7 Lélio Brun
97 93119c3f ploc
  val ( >> ) : t -> t -> t
98 ca7ff3f7 Lélio Brun
99 93119c3f ploc
  val eval_act : (module ThetaType with type t = t) -> act_t -> t
100 ca7ff3f7 Lélio Brun
101 93119c3f ploc
  val eval_cond : cond_t -> t -> t -> t
102 ca7ff3f7 Lélio Brun
103 69c96b6c ploc
  (* val mktransformer : t -> unit *)
104 6eda0c25 ploc
  val mkprincipal : t -> Lustre_types.program_t
105 ca7ff3f7 Lélio Brun
106 6eda0c25 ploc
  val mkcomponent : 'c call_t -> 'c -> t -> Lustre_types.program_t
107 93119c3f ploc
end
108
109 ca7ff3f7 Lélio Brun
module type ComparableTransformerType = sig
110 93119c3f ploc
  include TransformerType
111
112
  val ( == ) : t -> t -> bool
113
end
114 6eda0c25 ploc
115
(* Local Variables: *)
116
(* compile-command:"make -C ../../../.." *)
117
(* End: *)