Project

General

Profile

Revision df924fb3

View differences:

src/env.ml
37 37
  IMap.mem ident env
38 38

  
39 39
let iter env f = IMap.iter f env
40

  
40 41
 
41 42
let overwrite x y =
42 43
  IMap.merge (
src/mutation.ml
339 339
  else if Random.int 100 > threshold_random_int then
340 340
    Random.int 10
341 341
  else if Random.int 100 > threshold_switch_int then
342
    let idx = Random.int (List.length !int_consts) in
343
    List.nth !int_consts idx
342
    try
343
	let idx = Random.int (List.length !int_consts) in
344
        List.nth !int_consts idx
345
    with _ -> i
344 346
  else
345 347
    i
346 348
  
......
590 592
    else 
591 593
      let random_mutation = 
592 594
	match Random.int 6 with
593
	| 5 -> IncrIntCst (Random.int (IntSet.cardinal !records.consts))
594
	| 4 -> DecrIntCst (Random.int (IntSet.cardinal !records.consts))
595
	| 3 -> SwitchIntCst (Random.int (IntSet.cardinal !records.consts), Random.int (-1 + IntSet.cardinal !records.consts))
596
	| 2 -> Pre (Random.int !records.nb_pre)
597
	| 1 -> Boolexpr (Random.int !records.nb_boolexpr)
595
	| 5 -> IncrIntCst (try Random.int (IntSet.cardinal !records.consts) with _ -> 0)
596
	| 4 -> DecrIntCst (try Random.int (IntSet.cardinal !records.consts) with _ -> 0)
597
	| 3 -> SwitchIntCst ((try Random.int (IntSet.cardinal !records.consts) with _ -> 0), (try Random.int (-1 + IntSet.cardinal !records.consts) with _ -> 0))
598
	| 2 -> Pre (try Random.int !records.nb_pre with _ -> 0)
599
	| 1 -> Boolexpr (try Random.int !records.nb_boolexpr with _ -> 0)
598 600
	| 0 -> let bindings = OpCount.bindings !records.nb_op in
599
	       let op, nb_op = List.nth bindings (Random.int (List.length bindings)) in
600
	       let new_op = List.nth (op_mutation op) (Random.int (List.length (op_mutation op))) in
601
	       Op (op, Random.int nb_op, new_op)
601
	       let op, nb_op = List.nth bindings (try Random.int (List.length bindings) with _ -> 0) in
602
	       let new_op = List.nth (op_mutation op) (try Random.int (List.length (op_mutation op)) with _ -> 0) in
603
	       Op (op, (try Random.int nb_op with _ -> 0), new_op)
602 604
	| _ -> assert false
603 605
      in
604 606
      if List.mem random_mutation mutants then
src/sortProg.ml
1 1
open Graph
2 2
open Corelang
3
module TopologicalDepGraph = Topological.Make_stable(Causality.IdentDepGraph)
3
module TopologicalDepGraph = Topological.Make(Causality.IdentDepGraph)
4 4

  
5 5
let get_node nid prog =
6 6
  List.find (fun t -> match t.top_decl_desc with Node n -> n.node_id = nid | _ -> false) prog
src/utils.ml
40 40
  let equal n1 n2 = n1 = n2
41 41
end
42 42

  
43
module IMap = Map.Make(IdentModule)
43
module IMap = Mmap.Make(IdentModule)
44 44

  
45 45
module ISet = Set.Make(IdentModule)
46 46

  
test/src/arrays_arnaud/MatrixAddition.lus
1
const MatrixAddition_Constant_Value = [ [ 2, 3, 4 ], [ 5, 6, 7 ] ] ;
2
const MatrixAddition_Constant1_Value = [ [ 8, 9, 10 ], [ 11, 12, 13 ] ] ;
3
const MatrixAddition_Constant2_Value = [ [ 2, 3, 4 ] ] ;
4
const MatrixAddition_Constant4_Value = [ [ 5 ], [ 6 ], [ 7 ] ] ;
5
const MatrixAddition_Constant5_Value = [ [ 11 ], [ 12 ], [ 13 ] ] ;
6

  
7
node MatrixAddition (
8
	In1_Out1_11 : int)
9
returns (
10
	Out1_In1_93 : int^2^3 ;
11
	Out3_In1_105 : int^3^1 ;
12
	Out2_In1_117 : int^1^3) ;
13
var
14
	Sum_Out1_61 : int^2^3 ;
15
	Sum1_Out1_71 : int^1^3 ;
16
	Sum2_Out1_81 : int^3^1 ;
17
	Sum_In1_59 : int^2^3 ;
18
	Sum_In2_60 : int^2^3 ;
19
	Sum1_In1_69 : int^1^3 ;
20
	Sum1_In2_70 : int^1^3 ;
21
	Sum2_In1_79 : int^3^1 ;
22
	Sum2_In2_80 : int^3^1 ;
23
let
24
	Sum_Out1_61 = Sum_In1_59 + Sum_In2_60 ;
25
	Sum1_Out1_71 = Sum1_In1_69 + Sum1_In2_70 ;
26
	Sum2_Out1_81 = Sum2_In1_79 + Sum2_In2_80 ;
27
	Sum1_In1_69 = MatrixAddition_Constant2_Value ;
28
	Sum2_In1_79 = MatrixAddition_Constant4_Value ;
29
	Sum2_In2_80 = MatrixAddition_Constant5_Value ;
30
	Out1_In1_93 = Sum_Out1_61 ;
31
	Sum_In1_59 = MatrixAddition_Constant_Value ;
32
	Sum_In2_60 = MatrixAddition_Constant1_Value ;
33
	Out2_In1_117 = Sum1_Out1_71 ;
34
	Out3_In1_105 = Sum2_Out1_81 ;
35
	Sum1_In2_70 = In1_Out1_11 ;
36
	--! MAIN : true ;
37
tel
test/src/arrays_arnaud/MatrixAndArrays.lus
1
#open "dummy_lib"
2

  
3
const MatrixAndArrays_Constant_Value = [ [ 2.2, 3.3, 4.4, 2.2, 4.4, 3.3 ] ] ;
4
const MatrixAndArrays_Gain_Gain = [ [ 2.1, 1.0, 3.0, 4.2 ] ] ;
5
const MatrixAndArrays_UnitDelay_InitialValue = [ [ 1.1, 2.2, 1.0, 1.0 ] ] ;
6

  
7

  
8
node MatrixAndArrays (
9
	In1_Out1_11 : real^2^3)
10
returns (
11
	Out1_In1_57 : real^2^2) ;
12
var
13
	Gain_Out1_28 : real^2^2 ;
14
	Product_Out1_40 : real^2^2 ;
15
	UnitDelay_Out1_45 : real^2^2 ;
16
	Gain_In1_27 : real^2^2 ;
17
	Product_In1_38 : real^2^3 ;
18
	Product_In2_39 : real^3^2 ;
19
	UnitDelay_In1_44 : real^2^2 ;
20
let
21
	Gain_Out1_28 = _MatMul_real (2, 2, 2, MatrixAndArrays_Gain_Gain, Gain_In1_27) ;
22
	Product_Out1_40 = _MatMul_real (2, 3, Product_In1_38, Product_In2_39) ;
23
	UnitDelay_Out1_45 = MatrixAndArrays_UnitDelay_InitialValue -> pre UnitDelay_In1_44 ;
24
	Product_In1_38 = In1_Out1_11 ;
25
	Product_In2_39 = MatrixAndArrays_Constant_Value ;
26
	Gain_In1_27 = Product_Out1_40 ;
27
	UnitDelay_In1_44 = Gain_Out1_28 ;
28
	Out1_In1_57 = UnitDelay_Out1_45 ;
29
	--! MAIN : true ;
30
tel
test/src/arrays_arnaud/RelOpMatrix.lus
1
#open "dummy_lib"
2

  
3
const RelOpMatrix_Constant_Value = 1.1 ;
4

  
5

  
6
node RelOpMatrix (
7
	In1_Out1_11 : real^2)
8
returns (
9
	Out1_In1_37 : bool^2) ;
10
var
11
	RelationalOperator_Out1_25 : bool^2 ;
12
	RelationalOperator_In1_23 : real^2 ;
13
	RelationalOperator_In2_24 : real^2 ;
14
let
15
	RelationalOperator_Out1_25 = _Vect_Leqt_real (2, RelationalOperator_In1_23, RelationalOperator_In2_24) ;
16
	RelationalOperator_In1_23 = In1_Out1_11 ;
17
RelationalOperator_In2_24 = [ RelOpMatrix_Constant_Value, RelOpMatrix_Constant_Value ] ;
18
	Out1_In1_37 = RelationalOperator_Out1_25 ;
19
	--! MAIN : true ;
20
tel
test/src/arrays_arnaud/access1.lus
1
#open "dummy_lib"
2

  
3
node access(tab : int^3^4) returns (o:int)
4
var tab2,x;
5
let
6
  tab2 = [ 1, 2 ];
7
  x = 1^2^3[1];
8
  o = (tab[0][1]^2+test(pre o)+ tab2)[1];
9
tel
test/src/arrays_arnaud/arrays.lus
1
node add_vect_3 (in1,in2 : int^2) returns (out : int^2)
2
var t:int;
3
let
4
 t = in1[0];
5
out = [in1[0]+in2[0],in1[1]+in2[1]];
6
tel
7

  
8
node min_vect_2 (in : int^2) returns (out: int)
9
let
10
	out = if (in[0] < in[1]) then in[0] else in[1];
11
tel
12

  
13
node mumuse (in1 : int^2^2; mult : int) returns (out : int^4)
14
var
15
	tmp : int^2^2;
16
	tmp2 : int^2;
17
let
18
	tmp = [ [ in1[0][0]*mult , in1[0][1] ] , [ in1[1][0]*mult , in1[1][1] ] ];
19
	tmp2 = add_vect_3 ( tmp[0] , [ mult,mult ] );
20
	out = [ tmp[0][0] , min_vect_2 (tmp2) , tmp[0][1] , tmp2[1] ];
21
tel
test/src/arrays_arnaud/generic1.lus
1
#open "dummy_lib"
2

  
3
type choice = enum { one, two };
4
type entier = int;
5

  
6
const PI = 3;
7

  
8
const tab = [1.,2.,3.,4.];
9

  
10
const M1 = [ [ 2.1 ], [ 1.0 ], [ 3.0 ], [ 4.2 ] ] ;
11
const M2 = [ [ 1.1, 2.2, 1.0, 1.0 ] ] ;
12

  
13

  
14
node mult(
15
     in1 : real^4^1)
16
returns (
17
     out : real^1^1)
18
var l,p;
19
let
20
  l = [ tab, [3.,4.,5.,6.] ];
21
  p = l + [tab,tab+[3.,4.,5.,6.]];
22
  out = _MatMul_real (1,4,1,[ [ 2.1 ], [ 1.0 ], [ 3.0 ], [ 4.2 ] ], in1);
23
tel
24
    
25
node base(const p:int; x:int^(PI*p)) returns (y:int^p)
26
var z:int^(PI*p);
27
let
28
  z = imp2(PI*p, x);
29
  y = imp1(p, z);
30
tel
31

  
test/src/arrays_arnaud/generic2.lus
1
#open "dummy_lib"
2

  
3
const PI = 3;
4

  
5
    
6
node base(const p:int; x:int^(PI*p)) returns (y:int^p)
7
var z:int^(PI*p)^2;
8
    t;
9
let
10
  t = imp2(PI*p, x);
11
  z = [t, t];
12
  y = imp1(p, (pre z)[1]);
13
tel
14

  
test/src/arrays_arnaud/generic3.lus
1
#open "dummy_lib"
2

  
3
const PI = 3;
4

  
5
  
6
node base(const p:int; x:int^(PI*p)) returns (y:int^p)
7
var z:int^(PI*p);
8
let
9
  z = imp2(PI*p, x);
10
  y = imp1(p, z);
11
tel
12

  
13
node top(a:int) returns (y:int)
14
var x;
15
let
16
  x = [a,1,2,3,4,5,6,7,8,9,10,11,12,13,14];
17
  y = base (5, x)[0];
18
tel
test/src/clocks/clocks1.lus
1

  
2
node test (x:bool; d:bool) returns (a:int;b:int)
3
var e,f : bool;
4
let
5
  a = 1 when d;
6
  b = if x = d then 1 else 0;
7
  e = true fby e;
8
  f = if x then d else e;
9
tel
10

  
test/src/clocks/clocks2.lus
1

  
2
type choice = enum { one, two };
3
type entier = int;
4

  
5
const PI = 3;
6

  
7
node toto (x:int) returns (a:int;y:int)
8
var c : choice;b1, b2:entier;
9
let
10
  a = PI fby (a+1);
11
  c = if a=x then one else two ;
12
  b1 = 1 when one(c);
13
  b2 = 2 when two(c);
14
  y = merge c (one -> b1) (two -> b2);
15
tel
16

  
17
node test (x:bool) returns (y:int)
18
var a:int; b:int;
19
let
20
   (a,b) = toto(if x then 0 else 1);
21
   y = a ;
22
tel
23

  
test/src/clocks/oversampling0.lus
1

  
2
node f(x :int ) returns (cpt , y :int )
3
let
4
  y = x + 1;
5
  cpt = (0 fby cpt) + 1;
6
tel
7

  
8
node g(x :int ; c : bool ) returns (out :int )
9
var t, cpt , y, last_y :int;
10
let
11
  (cpt , y) = f(t);
12
  t = merge c (true -> x) (false -> last_y when false(c));
13
  last_y = 0 fby y;
14
  out = y when false(c);
15
tel
16
(*
17
node main (x:int) returns (out :int; c:bool)
18
var toto:int;
19
let
20
  toto = 1 ;
21
  c = true fby false fby c;
22
  out = g(x,toto=0);
23
tel
24
*)
test/src/kind_fmcad08/large/ccp01.lus
1

  
2

  
3
node top(onOff: bool; 
4
      decelSet: bool; 
5
      accelResume: bool; 
6
      cancel: bool; 
7
      brakePedal: bool; 
8
      carGear: int ; 
9
      carSpeed: real; 
10
      validInputs: bool)
11
      returns (OK:bool);
12

  
13
var
14
   mode: int ; 
15
      cruiseThrottle: real; 
16
      desiredSpeed: real; 
17
      VRP1: bool; 
18
      VRP2: bool; 
19
      CP8a: bool; 
20
      VRP3: bool; 
21
      VRP4: bool; 
22
      SP4: bool; 
23
      SP5: bool; 
24
      SP6: bool; 
25
      SP7: bool; 
26
      SP3b: bool; 
27
      SP3c: bool; 
28
      SP3: bool; 
29
      SP3a: bool; 
30
      SP2: bool; 
31
      SP1: bool; 
32
      SP8: bool; 
33
      SP9: bool; 
34
      SP10: bool; 
35
      SP11: bool;
36
   zz0: bool; 
37
   zz1: bool; 
38
   zz2: real; 
39
   zz3: bool; 
40
   zz4: bool; 
41
   zz5: real; 
42
   zz6: int ; 
43
   zz7: int ; 
44
   zz8: int ; 
45
   zz9: int ; 
46
   zz10: int ; 
47
   zz11: int ; 
48
   zz12: int ; 
49
   zz13: int ; 
50
   zz14: int ; 
51
   zz15: bool; 
52
   zz16: int ; 
53
   zz17: int ; 
54
   zz18: int ; 
55
   zz19: bool; 
56
   zz20: int ; 
57
   zz21: int ; 
58
   zz22: int ; 
59
   zz23: bool; 
60
   zz24: bool; 
61
   zz25: int ; 
62
   zz26: bool; 
63
   zz27: bool; 
64
   zz28: int ; 
65
   zz29: int ; 
66
   zz30: bool; 
67
   zz31: bool; 
68
   zz32: int ; 
69
   zz33: bool; 
70
   zz34: int ; 
71
   zz35: int ; 
72
   zz36: bool; 
73
   zz37: bool; 
74
   zz38: int ; 
75
   zz39: bool; 
76
   zz40: int ; 
77
   zz41: int ; 
78
   zz42: bool; 
79
   zz43: bool; 
80
   zz44: int ; 
81
   zz45: int ; 
82
   zz46: int ; 
83
   zz47: bool; 
84
   zz48: bool; 
85
   zz49: int ; 
86
   zz50: int ; 
87
   zz51: int ; 
88
   zz52: bool; 
89
   zz53: int ; 
90
   zz54: int ; 
91
   zz55: int ; 
92
   zz56: bool; 
93
   zz58: int ; 
94
   zz59: int ; 
95
   zz60: int ; 
96
   zz61: int ; 
97
   zz62: int ; 
98
   zz63: int ; 
99
   zz64: bool; 
100
   zz65: bool; 
101
   zz66: int ; 
102
   zz67: int ; 
103
   zz68: int ; 
104
   zz69: int ; 
105
   zz70: int ; 
106
   zz71: int ; 
107
   zz72: bool; 
108
   zz73: bool; 
109
   zz74: int ; 
110
   zz75: int ; 
111
   zz76: int ; 
112
   zz77: int ; 
113
   zz78: int ; 
114
   zz79: int ; 
115
   zz80: int ; 
116
   zz81: int ; 
117
   zz82: bool; 
118
   zz83: int ; 
119
   zz84: int ; 
120
   zz85: int ; 
121
   zz86: int ; 
122
   zz87: bool; 
123
   zz88: bool; 
124
   zz89: int ; 
125
   zz90: bool; 
126
   zz91: int ; 
127
   zz92: int ; 
128
   zz93: bool; 
129
   zz94: bool; 
130
   zz95: int ; 
131
   zz96: bool; 
132
   zz97: int ; 
133
   zz98: int ; 
134
   zz99: bool; 
135
   zz100: bool; 
136
   zz101: int ; 
137
   zz102: int ; 
138
   zz103: int ; 
139
   zz104: bool; 
140
   zz105: bool; 
141
   zz106: int ; 
142
   zz107: bool; 
143
   zz108: int ; 
144
   zz109: int ; 
145
   zz110: int ; 
146
   zz111: int ; 
147
   zz112: bool; 
148
   zz113: int ; 
149
   zz114: int ; 
150
   zz115: int ; 
151
   zz116: bool; 
152
   zz117: bool; 
153
   zz118: int ; 
154
   zz119: int ; 
155
   zz120: int ; 
156
   zz121: int ; 
157
   zz122: int ; 
158
   zz123: int ; 
159
   zz124: int ; 
160
   zz125: int ; 
161
   zz126: int ; 
162
   zz127: int ; 
163
   zz128: bool; 
164
   zz129: int ; 
165
   zz130: int ; 
166
   zz131: int ; 
167
   zz132: int ; 
168
   zz133: bool; 
169
   zz134: int ; 
170
   zz135: int ; 
171
   zz136: int ; 
172
   zz137: int ; 
173
   zz138: bool; 
174
   zz139: bool; 
175
   zz140: int ; 
176
   zz141: bool; 
177
   zz142: int ; 
178
   zz143: int ; 
179
   zz144: bool; 
180
   zz145: bool; 
181
   zz146: int ; 
182
   zz147: int ; 
183
   zz148: int ; 
184
   zz149: int ; 
185
   zz150: int ; 
186
   zz151: bool; 
187
   zz152: bool; 
188
   zz153: int ; 
189
   zz154: int ; 
190
   zz155: bool; 
191
   zz156: int ; 
192
   zz157: int ; 
193
   zz158: bool; 
194
   zz159: int ; 
195
   zz160: int ; 
196
   zz161: int ; 
197
   zz162: bool; 
198
   zz163: bool; 
199
   zz164: bool; 
200
   zz165: bool; 
201
   zz166: int ; 
202
   zz167: int ; 
203
   zz168: int ; 
204
   zz169: int ; 
205
   zz170: int ; 
206
   zz171: bool; 
207
   zz172: int ; 
208
   zz173: int ; 
209
   zz174: int ; 
210
   zz175: int ; 
211
   zz176: int ; 
212
   zz177: bool; 
213
   zz178: bool; 
214
   zz179: bool; 
215
   zz180: bool; 
216
   zz181: bool; 
217
   zz182: bool; 
218
   zz183: bool; 
219
   zz184: bool; 
220
   zz185: bool; 
221
   zz186: bool; 
222
   zz187: bool; 
223
   zz188: bool; 
224
   zz189: bool; 
225
   zz190: real; 
226
   zz191: bool; 
227
   zz192: bool; 
228
   zz193: bool; 
229
   zz194: bool; 
230
   zz195: bool; 
231
   zz196: bool; 
232
   zz197: bool; 
233
   zz198: bool; 
234
   zz199: bool; 
235
   zz200: bool; 
236
   zz201: bool; 
237
   zz202: bool; 
238
   zz203: bool; 
239
   zz204: real; 
240
   zz205: real; 
241
   zz206: bool; 
242
   zz207: bool; 
243
   zz208: bool; 
244
   zz209: bool; 
245
   zz210: bool; 
246
   zz211: real; 
247
   zz212: bool; 
248
   zz213: bool; 
249
   zz214: bool; 
250
   zz215: bool; 
251
   zz216: bool; 
252
   zz217: bool; 
253
   zz218: real; 
254
   zz219: real; 
255
   zz220: real; 
256
   zz221: real; 
257
   zz222: real; 
258
   zz223: real; 
259
   zz224: real; 
260
   zz225: real; 
261
   zz226: real; 
262
   zz227: real; 
263
   zz228: real; 
264
   zz229: real; 
265
   zz230: real; 
266
   zz231: bool; 
267
   zz232: bool; 
268
   zz233: bool; 
269
   zz234: bool; 
270
   zz235: bool; 
271
   zz236: bool; 
272
   zz237: bool; 
273
   zz238: bool; 
274
   zz239: bool;
275

  
276
let 
277
   zz166 = 
278
      (if (0 >= zz168)
279
         then 0
280
         else zz168);
281

  
282
   zz168 = 
283
      (if accelResume
284
         then zz167
285
         else 0);
286

  
287
   zz169 = (0 -> (pre zz170));
288

  
289
   zz172 = 
290
      (if (0 >= zz174)
291
         then 0
292
         else zz174);
293

  
294
   zz174 = 
295
      (if decelSet
296
         then zz173
297
         else 0);
298

  
299
   zz175 = (0 -> (pre zz176));
300

  
301
   zz156 = (0 -> (pre zz161));
302

  
303
   zz157 = (0 -> (pre mode));
304

  
305
   zz159 = 
306
      (if SP3c
307
         then 1
308
         else 0);
309

  
310
   (* Beginning transition segment: trans20
311
      <fired> is true if the following are true: 
312
         1. the previous transition guard was true, 
313
         2. the source node for the transition is active, 
314
         3. the condition for the transition to fire is true, and 
315
         4. no higher-priority transition has completed (not <complete>) *)
316
   zz93 = ((zz91 = 8) and 
317
      (((
318
      (if ((zz185 = true) = false)
319
         then 0
320
         else 1) <> 0) and 
321
      (
322
      (if ((zz186 = true) = false)
323
         then 0
324
         else 1) <> 0)) and 
325
      (not zz88)));
326

  
327
   (* Beginning transition segment: trans19
328
      <fired> is true if the following are true: 
329
         1. the previous transition guard was true, 
330
         2. the source node for the transition is active, 
331
         3. the condition for the transition to fire is true, and 
332
         4. no higher-priority transition has completed (not <complete>) *)
333
   zz99 = ((zz97 = 8) and 
334
      (((
335
      (if ((zz180 = true) = false)
336
         then 0
337
         else 1) <> 0) and 
338
      (
339
      (if ((zz186 = true) = false)
340
         then 0
341
         else 1) <> 0)) and 
342
      (not zz94)));
343

  
344
   (* Beginning transition segment: trans22
345
      <fired> is true if the following are true: 
346
         1. the previous transition guard was true, 
347
         2. the source node for the transition is active, 
348
         3. the condition for the transition to fire is true, and 
349
         4. no higher-priority transition has completed (not <complete>) *)
350
   zz104 = ((zz102 = 7) and 
351
      (((
352
      (if ((zz185 = true) = false)
353
         then 0
354
         else 1) <> 0) and 
355
      (
356
      (if ((zz186 = true) = false)
357
         then 0
358
         else 1) <> 0)) and 
359
      (not zz100)));
360

  
361
   (* Beginning transition segment: trans24
362
      <fired> is true if the following are true: 
363
         1. the previous transition guard was true, 
364
         2. the source node for the transition is active, 
365
         3. the condition for the transition to fire is true, and 
366
         4. no higher-priority transition has completed (not <complete>) *)
367
   zz24 = ((zz108 = 4) and 
368
      (
369
      (if ((zz185 = true) = false)
370
         then 0
371
         else 1) <> 0));
372

  
373
   (* Beginning transition segment: trans14
374
      <fired> is true if the following are true: 
375
         1. the previous transition guard was true, 
376
         2. the source node for the transition is active, 
377
         3. the condition for the transition to fire is true, and 
378
         4. no higher-priority transition has completed (not <complete>) *)
379
   zz30 = ((zz28 = 4) and 
380
      ((
381
      (if ((zz171 = true) = false)
382
         then 0
383
         else 1) <> 0) and 
384
      (not zz24)));
385

  
386
   (* Beginning transition segment: trans15
387
      <fired> is true if the following are true: 
388
         1. the previous transition guard was true, 
389
         2. the source node for the transition is active, 
390
         3. the condition for the transition to fire is true, and 
391
         4. no higher-priority transition has completed (not <complete>) *)
392
   zz36 = ((zz34 = 4) and 
393
      ((
394
      (if ((zz177 = true) = false)
395
         then 0
396
         else 1) <> 0) and 
397
      (not zz31)));
398

  
399
   (* Beginning transition segment: trans17
400
      <fired> is true if the following are true: 
401
         1. the previous transition guard was true, 
402
         2. the source node for the transition is active, 
403
         3. the condition for the transition to fire is true, and 
404
         4. no higher-priority transition has completed (not <complete>) *)
405
   zz42 = ((zz40 = 6) and 
406
      ((
407
      (if ((zz177 = false) = false)
408
         then 0
409
         else 1) <> 0) and 
410
      (not zz37)));
411

  
412
   (* Beginning transition segment: trans16
413
      <fired> is true if the following are true: 
414
         1. the previous transition guard was true, 
415
         2. the source node for the transition is active, 
416
         3. the condition for the transition to fire is true, and 
417
         4. no higher-priority transition has completed (not <complete>) *)
418
   zz47 = ((zz45 = 5) and 
419
      ((
420
      (if ((zz171 = false) = false)
421
         then 0
422
         else 1) <> 0) and 
423
      (not zz43)));
424

  
425
   OK = ((zz58 = 4) or 
426
      ((zz58 = 5) or 
427
      (zz58 = 6)));
428

  
429
   zz63 = 
430
      (if (not 
431
         (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
432
         ((zz101 >= 3) and 
433
         (zz101 <= 6)))
434
         then 
435
               (* <Enter state> path: On.Active maps to field: __root and value: 3 *)
436
               3
437
         else zz101);
438

  
439
   (* Beginning transition segment: trans18
440
      <fired> is true if the following are true: 
441
         1. the previous transition guard was true, 
442
         2. the source node for the transition is active, 
443
         3. the condition for the transition to fire is true, and 
444
         4. no higher-priority transition has completed (not <complete>) *)
445
   zz64 = ((not 
446
      (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
447
      ((zz101 >= 3) and 
448
      (zz101 <= 6))) and 
449

  
450
      (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
451
      ((zz63 >= 3) and 
452
      (zz63 <= 6)));
453

  
454
   (* Beginning transition segment: trans12
455
      <fired> is true if the following are true: 
456
         1. the previous transition guard was true, 
457
         2. the source node for the transition is active, 
458
         3. the condition for the transition to fire is true, and 
459
         4. no higher-priority transition has completed (not <complete>) *)
460
   zz116 = ((not 
461
      (* <In state> path: On maps to field: __root and value range: [2, 8] *)
462
      ((zz146 >= 2) and 
463
      (zz146 <= 8))) and 
464

  
465
      (* <In state> path: On maps to field: __root and value range: [2, 8] *)
466
      ((zz115 >= 2) and 
467
      (zz115 <= 8)));
468

  
469
   zz120 = 
470
      (if (zz142 = 1)
471
         then 
472
               (* <Exit state> path: Off maps to field: __root and value: 0 *)
473
               0
474
         else zz142);
475

  
476
   zz137 = 
477
      (if 
478
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
479
         ((zz156 >= 2) and 
480
         (zz156 <= 8))
481
         then 
482
               (* <Exit state> path: On maps to field: __root and value: 0 *)
483
               0
484
         else zz136);
485

  
486
   SP3c = true;
487

  
488
   zz171 = (zz170 = 20);
489

  
490
   (* Condition actions for transition segment: trans22: NONE
491
      Transition action(s) for transition: trans22
492
      <complete> is true if either: 
493
         1. this transition has completed, or 
494
         2. a higher-priority transition has already completed 
495
       *)
496
   zz105 = (zz104 or 
497
      zz100);
498

  
499
   zz127 = 
500
      (if (zz156 = 4)
501
         then 
502
               (* <Exit state> path: On.Active.Maintain maps to field: __root and value: 3 *)
503
               3
504
         else zz156);
505

  
506
   zz204 = cruiseThrottle;
507

  
508
   zz165 = (mode = 6);
509

  
510
   SP7 = ((not zz165) or 
511
      zz208);
512

  
513
   zz136 = 
514
      (if 
515
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
516
         ((zz156 >= 2) and 
517
         (zz156 <= 8))
518
         then zz123
519
         else zz135);
520

  
521
   (* Exit action(s) for transition: On_Init -> On_Active *)
522
   zz106 = 
523
      (if zz104
524
         then zz60
525
         else zz102);
526

  
527
   zz173 = (zz175 + 1);
528

  
529
   zz81 = 
530
      (if (zz147 = 4)
531
         then 
532
               (* <Exit state> path: On.Active.Maintain maps to field: __root and value: 3 *)
533
               3
534
         else zz147);
535

  
536
   zz181 = (carGear = 3);
537

  
538
   zz79 = 
539
      (if (zz84 = 6)
540
         then 
541
               (* <Exit state> path: On.Active.Decrease maps to field: __root and value: 3 *)
542
               3
543
         else zz84);
544

  
545
   (* Exit action(s) for transition: On_Active_Maintain -> On_Active_Decrease *)
546
   zz38 = 
547
      (if zz36
548
         then zz14
549
         else zz34);
550

  
551
   (* Exit action(s) for transition: On -> On_Init: NONE
552
      Transition action(s) for transition: On -> On_Init: NONE
553
      Entry action(s) for transition: On -> On_Init *)
554
   zz119 = 
555
      (if zz116
556
         then zz114
557
         else zz143);
558
   (* Transition segment: trans12 complete. *)
559

  
560
   zz78 = 
561
      (if (not (zz89 = 8))
562
         then 3
563
         else zz148);
564

  
565
   zz15 = 
566
      (if (zz34 = 4)
567
         then false
568
         else zz33);
569

  
570
   zz83 = 
571
      (if 
572
         (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
573
         ((zz147 >= 3) and 
574
         (zz147 <= 6))
575
         then zz81
576
         else zz147);
577

  
578
   zz54 = 
579
      (if (not (zz55 = 4))
580
         then 4
581
         else zz103);
582

  
583
   zz192 = (zz211 > desiredSpeed);
584

  
585
   zz16 = 
586
      (if (not (zz32 = 5))
587
         then 
588
               (* <Enter state> path: On.Active.Increase maps to field: __root and value: 5 *)
589
               5
590
         else zz32);
591

  
592
   zz158 = (false -> (pre zz162));
593

  
594
   SP3a = ((not (not zz163)) or 
595
      (not zz199));
596

  
597
   (* Exit action(s) for transition: On_Active -> On_Active_Maintain: NONE
598
      Transition action(s) for transition: On_Active -> On_Active_Maintain: NONE
599
      Entry action(s) for transition: On_Active -> On_Active_Maintain *)
600
   zz67 = 
601
      (if zz64
602
         then zz62
603
         else zz98);
604
   (* Transition segment: trans18 complete. *)
605

  
606
   (* Condition actions for transition segment: trans17: NONE
607
      Transition action(s) for transition: trans17
608
      <complete> is true if either: 
609
         1. this transition has completed, or 
610
         2. a higher-priority transition has already completed 
611
       *)
612
   zz43 = (zz42 or 
613
      zz37);
614

  
615
   zz76 = 
616
      (if (zz91 = 8)
617
         then 
618
               (* <Exit state> path: On.Inactive maps to field: __root and value: 2 *)
619
               2
620
         else zz91);
621

  
622
   zz80 = 
623
      (if (zz83 = 5)
624
         then 
625
               (* <Exit state> path: On.Active.Increase maps to field: __root and value: 3 *)
626
               3
627
         else zz83);
628

  
629
   zz198 = (zz197 or 
630
      zz196);
631

  
632
   zz193 = (desiredSpeed <> 0.0);
633

  
634
   SP1 = ((not (not zz186)) or 
635
      zz187);
636

  
637
   zz231 = (cruiseThrottle <= 100.0);
638

  
639
   zz123 = 
640
      (if (zz135 = 8)
641
         then 
642
               (* <Exit state> path: On.Inactive maps to field: __root and value: 2 *)
643
               2
644
         else zz135);
645

  
646
   zz19 = 
647
      (if (zz28 = 4)
648
         then false
649
         else zz27);
650

  
651
   (* Condition actions for transition segment: trans20: NONE
652
      Transition action(s) for transition: trans20
653
      <complete> is true if either: 
654
         1. this transition has completed, or 
655
         2. a higher-priority transition has already completed 
656
       *)
657
   zz94 = (zz93 or 
658
      zz88);
659

  
660
   cruiseThrottle = 
661
      (if zz201
662
         then zz226
663
         else 0.0);
664

  
665
   zz86 = 
666
      (if 
667
         (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
668
         ((zz147 >= 3) and 
669
         (zz147 <= 6))
670
         then 
671
               (* <Exit state> path: On.Active maps to field: __root and value: 2 *)
672
               2
673
         else zz85);
674

  
675
   VRP1 = (zz232 and 
676
      zz231);
677

  
678
   zz131 = 
679
      (if 
680
         (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
681
         ((zz156 >= 3) and 
682
         (zz156 <= 6))
683
         then zz125
684
         else zz130);
685

  
686
   zz235 = (desiredSpeed < 0.0);
687

  
688
   SP9 = ((not zz214) or 
689
      zz215);
690

  
691
   zz138 = 
692
      (if 
693
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
694
         ((zz156 >= 2) and 
695
         (zz156 <= 8))
696
         then zz133
697
         else zz158);
698

  
699
   zz65 = ((zz66 = 4) or 
700
      ((zz66 = 5) or 
701
      (zz66 = 6)));
702

  
703
   zz194 = (desiredSpeed >= 15.0);
704

  
705
   zz197 = (mode = 1);
706

  
707
   VRP3 = (not zz237);
708

  
709
   zz6 = 
710
      (if (not (zz49 = 4))
711
         then 
712
               (* <Enter state> path: On.Active.Maintain maps to field: __root and value: 4 *)
713
               4
714
         else zz49);
715

  
716
   (* Exit action(s) for transition: On_Active_Maintain -> On_Active_Increase *)
717
   zz33 = 
718
      (if zz30
719
         then zz19
720
         else zz27);
721

  
722
   zz134 = 
723
      (if 
724
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
725
         ((zz156 >= 2) and 
726
         (zz156 <= 8))
727
         then zz132
728
         else zz156);
729

  
730
   zz61 = 
731
      (if (not (zz63 = 4))
732
         then 
733
               (* <Enter state> path: On.Active.Maintain maps to field: __root and value: 4 *)
734
               4
735
         else zz63);
736

  
737
   (* Transition action(s) for transition: On_Active_Maintain -> On_Active_Increase: NONE
738
      Entry action(s) for transition: On_Active_Maintain -> On_Active_Increase *)
739
   zz34 = 
740
      (if zz30
741
         then zz16
742
         else zz32);
743
   (* Transition segment: trans14 complete. *)
744

  
745
   (* Exit action(s) for transition: On -> Off *)
746
   zz141 = 
747
      (if zz139
748
         then zz138
749
         else zz158);
750

  
751
   (* Beginning transition segment: trans13
752
      <fired> is true if the following are true: 
753
         1. the previous transition guard was true, 
754
         2. the source node for the transition is active, 
755
         3. the condition for the transition to fire is true, and 
756
         4. no higher-priority transition has completed (not <complete>) *)
757
   zz139 = (
758
      (* <In state> path: On maps to field: __root and value range: [2, 8] *)
759
      ((zz156 >= 2) and 
760
      (zz156 <= 8)) and 
761
      (not onOff));
762

  
763
   zz178 = accelResume;
764

  
765
   zz234 = (desiredSpeed >= 0.0);
766

  
767
   (* Transition action(s) for transition: On_Active_Decrease -> On_Active_Maintain: NONE
768
      Entry action(s) for transition: On_Active_Decrease -> On_Active_Maintain *)
769
   zz45 = 
770
      (if zz42
771
         then zz9
772
         else zz44);
773
   (* Transition segment: trans17 complete. *)
774

  
775
   zz121 = 
776
      (if (not (zz140 = 1))
777
         then 
778
               (* <Enter state> path: Off maps to field: __root and value: 1 *)
779
               1
780
         else zz140);
781

  
782
   zz184 = (true -> (pre zz183));
783

  
784
   (* Exit action(s) for transition: On -> On_Init: NONE
785
      Transition action(s) for transition: On -> On_Init: NONE
786
      Entry action(s) for transition: On -> On_Init *)
787
   zz118 = 
788
      (if zz116
789
         then zz113
790
         else zz115);
791
   (* Transition segment: trans12 complete. *)
792

  
793
   zz191 = (zz189 and 
794
      zz188);
795

  
796
   (* Transition action(s) for transition: On_Active_Maintain -> On_Active_Decrease: NONE
797
      Entry action(s) for transition: On_Active_Maintain -> On_Active_Decrease *)
798
   zz41 = 
799
      (if zz36
800
         then zz13
801
         else zz35);
802
   (* Transition segment: trans15 complete. *)
803

  
804
   (* Transition action(s) for transition: On_Active_Maintain -> On_Active_Increase: NONE
805
      Entry action(s) for transition: On_Active_Maintain -> On_Active_Increase *)
806
   zz35 = 
807
      (if zz30
808
         then zz17
809
         else zz29);
810
   (* Transition segment: trans14 complete. *)
811

  
812
   zz208 = (zz211 >= desiredSpeed);
813

  
814
   zz200 = (zz223 = 0.0);
815

  
816
   zz154 = 
817
      (if (not (zz156 = 1))
818
         then 1
819
         else zz157);
820

  
821
   zz73 = ((zz74 = 4) or 
822
      ((zz74 = 5) or 
823
      (zz74 = 6)));
824

  
825
   (* Transition action(s) for transition: On -> Off: NONE
826
      Entry action(s) for transition: On -> Off *)
827
   zz142 = 
828
      (if zz139
829
         then zz121
830
         else zz140);
831
   (* Transition segment: trans13 complete. *)
832

  
833
   zz124 = 
834
      (if (zz134 = 7)
835
         then 
836
               (* <Exit state> path: On.Init maps to field: __root and value: 2 *)
837
               2
838
         else zz134);
839

  
840
   VRP4 = ((zz238 or 
841
      zz195) or 
842
      zz239);
843

  
844
   (* Exit action(s) for transition: On_Active -> On_Active_Maintain: NONE
845
      Transition action(s) for transition: On_Active -> On_Active_Maintain: NONE
846
      Entry action(s) for transition: On_Active -> On_Active_Maintain *)
847
   zz75 = 
848
      (if zz72
849
         then zz70
850
         else zz92);
851
   (* Transition segment: trans18 complete. *)
852

  
853
   zz233 = (desiredSpeed <= 100.0);
854

  
855
   zz223 = 
856
      (if zz217
857
         then zz2
858
         else zz218);
859

  
860
   zz185 = ((not zz184) and 
861
      zz183);
862

  
863
   zz180 = ((not zz179) and 
864
      zz178);
865

  
866
   zz239 = (desiredSpeed = carSpeed);
867

  
868
   (* Transition action(s) for transition: Off -> On: NONE
869
      Entry action(s) for transition: Off -> On *)
870
   zz148 = 
871
      (if zz144
872
         then zz119
873
         else zz143);
874
   (* Transition segment: trans23 complete. *)
875

  
876
   zz115 = 
877
      (if (not 
878
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
879
         ((zz146 >= 2) and 
880
         (zz146 <= 8)))
881
         then 
882
               (* <Enter state> path: On maps to field: __root and value: 2 *)
883
               2
884
         else zz146);
885

  
886
   (* Transition action(s) for transition: On_Active_Maintain -> On_Active_Decrease: NONE
887
      Entry action(s) for transition: On_Active_Maintain -> On_Active_Decrease *)
888
   zz40 = 
889
      (if zz36
890
         then zz12
891
         else zz38);
892
   (* Transition segment: trans15 complete. *)
893

  
894
   (* Exit action(s) for transition: On -> Off *)
895
   zz140 = 
896
      (if zz139
897
         then zz137
898
         else zz156);
899

  
900
   (* Exit action(s) for transition: On_Active_Maintain -> On_Active_Decrease *)
901
   zz39 = 
902
      (if zz36
903
         then zz15
904
         else zz33);
905

  
906
   zz8 = 
907
      (if (zz45 = 5)
908
         then 
909
               (* <Exit state> path: On.Active.Increase maps to field: __root and value: 3 *)
910
               3
911
         else zz45);
912

  
913
   zz122 = 
914
      (if (not (zz140 = 1))
915
         then 1
916
         else zz157);
917

  
918
   zz179 = (true -> (pre zz178));
919

  
920
   zz82 = 
921
      (if (zz147 = 4)
922
         then false
923
         else zz141);
924

  
925
   zz203 = (zz201 or 
926
      zz202);
927

  
928
   zz186 = (((((not cancel) and 
929
      (not brakePedal)) and 
930
      zz181) and 
931
      zz182) and 
932
      validInputs);
933

  
934
   zz183 = decelSet;
935

  
936
   zz155 = (true -> 
937
      (if (pre SP3c)
938
         then false
939
         else (pre zz155)));
940

  
941
   zz196 = (mode = 2);
942

  
943
   zz161 = zz160;
944

  
945
   zz9 = 
946
      (if (not (zz44 = 4))
947
         then 
948
               (* <Enter state> path: On.Active.Maintain maps to field: __root and value: 4 *)
949
               4
950
         else zz44);
951

  
952
   (* Transition action(s) for transition: On_Inactive -> On_Active *)
953
   zz96 = 
954
      (if zz93
955
         then true
956
         else zz90);
957

  
958
   zz52 = 
959
      (if ((not zz48) and 
960
         (zz50 = 4))
961
         then false
962
         else zz39);
963

  
964
   zz0 = zz217;
965

  
966
   zz2 = (
967
      (if (zz1 and 
968
         (not zz0))
969
         then 0.0
970
         else (zz222 + 0.05)) -> 
971
      (if (zz1 and 
972
         (not zz0))
973
         then 0.0
974
         else 
975
      (if zz0
976
         then (zz222 + 0.05)
977
         else (pre zz2))));
978

  
979
   zz1 = (true -> 
980
      (if (pre zz0)
981
         then false
982
         else (pre zz1)));
983

  
984
   (* Transition action(s) for transition: On_Active_Increase -> On_Active_Maintain: NONE
985
      Entry action(s) for transition: On_Active_Increase -> On_Active_Maintain *)
986
   zz51 = 
987
      (if zz47
988
         then zz7
989
         else zz46);
990
   (* Transition segment: trans16 complete. *)
991

  
992
   zz162 = 
993
      (if SP3c
994
         then 
995
               (if zz155
996
                  then zz158
997
                  else zz151)
998
         else zz158);
999

  
1000
   (* Condition actions for transition segment: trans19: NONE
1001
      Transition action(s) for transition: trans19
1002
      <complete> is true if either: 
1003
         1. this transition has completed, or 
1004
         2. a higher-priority transition has already completed 
1005
       *)
1006
   zz100 = (zz99 or 
1007
      zz94);
1008

  
1009
   zz53 = 
1010
      (if (not (zz55 = 4))
1011
         then 
1012
               (* <Enter state> path: On.Active.Maintain maps to field: __root and value: 4 *)
1013
               4
1014
         else zz55);
1015

  
1016
   zz188 = (desiredSpeed <> 100.0);
1017

  
1018
   SP10 = ((not zz191) or 
1019
      zz192);
1020

  
1021
   zz13 = 
1022
      (if (not (zz38 = 6))
1023
         then 5
1024
         else zz35);
1025

  
1026
   zz201 = ((zz163 or 
1027
      zz164) or 
1028
      zz165);
1029

  
1030
   zz14 = 
1031
      (if (zz34 = 4)
1032
         then 
1033
               (* <Exit state> path: On.Active.Maintain maps to field: __root and value: 3 *)
1034
               3
1035
         else zz34);
1036

  
1037
   zz126 = 
1038
      (if (zz129 = 5)
1039
         then 
1040
               (* <Exit state> path: On.Active.Increase maps to field: __root and value: 3 *)
1041
               3
1042
         else zz129);
1043

  
1044
   (* Exit action(s) for outer loop transition: On_Active_Maintain *)
1045
   zz26 = 
1046
      (if zz24
1047
         then zz23
1048
         else zz107);
1049

  
1050
   (* Exit action(s) for transition: Off -> On *)
1051
   zz146 = 
1052
      (if zz144
1053
         then zz120
1054
         else zz142);
1055

  
1056
   zz199 = (
1057
      (if (zz162 = false)
1058
         then 0.0
1059
         else 1.0) = 1.0);
1060

  
1061
   zz227 = (desiredSpeed - carSpeed);
1062

  
1063
   zz150 = 
1064
      (if ((not zz145) and 
1065

  
1066
         (* <In state> path: On maps to field: __root and value range: [2, 8] *)
1067
         ((zz147 >= 2) and 
1068
         (zz147 <= 8)))
1069
         then zz111
1070
         else zz148);
1071

  
1072
   zz177 = (zz176 = 20);
1073

  
1074
   (* Transition action(s) for outer loop transition: On_Active_Maintain *)
1075
   zz27 = 
1076
      (if zz24
1077
         then true
1078
         else zz26);
1079

  
1080
   (* Entry action(s) for transition: On_Inactive -> On_Active *)
1081
   zz97 = 
1082
      (if zz93
1083
         then zz74
1084
         else zz95);
1085
   (* Transition segment: trans20 complete. *)
1086

  
1087
   zz195 = (desiredSpeed = 0.0);
1088

  
1089
   zz71 = 
1090
      (if (not 
1091
         (* <In state> path: On.Active maps to field: __root and value range: [3, 6] *)
1092
         ((zz95 >= 3) and 
1093
         (zz95 <= 6)))
1094
         then 
1095
               (* <Enter state> path: On.Active maps to field: __root and value: 3 *)
1096
               3
1097
         else zz95);
1098

  
1099
   zz62 = 
1100
      (if (not (zz63 = 4))
1101
         then 4
1102
         else zz98);
1103

  
1104
   zz229 = 
1105
      (if (zz228 < ( -10.0))
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff