Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Hierarchy1 / Hierarchy1.lus @ eb639349

History | View | Annotate | Download (21.9 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9

    
10

    
11

    
12
node N1_B__To__N1_A_1_Condition_Action(x_1:real)
13

    
14
returns (x:real);
15

    
16

    
17
var 	x_2:real;
18

    
19

    
20
let
21

    
22

    
23

    
24
	x_2 
25
	=  x_1 -1.;
26
	
27

    
28
	(x) 
29
	= (x_2);
30
	
31

    
32
tel
33

    
34

    
35

    
36

    
37

    
38

    
39

    
40

    
41
node N2_C__To__N2_D_1_Condition_Action(x_1:real)
42

    
43
returns (x:real);
44

    
45

    
46
var 	x_2:real;
47

    
48

    
49
let
50

    
51

    
52

    
53
	x_2 
54
	=  x_1 +100.;
55
	
56

    
57
	(x) 
58
	= (x_2);
59
	
60

    
61
tel
62

    
63

    
64

    
65

    
66

    
67

    
68

    
69
node N2_D__To__N2_C_1_Condition_Action(x_1:real)
70

    
71
returns (x:real);
72

    
73

    
74
var 	x_2:real;
75

    
76

    
77
let
78

    
79

    
80

    
81
	x_2 
82
	=  x_1 -100.;
83
	
84

    
85
	(x) 
86
	= (x_2);
87
	
88

    
89
tel
90

    
91

    
92

    
93

    
94

    
95

    
96
node N1_A__To__N1_B_1_Condition_Action(x_1:real)
97

    
98
returns (x:real);
99

    
100

    
101
var 	x_2:real;
102

    
103

    
104
let
105

    
106

    
107

    
108
	x_2 
109
	=  x_1 +1.;
110
	
111

    
112
	(x) 
113
	= (x_2);
114
	
115

    
116
tel
117

    
118

    
119

    
120

    
121

    
122

    
123
-- Entry action for state :N2_C
124
node N2_C_en(idTOP_N2_1:int;
125
	x_1:real;
126
	isInner:bool)
127

    
128
returns (idTOP_N2:int;
129
	x:real);
130

    
131

    
132
var 	idTOP_N2_2:int;
133
	x_2:real;
134

    
135

    
136
let
137

    
138

    
139

    
140
	-- set state as active 
141
	idTOP_N2_2 
142
	= 901;
143
	
144

    
145
	x_2 
146
	= if (not isInner) then  x_1 +1000.
147
	 else x_1;
148
	
149

    
150
	(idTOP_N2, x) 
151
	= (idTOP_N2_2, x_2);
152
	
153

    
154
tel
155

    
156

    
157

    
158

    
159

    
160
-- Exit action for state :N2_C
161
node N2_C_ex(idTOP_N2_1:int;
162
	isInner:bool)
163

    
164
returns (idTOP_N2:int);
165

    
166

    
167
var 	idTOP_N2_2:int;
168

    
169

    
170
let
171

    
172

    
173

    
174
	-- set state as inactive 
175
	idTOP_N2_2
176
	 = if (not isInner) then 0 else idTOP_N2_1;
177

    
178

    
179
	(idTOP_N2) 
180
	= (idTOP_N2_1);
181
	
182

    
183
tel
184

    
185

    
186

    
187

    
188

    
189

    
190
-- Entry action for state :N2_D
191
node N2_D_en(idTOP_N2_1:int;
192
	x_1:real;
193
	isInner:bool)
194

    
195
returns (idTOP_N2:int;
196
	x:real);
197

    
198

    
199
var 	idTOP_N2_2:int;
200
	x_2:real;
201

    
202

    
203
let
204

    
205

    
206

    
207
	-- set state as active 
208
	idTOP_N2_2 
209
	= 902;
210
	
211

    
212
	x_2 
213
	= if (not isInner) then  x_1 -1000.
214
	 else x_1;
215
	
216

    
217
	(idTOP_N2, x) 
218
	= (idTOP_N2_2, x_2);
219
	
220

    
221
tel
222

    
223

    
224

    
225

    
226

    
227
-- Exit action for state :N2_D
228
node N2_D_ex(idTOP_N2_1:int;
229
	isInner:bool)
230

    
231
returns (idTOP_N2:int);
232

    
233

    
234
var 	idTOP_N2_2:int;
235

    
236

    
237
let
238

    
239

    
240

    
241
	-- set state as inactive 
242
	idTOP_N2_2
243
	 = if (not isInner) then 0 else idTOP_N2_1;
244

    
245

    
246
	(idTOP_N2) 
247
	= (idTOP_N2_1);
248
	
249

    
250
tel
251

    
252

    
253

    
254

    
255

    
256

    
257
-- Entry action for state :TOP_N2
258
node TOP_N2_en(idTOP_N2_1:int;
259
	idHierarchy1_TOP_1:int;
260
	x_1:real;
261
	isInner:bool)
262

    
263
returns (idTOP_N2:int;
264
	idHierarchy1_TOP:int;
265
	x:real);
266

    
267

    
268
var 	idTOP_N2_2, idTOP_N2_3, idTOP_N2_4, idTOP_N2_5, idTOP_N2_6:int;
269
	idHierarchy1_TOP_2, idHierarchy1_TOP_3, idHierarchy1_TOP_4:int;
270
	x_2, x_3, x_4, x_5, x_6, x_7:real;
271

    
272

    
273
let
274

    
275

    
276

    
277
	-- set state as active 
278
	idHierarchy1_TOP_2 
279
	= 898;
280
	
281

    
282
	x_2 
283
	= if (not isInner) then  x_1 +100000.
284
	 else x_1;
285
	
286

    
287
	
288
-- transition trace :
289
	--POINT__To__N2_C_1
290
		(idTOP_N2_2, x_3) 
291
	= N2_C_en(idTOP_N2_1, x_2, false);
292
		
293

    
294
	(idTOP_N2_3, idHierarchy1_TOP_3, x_4) 
295
	= 
296

    
297
	if ( idTOP_N2_1 = 0) then
298

    
299
	 (idTOP_N2_2, idHierarchy1_TOP_2, x_3)
300

    
301
	 else(idTOP_N2_1, idHierarchy1_TOP_2, x_2);
302

    
303
	
304

    
305
	(idTOP_N2_4, x_5) 
306
	= 
307
	if ( idTOP_N2_1 = 901) then
308
	N2_C_en(idTOP_N2_1, x_2, false)
309
	 else (idTOP_N2_1, x_2);
310

    
311
	
312

    
313
	(idTOP_N2_5, x_6) 
314
	= 
315
	if ( idTOP_N2_1 = 902) then
316
	N2_D_en(idTOP_N2_1, x_2, false)
317
	 else (idTOP_N2_1, x_2);
318

    
319
	
320

    
321
	(idTOP_N2_6, idHierarchy1_TOP_4, x_7) 
322
	= 
323
		 if ( idTOP_N2_1 = 0) then 
324
		(idTOP_N2_3, idHierarchy1_TOP_3, x_4)
325
		 else
326
		 if ( idTOP_N2_1 = 901) then 
327
		(idTOP_N2_4, idHierarchy1_TOP_3, x_5)
328
		 else
329
		 if ( idTOP_N2_1 = 902) then 
330
		(idTOP_N2_5, idHierarchy1_TOP_3, x_6)
331
		 else (idTOP_N2_1, idHierarchy1_TOP_2, x_2);
332

    
333

    
334
	(idTOP_N2, idHierarchy1_TOP, x) 
335
	= (idTOP_N2_6, idHierarchy1_TOP_4, x_7);
336
	
337

    
338
tel
339

    
340

    
341

    
342

    
343

    
344
-- Exit action for state :TOP_N2
345
node TOP_N2_ex(idTOP_N2_1:int;
346
	x_1:real;
347
	idHierarchy1_TOP_1:int;
348
	isInner:bool)
349

    
350
returns (idTOP_N2:int;
351
	x:real;
352
	idHierarchy1_TOP:int);
353

    
354

    
355
var 	idTOP_N2_2, idTOP_N2_3, idTOP_N2_4, idTOP_N2_5:int;
356
	x_2:real;
357
	idHierarchy1_TOP_2:int;
358

    
359

    
360
let
361

    
362

    
363

    
364
	
365
	(idTOP_N2_2) 
366
	= 
367
	if ( idTOP_N2_1 = 901) then
368
	N2_C_ex(idTOP_N2_1, false)
369
	 else (idTOP_N2_1);
370

    
371
	
372

    
373
	(idTOP_N2_3) 
374
	= 
375
	if ( idTOP_N2_1 = 902) then
376
	N2_D_ex(idTOP_N2_1, false)
377
	 else (idTOP_N2_1);
378

    
379
	
380

    
381
	(idTOP_N2_4) 
382
	= 
383
		 if ( idTOP_N2_1 = 901) then 
384
		(idTOP_N2_2)
385
		 else
386
		 if ( idTOP_N2_1 = 902) then 
387
		(idTOP_N2_3)
388
		 else (idTOP_N2_1);
389

    
390

    
391
	x_2 
392
	= if (not isInner) then  x_1 -100000.
393
	 else x_1;
394
	
395

    
396
	-- set state as inactive 
397
	idHierarchy1_TOP_2
398
	 = if (not isInner) then 0 else idHierarchy1_TOP_1;
399

    
400
	idTOP_N2_5 
401
	= 0;
402
	
403

    
404
	(idTOP_N2, x, idHierarchy1_TOP) 
405
	= (idTOP_N2_5, x_2, idHierarchy1_TOP_1);
406
	
407

    
408
tel
409

    
410

    
411

    
412

    
413

    
414

    
415
-- Entry action for state :N1_A
416
node N1_A_en(idTOP_N1_1:int;
417
	x_1:real;
418
	isInner:bool)
419

    
420
returns (idTOP_N1:int;
421
	x:real);
422

    
423

    
424
var 	idTOP_N1_2:int;
425
	x_2:real;
426

    
427

    
428
let
429

    
430

    
431

    
432
	-- set state as active 
433
	idTOP_N1_2 
434
	= 899;
435
	
436

    
437
	x_2 
438
	= if (not isInner) then  x_1 +10.
439
	 else x_1;
440
	
441

    
442
	(idTOP_N1, x) 
443
	= (idTOP_N1_2, x_2);
444
	
445

    
446
tel
447

    
448

    
449

    
450

    
451

    
452
-- Exit action for state :N1_A
453
node N1_A_ex(idTOP_N1_1:int;
454
	isInner:bool)
455

    
456
returns (idTOP_N1:int);
457

    
458

    
459
var 	idTOP_N1_2:int;
460

    
461

    
462
let
463

    
464

    
465

    
466
	-- set state as inactive 
467
	idTOP_N1_2
468
	 = if (not isInner) then 0 else idTOP_N1_1;
469

    
470

    
471
	(idTOP_N1) 
472
	= (idTOP_N1_1);
473
	
474

    
475
tel
476

    
477

    
478

    
479

    
480

    
481

    
482
-- Entry action for state :N1_B
483
node N1_B_en(idTOP_N1_1:int;
484
	x_1:real;
485
	isInner:bool)
486

    
487
returns (idTOP_N1:int;
488
	x:real);
489

    
490

    
491
var 	idTOP_N1_2:int;
492
	x_2:real;
493

    
494

    
495
let
496

    
497

    
498

    
499
	-- set state as active 
500
	idTOP_N1_2 
501
	= 900;
502
	
503

    
504
	x_2 
505
	= if (not isInner) then  x_1 -10.
506
	 else x_1;
507
	
508

    
509
	(idTOP_N1, x) 
510
	= (idTOP_N1_2, x_2);
511
	
512

    
513
tel
514

    
515

    
516

    
517

    
518

    
519
-- Exit action for state :N1_B
520
node N1_B_ex(idTOP_N1_1:int;
521
	isInner:bool)
522

    
523
returns (idTOP_N1:int);
524

    
525

    
526
var 	idTOP_N1_2:int;
527

    
528

    
529
let
530

    
531

    
532

    
533
	-- set state as inactive 
534
	idTOP_N1_2
535
	 = if (not isInner) then 0 else idTOP_N1_1;
536

    
537

    
538
	(idTOP_N1) 
539
	= (idTOP_N1_1);
540
	
541

    
542
tel
543

    
544

    
545

    
546

    
547

    
548

    
549
-- Entry action for state :TOP_N1
550
node TOP_N1_en(idTOP_N1_1:int;
551
	idHierarchy1_TOP_1:int;
552
	x_1:real;
553
	isInner:bool)
554

    
555
returns (idTOP_N1:int;
556
	idHierarchy1_TOP:int;
557
	x:real);
558

    
559

    
560
var 	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4, idTOP_N1_5, idTOP_N1_6:int;
561
	idHierarchy1_TOP_2, idHierarchy1_TOP_3, idHierarchy1_TOP_4:int;
562
	x_2, x_3, x_4, x_5, x_6, x_7:real;
563

    
564

    
565
let
566

    
567

    
568

    
569
	-- set state as active 
570
	idHierarchy1_TOP_2 
571
	= 897;
572
	
573

    
574
	x_2 
575
	= if (not isInner) then  x_1 +10000.
576
	 else x_1;
577
	
578

    
579
	
580
-- transition trace :
581
	--POINT__To__N1_A_1
582
		(idTOP_N1_2, x_3) 
583
	= N1_A_en(idTOP_N1_1, x_2, false);
584
		
585

    
586
	(idTOP_N1_3, idHierarchy1_TOP_3, x_4) 
587
	= 
588

    
589
	if ( idTOP_N1_1 = 0) then
590

    
591
	 (idTOP_N1_2, idHierarchy1_TOP_2, x_3)
592

    
593
	 else(idTOP_N1_1, idHierarchy1_TOP_2, x_2);
594

    
595
	
596

    
597
	(idTOP_N1_4, x_5) 
598
	= 
599
	if ( idTOP_N1_1 = 899) then
600
	N1_A_en(idTOP_N1_1, x_2, false)
601
	 else (idTOP_N1_1, x_2);
602

    
603
	
604

    
605
	(idTOP_N1_5, x_6) 
606
	= 
607
	if ( idTOP_N1_1 = 900) then
608
	N1_B_en(idTOP_N1_1, x_2, false)
609
	 else (idTOP_N1_1, x_2);
610

    
611
	
612

    
613
	(idTOP_N1_6, idHierarchy1_TOP_4, x_7) 
614
	= 
615
		 if ( idTOP_N1_1 = 0) then 
616
		(idTOP_N1_3, idHierarchy1_TOP_3, x_4)
617
		 else
618
		 if ( idTOP_N1_1 = 899) then 
619
		(idTOP_N1_4, idHierarchy1_TOP_3, x_5)
620
		 else
621
		 if ( idTOP_N1_1 = 900) then 
622
		(idTOP_N1_5, idHierarchy1_TOP_3, x_6)
623
		 else (idTOP_N1_1, idHierarchy1_TOP_2, x_2);
624

    
625

    
626
	(idTOP_N1, idHierarchy1_TOP, x) 
627
	= (idTOP_N1_6, idHierarchy1_TOP_4, x_7);
628
	
629

    
630
tel
631

    
632

    
633

    
634

    
635

    
636
-- Exit action for state :TOP_N1
637
node TOP_N1_ex(idTOP_N1_1:int;
638
	x_1:real;
639
	idHierarchy1_TOP_1:int;
640
	isInner:bool)
641

    
642
returns (idTOP_N1:int;
643
	x:real;
644
	idHierarchy1_TOP:int);
645

    
646

    
647
var 	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4, idTOP_N1_5:int;
648
	x_2:real;
649
	idHierarchy1_TOP_2:int;
650

    
651

    
652
let
653

    
654

    
655

    
656
	
657
	(idTOP_N1_2) 
658
	= 
659
	if ( idTOP_N1_1 = 899) then
660
	N1_A_ex(idTOP_N1_1, false)
661
	 else (idTOP_N1_1);
662

    
663
	
664

    
665
	(idTOP_N1_3) 
666
	= 
667
	if ( idTOP_N1_1 = 900) then
668
	N1_B_ex(idTOP_N1_1, false)
669
	 else (idTOP_N1_1);
670

    
671
	
672

    
673
	(idTOP_N1_4) 
674
	= 
675
		 if ( idTOP_N1_1 = 899) then 
676
		(idTOP_N1_2)
677
		 else
678
		 if ( idTOP_N1_1 = 900) then 
679
		(idTOP_N1_3)
680
		 else (idTOP_N1_1);
681

    
682

    
683
	x_2 
684
	= if (not isInner) then  x_1 -10000.
685
	 else x_1;
686
	
687

    
688
	-- set state as inactive 
689
	idHierarchy1_TOP_2
690
	 = if (not isInner) then 0 else idHierarchy1_TOP_1;
691

    
692
	idTOP_N1_5 
693
	= 0;
694
	
695

    
696
	(idTOP_N1, x, idHierarchy1_TOP) 
697
	= (idTOP_N1_5, x_2, idHierarchy1_TOP_1);
698
	
699

    
700
tel
701

    
702

    
703

    
704

    
705

    
706

    
707
-- Entry action for state :Hierarchy1_TOP
708
node Hierarchy1_TOP_en(idHierarchy1_TOP_1:int;
709
	idHierarchy1_Hierarchy1_1:int;
710
	x_1:real;
711
	idTOP_N1_1:int;
712
	idTOP_N2_1:int;
713
	isInner:bool)
714

    
715
returns (idHierarchy1_TOP:int;
716
	idHierarchy1_Hierarchy1:int;
717
	x:real;
718
	idTOP_N1:int;
719
	idTOP_N2:int);
720

    
721

    
722
var 	idHierarchy1_TOP_2, idHierarchy1_TOP_3, idHierarchy1_TOP_4, idHierarchy1_TOP_5, idHierarchy1_TOP_6:int;
723
	idHierarchy1_Hierarchy1_2, idHierarchy1_Hierarchy1_3, idHierarchy1_Hierarchy1_4:int;
724
	x_2, x_3, x_4, x_5, x_6, x_7:real;
725
	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4, idTOP_N1_5:int;
726
	idTOP_N2_2, idTOP_N2_3:int;
727

    
728

    
729
let
730

    
731

    
732

    
733
	-- set state as active 
734
	idHierarchy1_Hierarchy1_2 
735
	= 903;
736
	
737

    
738
	x_2 
739
	= if (not isInner) then  x_1 +1000000.
740
	 else x_1;
741
	
742

    
743
	
744
-- transition trace :
745
	--POINT__To__TOP_N1_1
746
		(idTOP_N1_2, idHierarchy1_TOP_2, x_3) 
747
	= TOP_N1_en(idTOP_N1_1, idHierarchy1_TOP_1, x_2, false);
748
		
749

    
750
	(idHierarchy1_TOP_3, idHierarchy1_Hierarchy1_3, x_4, idTOP_N1_3) 
751
	= 
752

    
753
	if ( idHierarchy1_TOP_1 = 0) then
754

    
755
	 (idHierarchy1_TOP_2, idHierarchy1_Hierarchy1_2, x_3, idTOP_N1_2)
756

    
757
	 else(idHierarchy1_TOP_1, idHierarchy1_Hierarchy1_2, x_2, idTOP_N1_1);
758

    
759
	
760

    
761
	(idTOP_N1_4, idHierarchy1_TOP_4, x_5) 
762
	= 
763
	if ( idHierarchy1_TOP_1 = 897) then
764
	TOP_N1_en(idTOP_N1_1, idHierarchy1_TOP_1, x_2, false)
765
	 else (idTOP_N1_1, idHierarchy1_TOP_1, x_2);
766

    
767
	
768

    
769
	(idTOP_N2_2, idHierarchy1_TOP_5, x_6) 
770
	= 
771
	if ( idHierarchy1_TOP_1 = 898) then
772
	TOP_N2_en(idTOP_N2_1, idHierarchy1_TOP_1, x_2, false)
773
	 else (idTOP_N2_1, idHierarchy1_TOP_1, x_2);
774

    
775
	
776

    
777
	(idHierarchy1_TOP_6, idHierarchy1_Hierarchy1_4, x_7, idTOP_N1_5, idTOP_N2_3) 
778
	= 
779
		 if ( idHierarchy1_TOP_1 = 0) then 
780
		(idHierarchy1_TOP_3, idHierarchy1_Hierarchy1_3, x_4, idTOP_N1_3, idTOP_N2_1)
781
		 else
782
		 if ( idHierarchy1_TOP_1 = 897) then 
783
		(idHierarchy1_TOP_4, idHierarchy1_Hierarchy1_3, x_5, idTOP_N1_4, idTOP_N2_1)
784
		 else
785
		 if ( idHierarchy1_TOP_1 = 898) then 
786
		(idHierarchy1_TOP_5, idHierarchy1_Hierarchy1_3, x_6, idTOP_N1_1, idTOP_N2_2)
787
		 else (idHierarchy1_TOP_1, idHierarchy1_Hierarchy1_2, x_2, idTOP_N1_1, idTOP_N2_1);
788

    
789

    
790
	(idHierarchy1_TOP, idHierarchy1_Hierarchy1, x, idTOP_N1, idTOP_N2) 
791
	= (idHierarchy1_TOP_6, idHierarchy1_Hierarchy1_4, x_7, idTOP_N1_5, idTOP_N2_3);
792
	
793

    
794
tel
795

    
796

    
797

    
798

    
799

    
800
-- Exit action for state :Hierarchy1_TOP
801
node Hierarchy1_TOP_ex(idTOP_N1_1:int;
802
	x_1:real;
803
	idHierarchy1_TOP_1:int;
804
	idTOP_N2_1:int;
805
	idHierarchy1_Hierarchy1_1:int;
806
	isInner:bool)
807

    
808
returns (idTOP_N1:int;
809
	x:real;
810
	idHierarchy1_TOP:int;
811
	idTOP_N2:int;
812
	idHierarchy1_Hierarchy1:int);
813

    
814

    
815
var 	idTOP_N1_2, idTOP_N1_3:int;
816
	x_2, x_3, x_4, x_5:real;
817
	idHierarchy1_TOP_2, idHierarchy1_TOP_3, idHierarchy1_TOP_4, idHierarchy1_TOP_5:int;
818
	idTOP_N2_2, idTOP_N2_3:int;
819
	idHierarchy1_Hierarchy1_2:int;
820

    
821

    
822
let
823

    
824

    
825

    
826
	
827
	(idTOP_N1_2, x_2, idHierarchy1_TOP_2) 
828
	= 
829
	if ( idHierarchy1_TOP_1 = 897) then
830
	TOP_N1_ex(idTOP_N1_1, x_1, idHierarchy1_TOP_1, false)
831
	 else (idTOP_N1_1, x_1, idHierarchy1_TOP_1);
832

    
833
	
834

    
835
	(idTOP_N2_2, x_3, idHierarchy1_TOP_3) 
836
	= 
837
	if ( idHierarchy1_TOP_1 = 898) then
838
	TOP_N2_ex(idTOP_N2_1, x_1, idHierarchy1_TOP_1, false)
839
	 else (idTOP_N2_1, x_1, idHierarchy1_TOP_1);
840

    
841
	
842

    
843
	(idTOP_N1_3, x_4, idHierarchy1_TOP_4, idTOP_N2_3) 
844
	= 
845
		 if ( idHierarchy1_TOP_1 = 897) then 
846
		(idTOP_N1_2, x_2, idHierarchy1_TOP_2, idTOP_N2_1)
847
		 else
848
		 if ( idHierarchy1_TOP_1 = 898) then 
849
		(idTOP_N1_1, x_3, idHierarchy1_TOP_3, idTOP_N2_2)
850
		 else (idTOP_N1_1, x_1, idHierarchy1_TOP_1, idTOP_N2_1);
851

    
852

    
853
	x_5 
854
	= if (not isInner) then 0.
855
	 else x_4;
856
	
857

    
858
	-- set state as inactive 
859
	idHierarchy1_Hierarchy1_2
860
	 = if (not isInner) then 0 else idHierarchy1_Hierarchy1_1;
861

    
862
	idHierarchy1_TOP_5 
863
	= 0;
864
	
865

    
866
	(idTOP_N1, x, idHierarchy1_TOP, idTOP_N2, idHierarchy1_Hierarchy1) 
867
	= (idTOP_N1_3, x_5, idHierarchy1_TOP_5, idTOP_N2_3, idHierarchy1_Hierarchy1_1);
868
	
869

    
870
tel
871

    
872

    
873
--***************************************************State :TOP_N2 Automaton***************************************************
874

    
875
node TOP_N2_node(idTOP_N2_1:int;
876
	x_1:real;
877
	S:bool;
878
	R:bool)
879

    
880
returns (idTOP_N2:int;
881
	x:real);
882

    
883

    
884
let
885

    
886
	 automaton top_n2
887

    
888
	state POINTTOP_N2:
889
	unless (idTOP_N2_1=0) restart POINT__TO__N2_C_1
890

    
891

    
892

    
893
	unless (idTOP_N2_1=901) and S restart N2_C__TO__N2_D_1
894

    
895

    
896

    
897
	unless (idTOP_N2_1=902) and R restart N2_D__TO__N2_C_1
898

    
899

    
900

    
901
	unless (idTOP_N2_1=901) restart N2_C_IDL
902

    
903
	unless (idTOP_N2_1=902) restart N2_D_IDL
904

    
905
	let
906

    
907
		(idTOP_N2, x) 
908
	= (idTOP_N2_1, x_1);
909
	
910

    
911
	tel
912

    
913

    
914

    
915
	state POINT__TO__N2_C_1:
916

    
917
	 var 	idTOP_N2_2:int;
918
	x_2:real;
919
	let
920

    
921
		-- transition trace :
922
	--POINT__To__N2_C_1
923
		(idTOP_N2_2, x_2) 
924
	= N2_C_en(idTOP_N2_1, x_1, false);
925
		
926

    
927
	(idTOP_N2, x) 
928
	=  (idTOP_N2_2, x_2);
929

    
930

    
931
	tel
932

    
933
	until true restart POINTTOP_N2
934

    
935

    
936

    
937
	state N2_C__TO__N2_D_1:
938

    
939
	 var 	idTOP_N2_2, idTOP_N2_3:int;
940
	x_2, x_3:real;
941
	let
942

    
943
		-- transition trace :
944
	--N2_C__To__N2_D_1
945
		-- condition Action : x+=100;
946
		
947
		(x_2) 
948
	= N2_C__To__N2_D_1_Condition_Action(x_1);
949
		
950

    
951
		(idTOP_N2_2) 
952
	= N2_C_ex(idTOP_N2_1, false);
953
		
954

    
955
		(idTOP_N2_3, x_3) 
956
	= N2_D_en(idTOP_N2_2, x_2, false);
957
		
958

    
959
	(idTOP_N2, x) 
960
	=  (idTOP_N2_3, x_3);
961

    
962

    
963
	tel
964

    
965
	until true restart POINTTOP_N2
966

    
967

    
968

    
969
	state N2_D__TO__N2_C_1:
970

    
971
	 var 	idTOP_N2_2, idTOP_N2_3:int;
972
	x_2, x_3:real;
973
	let
974

    
975
		-- transition trace :
976
	--N2_D__To__N2_C_1
977
		-- condition Action : x-=100;
978
		
979
		(x_2) 
980
	= N2_D__To__N2_C_1_Condition_Action(x_1);
981
		
982

    
983
		(idTOP_N2_2) 
984
	= N2_D_ex(idTOP_N2_1, false);
985
		
986

    
987
		(idTOP_N2_3, x_3) 
988
	= N2_C_en(idTOP_N2_2, x_2, false);
989
		
990

    
991
	(idTOP_N2, x) 
992
	=  (idTOP_N2_3, x_3);
993

    
994

    
995
	tel
996

    
997
	until true restart POINTTOP_N2
998

    
999

    
1000

    
1001
	state N2_C_IDL:
1002

    
1003
	 	let
1004

    
1005
		
1006

    
1007
	(idTOP_N2, x) 
1008
	= (idTOP_N2_1, x_1);
1009
	
1010

    
1011
	tel
1012

    
1013
	until true restart POINTTOP_N2
1014

    
1015

    
1016

    
1017
	state N2_D_IDL:
1018

    
1019
	 	let
1020

    
1021
		
1022

    
1023
	(idTOP_N2, x) 
1024
	= (idTOP_N2_1, x_1);
1025
	
1026

    
1027
	tel
1028

    
1029
	until true restart POINTTOP_N2
1030

    
1031

    
1032

    
1033
tel
1034

    
1035

    
1036
--***************************************************State :TOP_N1 Automaton***************************************************
1037

    
1038
node TOP_N1_node(idTOP_N1_1:int;
1039
	x_1:real;
1040
	S:bool;
1041
	R:bool)
1042

    
1043
returns (idTOP_N1:int;
1044
	x:real);
1045

    
1046

    
1047
let
1048

    
1049
	 automaton top_n1
1050

    
1051
	state POINTTOP_N1:
1052
	unless (idTOP_N1_1=0) restart POINT__TO__N1_A_1
1053

    
1054

    
1055

    
1056
	unless (idTOP_N1_1=899) and S restart N1_A__TO__N1_B_1
1057

    
1058

    
1059

    
1060
	unless (idTOP_N1_1=900) and R restart N1_B__TO__N1_A_1
1061

    
1062

    
1063

    
1064
	unless (idTOP_N1_1=899) restart N1_A_IDL
1065

    
1066
	unless (idTOP_N1_1=900) restart N1_B_IDL
1067

    
1068
	let
1069

    
1070
		(idTOP_N1, x) 
1071
	= (idTOP_N1_1, x_1);
1072
	
1073

    
1074
	tel
1075

    
1076

    
1077

    
1078
	state POINT__TO__N1_A_1:
1079

    
1080
	 var 	idTOP_N1_2:int;
1081
	x_2:real;
1082
	let
1083

    
1084
		-- transition trace :
1085
	--POINT__To__N1_A_1
1086
		(idTOP_N1_2, x_2) 
1087
	= N1_A_en(idTOP_N1_1, x_1, false);
1088
		
1089

    
1090
	(idTOP_N1, x) 
1091
	=  (idTOP_N1_2, x_2);
1092

    
1093

    
1094
	tel
1095

    
1096
	until true restart POINTTOP_N1
1097

    
1098

    
1099

    
1100
	state N1_A__TO__N1_B_1:
1101

    
1102
	 var 	idTOP_N1_2, idTOP_N1_3:int;
1103
	x_2, x_3:real;
1104
	let
1105

    
1106
		-- transition trace :
1107
	--N1_A__To__N1_B_1
1108
		-- condition Action : x+=1;
1109
		
1110
		(x_2) 
1111
	= N1_A__To__N1_B_1_Condition_Action(x_1);
1112
		
1113

    
1114
		(idTOP_N1_2) 
1115
	= N1_A_ex(idTOP_N1_1, false);
1116
		
1117

    
1118
		(idTOP_N1_3, x_3) 
1119
	= N1_B_en(idTOP_N1_2, x_2, false);
1120
		
1121

    
1122
	(idTOP_N1, x) 
1123
	=  (idTOP_N1_3, x_3);
1124

    
1125

    
1126
	tel
1127

    
1128
	until true restart POINTTOP_N1
1129

    
1130

    
1131

    
1132
	state N1_B__TO__N1_A_1:
1133

    
1134
	 var 	idTOP_N1_2, idTOP_N1_3:int;
1135
	x_2, x_3:real;
1136
	let
1137

    
1138
		-- transition trace :
1139
	--N1_B__To__N1_A_1
1140
		-- condition Action : x-=1;
1141
		
1142
		(x_2) 
1143
	= N1_B__To__N1_A_1_Condition_Action(x_1);
1144
		
1145

    
1146
		(idTOP_N1_2) 
1147
	= N1_B_ex(idTOP_N1_1, false);
1148
		
1149

    
1150
		(idTOP_N1_3, x_3) 
1151
	= N1_A_en(idTOP_N1_2, x_2, false);
1152
		
1153

    
1154
	(idTOP_N1, x) 
1155
	=  (idTOP_N1_3, x_3);
1156

    
1157

    
1158
	tel
1159

    
1160
	until true restart POINTTOP_N1
1161

    
1162

    
1163

    
1164
	state N1_A_IDL:
1165

    
1166
	 	let
1167

    
1168
		
1169

    
1170
	(idTOP_N1, x) 
1171
	= (idTOP_N1_1, x_1);
1172
	
1173

    
1174
	tel
1175

    
1176
	until true restart POINTTOP_N1
1177

    
1178

    
1179

    
1180
	state N1_B_IDL:
1181

    
1182
	 	let
1183

    
1184
		
1185

    
1186
	(idTOP_N1, x) 
1187
	= (idTOP_N1_1, x_1);
1188
	
1189

    
1190
	tel
1191

    
1192
	until true restart POINTTOP_N1
1193

    
1194

    
1195

    
1196
tel
1197

    
1198

    
1199
--***************************************************State :Hierarchy1_TOP Automaton***************************************************
1200

    
1201
node Hierarchy1_TOP_node(idHierarchy1_TOP_1:int;
1202
	idTOP_N1_1:int;
1203
	x_1:real;
1204
	T:bool;
1205
	idTOP_N2_1:int;
1206
	R:bool;
1207
	S:bool)
1208

    
1209
returns (idHierarchy1_TOP:int;
1210
	idTOP_N1:int;
1211
	x:real;
1212
	idTOP_N2:int);
1213

    
1214

    
1215
let
1216

    
1217
	 automaton hierarchy1_top
1218

    
1219
	state POINTHierarchy1_TOP:
1220
	unless (idHierarchy1_TOP_1=0) restart POINT__TO__TOP_N1_1
1221

    
1222

    
1223

    
1224
	unless (idHierarchy1_TOP_1=897) and T restart TOP_N1__TO__TOP_N2_1
1225

    
1226

    
1227

    
1228
	unless (idHierarchy1_TOP_1=898) and T restart TOP_N2__TO__TOP_N1_1
1229

    
1230

    
1231

    
1232
	unless (idHierarchy1_TOP_1=897) restart TOP_N1_IDL
1233

    
1234
	unless (idHierarchy1_TOP_1=898) restart TOP_N2_IDL
1235

    
1236
	let
1237

    
1238
		(idHierarchy1_TOP, idTOP_N1, x, idTOP_N2) 
1239
	= (idHierarchy1_TOP_1, idTOP_N1_1, x_1, idTOP_N2_1);
1240
	
1241

    
1242
	tel
1243

    
1244

    
1245

    
1246
	state POINT__TO__TOP_N1_1:
1247

    
1248
	 var 	idHierarchy1_TOP_2:int;
1249
	idTOP_N1_2:int;
1250
	x_2:real;
1251
	let
1252

    
1253
		-- transition trace :
1254
	--POINT__To__TOP_N1_1
1255
		(idTOP_N1_2, idHierarchy1_TOP_2, x_2) 
1256
	= TOP_N1_en(idTOP_N1_1, idHierarchy1_TOP_1, x_1, false);
1257
		
1258

    
1259
	(idHierarchy1_TOP, idTOP_N1, x) 
1260
	=  (idHierarchy1_TOP_2, idTOP_N1_2, x_2);
1261

    
1262
	--add unused variables
1263
	(idTOP_N2) 
1264
	= (idTOP_N2_1);
1265
	
1266

    
1267
	tel
1268

    
1269
	until true restart POINTHierarchy1_TOP
1270

    
1271

    
1272

    
1273
	state TOP_N1__TO__TOP_N2_1:
1274

    
1275
	 var 	idHierarchy1_TOP_2, idHierarchy1_TOP_3:int;
1276
	idTOP_N1_2:int;
1277
	x_2, x_3:real;
1278
	idTOP_N2_2:int;
1279
	let
1280

    
1281
		-- transition trace :
1282
	--TOP_N1__To__TOP_N2_1
1283
		(idTOP_N1_2, x_2, idHierarchy1_TOP_2) 
1284
	= TOP_N1_ex(idTOP_N1_1, x_1, idHierarchy1_TOP_1, false);
1285
		
1286

    
1287
		(idTOP_N2_2, idHierarchy1_TOP_3, x_3) 
1288
	= TOP_N2_en(idTOP_N2_1, idHierarchy1_TOP_2, x_2, false);
1289
		
1290

    
1291
	(idHierarchy1_TOP, idTOP_N1, x, idTOP_N2) 
1292
	=  (idHierarchy1_TOP_3, idTOP_N1_2, x_3, idTOP_N2_2);
1293

    
1294

    
1295
	tel
1296

    
1297
	until true restart POINTHierarchy1_TOP
1298

    
1299

    
1300

    
1301
	state TOP_N2__TO__TOP_N1_1:
1302

    
1303
	 var 	idHierarchy1_TOP_2, idHierarchy1_TOP_3:int;
1304
	idTOP_N1_2:int;
1305
	x_2, x_3:real;
1306
	idTOP_N2_2:int;
1307
	let
1308

    
1309
		-- transition trace :
1310
	--TOP_N2__To__TOP_N1_1
1311
		(idTOP_N2_2, x_2, idHierarchy1_TOP_2) 
1312
	= TOP_N2_ex(idTOP_N2_1, x_1, idHierarchy1_TOP_1, false);
1313
		
1314

    
1315
		(idTOP_N1_2, idHierarchy1_TOP_3, x_3) 
1316
	= TOP_N1_en(idTOP_N1_1, idHierarchy1_TOP_2, x_2, false);
1317
		
1318

    
1319
	(idHierarchy1_TOP, idTOP_N1, x, idTOP_N2) 
1320
	=  (idHierarchy1_TOP_3, idTOP_N1_2, x_3, idTOP_N2_2);
1321

    
1322

    
1323
	tel
1324

    
1325
	until true restart POINTHierarchy1_TOP
1326

    
1327

    
1328

    
1329
	state TOP_N1_IDL:
1330

    
1331
	 var 	idTOP_N1_2:int;
1332
	x_2:real;
1333
	let
1334

    
1335
		
1336
	(idTOP_N1_2, x_2) 
1337
	= TOP_N1_node(idTOP_N1_1, x_1, S, R);
1338

    
1339
		
1340

    
1341

    
1342
	(idHierarchy1_TOP, idTOP_N1, x, idTOP_N2) 
1343
	= (idHierarchy1_TOP_1, idTOP_N1_2, x_2, idTOP_N2_1);
1344
	
1345

    
1346
	tel
1347

    
1348
	until true restart POINTHierarchy1_TOP
1349

    
1350

    
1351

    
1352
	state TOP_N2_IDL:
1353

    
1354
	 var 	x_2:real;
1355
	idTOP_N2_2:int;
1356
	let
1357

    
1358
		
1359
	(idTOP_N2_2, x_2) 
1360
	= TOP_N2_node(idTOP_N2_1, x_1, S, R);
1361

    
1362
		
1363

    
1364

    
1365
	(idHierarchy1_TOP, idTOP_N1, x, idTOP_N2) 
1366
	= (idHierarchy1_TOP_1, idTOP_N1_1, x_2, idTOP_N2_2);
1367
	
1368

    
1369
	tel
1370

    
1371
	until true restart POINTHierarchy1_TOP
1372

    
1373

    
1374

    
1375
tel
1376

    
1377

    
1378
--***************************************************State :Hierarchy1_Hierarchy1 Automaton***************************************************
1379

    
1380
node Hierarchy1_Hierarchy1_node(idHierarchy1_Hierarchy1_1:int;
1381
	idHierarchy1_TOP_1:int;
1382
	idTOP_N1_1:int;
1383
	idTOP_N2_1:int;
1384
	x_1:real;
1385
	R:bool;
1386
	S:bool;
1387
	T:bool)
1388

    
1389
returns (idHierarchy1_Hierarchy1:int;
1390
	idHierarchy1_TOP:int;
1391
	idTOP_N1:int;
1392
	idTOP_N2:int;
1393
	x:real);
1394

    
1395

    
1396
let
1397

    
1398
	 automaton hierarchy1_hierarchy1
1399

    
1400
	state POINTHierarchy1_Hierarchy1:
1401
	unless (idHierarchy1_Hierarchy1_1=0) restart POINT__TO__HIERARCHY1_TOP_1
1402

    
1403

    
1404

    
1405
	unless (idHierarchy1_Hierarchy1_1=903) restart HIERARCHY1_TOP_IDL
1406

    
1407
	let
1408

    
1409
		(idHierarchy1_Hierarchy1, idHierarchy1_TOP, idTOP_N1, idTOP_N2, x) 
1410
	= (idHierarchy1_Hierarchy1_1, idHierarchy1_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1);
1411
	
1412

    
1413
	tel
1414

    
1415

    
1416

    
1417
	state POINT__TO__HIERARCHY1_TOP_1:
1418

    
1419
	 var 	idHierarchy1_Hierarchy1_2:int;
1420
	idHierarchy1_TOP_2:int;
1421
	idTOP_N1_2:int;
1422
	idTOP_N2_2:int;
1423
	x_2:real;
1424
	let
1425

    
1426
		-- transition trace :
1427
	--POINT__To__Hierarchy1_TOP_1
1428
		(idHierarchy1_TOP_2, idHierarchy1_Hierarchy1_2, x_2, idTOP_N1_2, idTOP_N2_2) 
1429
	= Hierarchy1_TOP_en(idHierarchy1_TOP_1, idHierarchy1_Hierarchy1_1, x_1, idTOP_N1_1, idTOP_N2_1, false);
1430
		
1431

    
1432
	(idHierarchy1_Hierarchy1, idHierarchy1_TOP, idTOP_N1, idTOP_N2, x) 
1433
	=  (idHierarchy1_Hierarchy1_2, idHierarchy1_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2);
1434

    
1435

    
1436
	tel
1437

    
1438
	until true restart POINTHierarchy1_Hierarchy1
1439

    
1440

    
1441

    
1442
	state HIERARCHY1_TOP_IDL:
1443

    
1444
	 var 	idHierarchy1_TOP_2:int;
1445
	idTOP_N1_2:int;
1446
	idTOP_N2_2:int;
1447
	x_2:real;
1448
	let
1449

    
1450
		
1451
	(idHierarchy1_TOP_2, idTOP_N1_2, x_2, idTOP_N2_2) 
1452
	= Hierarchy1_TOP_node(idHierarchy1_TOP_1, idTOP_N1_1, x_1, T, idTOP_N2_1, R, S);
1453

    
1454
		
1455

    
1456

    
1457
	(idHierarchy1_Hierarchy1, idHierarchy1_TOP, idTOP_N1, idTOP_N2, x) 
1458
	= (idHierarchy1_Hierarchy1_1, idHierarchy1_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2);
1459
	
1460

    
1461
	tel
1462

    
1463
	until true restart POINTHierarchy1_Hierarchy1
1464

    
1465

    
1466

    
1467
tel
1468

    
1469

    
1470
--***************************************************State :Hierarchy1_Hierarchy1 Automaton***************************************************
1471

    
1472
node Hierarchy1_Hierarchy1(S:bool;
1473
	R:bool;
1474
	T:bool)
1475

    
1476
returns (x:real);
1477

    
1478

    
1479
var x_1: real;
1480

    
1481
	idHierarchy1_Hierarchy1, idHierarchy1_Hierarchy1_1: int;
1482

    
1483
	idTOP_N2, idTOP_N2_1: int;
1484

    
1485
	idTOP_N1, idTOP_N1_1: int;
1486

    
1487
	idHierarchy1_TOP, idHierarchy1_TOP_1: int;
1488

    
1489
		idHierarchy1_Hierarchy1_2, idHierarchy1_Hierarchy1_3:int;
1490
	idHierarchy1_TOP_2, idHierarchy1_TOP_3:int;
1491
	idTOP_N1_2, idTOP_N1_3:int;
1492
	idTOP_N2_2, idTOP_N2_3:int;
1493
	x_2, x_3:real;
1494
let
1495

    
1496
	x_1 = 0.0 -> pre x;
1497

    
1498
	idHierarchy1_Hierarchy1_1 = 0 -> pre idHierarchy1_Hierarchy1;
1499

    
1500
	idTOP_N2_1 = 0 -> pre idTOP_N2;
1501

    
1502
	idTOP_N1_1 = 0 -> pre idTOP_N1;
1503

    
1504
	idHierarchy1_TOP_1 = 0 -> pre idHierarchy1_TOP;
1505

    
1506
	
1507

    
1508

    
1509

    
1510
	(idHierarchy1_Hierarchy1_2, idHierarchy1_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2)
1511
	 = 
1512

    
1513
	 if S then Hierarchy1_Hierarchy1_node(idHierarchy1_Hierarchy1_1, idHierarchy1_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1, false, S, false)
1514

    
1515
	 else (idHierarchy1_Hierarchy1_1, idHierarchy1_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1);
1516

    
1517
	
1518

    
1519

    
1520

    
1521
	(idHierarchy1_Hierarchy1_3, idHierarchy1_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3)
1522
	 = 
1523

    
1524
	 if R then Hierarchy1_Hierarchy1_node(idHierarchy1_Hierarchy1_2, idHierarchy1_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2, R, false, false)
1525

    
1526
	 else (idHierarchy1_Hierarchy1_2, idHierarchy1_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2);
1527

    
1528
	
1529

    
1530

    
1531

    
1532
	(idHierarchy1_Hierarchy1, idHierarchy1_TOP, idTOP_N1, idTOP_N2, x)
1533
	 = 
1534

    
1535
	 if T then Hierarchy1_Hierarchy1_node(idHierarchy1_Hierarchy1_3, idHierarchy1_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3, false, false, T)
1536

    
1537
	 else (idHierarchy1_Hierarchy1_3, idHierarchy1_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3);
1538

    
1539
	
1540

    
1541

    
1542
--unused outputs
1543
	
1544

    
1545
tel
1546

    
1547

    
1548

    
1549
node Hierarchy1 (In1_1_1 : real; In2_1_1 : real; In3_1_1 : real)
1550
returns (Out1_1_1 : real); 
1551
var
1552
	Hierarchy1_1_1 : real;
1553
	Mux_1_1 : real; Mux_1_2 : real; Mux_1_3 : real;
1554
	i_virtual_local : real;
1555
	Hierarchy1Mux_1_1_event: bool;
1556
	Hierarchy1Mux_1_2_event: bool;
1557
	Hierarchy1Mux_1_3_event: bool;
1558
let 
1559
	Hierarchy1Mux_1_1_event = false -> ((pre(Mux_1_1) > 0.0 and Mux_1_1 <= 0.0) or (pre(Mux_1_1) <= 0.0 and Mux_1_1 > 0.0));
1560
	Hierarchy1Mux_1_2_event = false -> ((pre(Mux_1_2) > 0.0 and Mux_1_2 <= 0.0) or (pre(Mux_1_2) <= 0.0 and Mux_1_2 > 0.0));
1561
	Hierarchy1Mux_1_3_event = false -> ((pre(Mux_1_3) > 0.0 and Mux_1_3 <= 0.0) or (pre(Mux_1_3) <= 0.0 and Mux_1_3 > 0.0));
1562
	Hierarchy1_1_1 =  Hierarchy1_Hierarchy1(Hierarchy1Mux_1_1_event, Hierarchy1Mux_1_2_event, Hierarchy1Mux_1_3_event);
1563
	Mux_1_1 = In1_1_1 ;
1564
	Mux_1_2 = In2_1_1 ;
1565
	Mux_1_3 = In3_1_1 ;
1566
	Out1_1_1 = Hierarchy1_1_1;
1567
	i_virtual_local= 0.0 -> 1.0;
1568
tel
1569