Project

General

Profile

Download (2.15 KB) Statistics
| Branch: | Tag: | Revision:
1
open Basetypes
2

    
3
type mode_t = Outer | Inner | Enter
4

    
5
type 't success_t = path_t -> 't
6

    
7
type 't fail_t = { local : 't; global : 't }
8

    
9
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
  | J
16
      : ( junction_name_t,
17
          't wrapper_t -> 't success_t -> 't fail_t -> 't,
18
          't )
19
        tag_t
20

    
21
type ('a, 'b, 't) theta_t = ('a, 'b, 't) tag_t -> 'a -> 'b
22

    
23
module type ThetaType = sig
24
  type t
25

    
26
  val theta : ('a, 'b, t) theta_t
27
end
28

    
29
let pp_mode fmt mode =
30
  match mode with
31
  | Outer ->
32
    Format.fprintf fmt "Outer"
33
  | Inner ->
34
    Format.fprintf fmt "Inner"
35
  | Enter ->
36
    Format.fprintf fmt "Enter"
37

    
38
let pp_tag : type a b t. Format.formatter -> (a, b, t) tag_t -> unit =
39
 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
  type act_t = Action.t
52

    
53
  type cond_t = Condition.t
54

    
55
  let nil = Action.nil
56

    
57
  let aquote = Action.aquote
58

    
59
  let open_path = Action.open_path
60

    
61
  let close_path = Action.close_path
62

    
63
  let call = Action.call
64

    
65
  let pp_act = Action.pp_act
66

    
67
  let cquote = Condition.cquote
68

    
69
  let tru = Condition.tru
70

    
71
  let event = Condition.event
72

    
73
  let active = Condition.active
74

    
75
  let ( && ) = Condition.( && )
76

    
77
  let neg = Condition.neg
78

    
79
  let pp_cond = Condition.pp_cond
80
end
81

    
82
module type TransformerType = sig
83
  type act_t = Action.t
84

    
85
  type cond_t = Condition.t
86

    
87
  type t
88

    
89
  include ActionType with type t := act_t
90

    
91
  include ConditionType with type t := cond_t
92

    
93
  val null : t
94

    
95
  val bot : t
96

    
97
  val ( >> ) : t -> t -> t
98

    
99
  val eval_act : (module ThetaType with type t = t) -> act_t -> t
100

    
101
  val eval_cond : cond_t -> t -> t -> t
102

    
103
  (* val mktransformer : t -> unit *)
104
  val mkprincipal : t -> Lustre_types.program_t
105

    
106
  val mkcomponent : 'c call_t -> 'c -> t -> Lustre_types.program_t
107
end
108

    
109
module type ComparableTransformerType = sig
110
  include TransformerType
111

    
112
  val ( == ) : t -> t -> bool
113
end
114

    
115
(* Local Variables: *)
116
(* compile-command:"make -C ../../../.." *)
117
(* End: *)
(6-6/9)