Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Parallel2 / Parallel2.lus @ eb639349

History | View | Annotate | Download (19.5 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node N1_A__To__N1_B_1_Condition_Action(x_1:real)
10

    
11
returns (x:real);
12

    
13

    
14
var 	x_2:real;
15

    
16

    
17
let
18

    
19

    
20

    
21
	x_2 
22
	=  x_1 +1.;
23
	
24

    
25
	(x) 
26
	= (x_2);
27
	
28

    
29
tel
30

    
31

    
32

    
33

    
34

    
35

    
36

    
37
node N2_D__To__N2_C_1_Condition_Action(x_1:real)
38

    
39
returns (x:real);
40

    
41

    
42
var 	x_2:real;
43

    
44

    
45
let
46

    
47

    
48

    
49
	x_2 
50
	=  x_1 -100.;
51
	
52

    
53
	(x) 
54
	= (x_2);
55
	
56

    
57
tel
58

    
59

    
60

    
61

    
62

    
63

    
64
node N1_B__To__N1_A_1_Condition_Action(x_1:real)
65

    
66
returns (x:real);
67

    
68

    
69
var 	x_2:real;
70

    
71

    
72
let
73

    
74

    
75

    
76
	x_2 
77
	=  x_1 -1.;
78
	
79

    
80
	(x) 
81
	= (x_2);
82
	
83

    
84
tel
85

    
86

    
87

    
88

    
89

    
90

    
91

    
92
node N2_C__To__N2_D_1_Condition_Action(x_1:real)
93

    
94
returns (x:real);
95

    
96

    
97
var 	x_2:real;
98

    
99

    
100
let
101

    
102

    
103

    
104
	x_2 
105
	=  x_1 +100.;
106
	
107

    
108
	(x) 
109
	= (x_2);
110
	
111

    
112
tel
113

    
114

    
115

    
116

    
117

    
118

    
119

    
120
-- Entry action for state :N2_C
121
node N2_C_en(idTOP_N2_1:int;
122
	x_1:real;
123
	isInner:bool)
124

    
125
returns (idTOP_N2:int;
126
	x:real);
127

    
128

    
129
var 	idTOP_N2_2:int;
130
	x_2:real;
131

    
132

    
133
let
134

    
135

    
136

    
137
	-- set state as active 
138
	idTOP_N2_2 
139
	= 1397;
140
	
141

    
142
	x_2 
143
	= if (not isInner) then  x_1 +1000.
144
	 else x_1;
145
	
146

    
147
	(idTOP_N2, x) 
148
	= (idTOP_N2_2, x_2);
149
	
150

    
151
tel
152

    
153

    
154

    
155

    
156

    
157
-- Exit action for state :N2_C
158
node N2_C_ex(idTOP_N2_1:int;
159
	isInner:bool)
160

    
161
returns (idTOP_N2:int);
162

    
163

    
164
var 	idTOP_N2_2:int;
165

    
166

    
167
let
168

    
169

    
170

    
171
	-- set state as inactive 
172
	idTOP_N2_2
173
	 = if (not isInner) then 0 else idTOP_N2_1;
174

    
175

    
176
	(idTOP_N2) 
177
	= (idTOP_N2_1);
178
	
179

    
180
tel
181

    
182

    
183

    
184

    
185

    
186

    
187
-- Entry action for state :N2_D
188
node N2_D_en(idTOP_N2_1:int;
189
	x_1:real;
190
	isInner:bool)
191

    
192
returns (idTOP_N2:int;
193
	x:real);
194

    
195

    
196
var 	idTOP_N2_2:int;
197
	x_2:real;
198

    
199

    
200
let
201

    
202

    
203

    
204
	-- set state as active 
205
	idTOP_N2_2 
206
	= 1398;
207
	
208

    
209
	x_2 
210
	= if (not isInner) then  x_1 -1000.
211
	 else x_1;
212
	
213

    
214
	(idTOP_N2, x) 
215
	= (idTOP_N2_2, x_2);
216
	
217

    
218
tel
219

    
220

    
221

    
222

    
223

    
224
-- Exit action for state :N2_D
225
node N2_D_ex(idTOP_N2_1:int;
226
	isInner:bool)
227

    
228
returns (idTOP_N2:int);
229

    
230

    
231
var 	idTOP_N2_2:int;
232

    
233

    
234
let
235

    
236

    
237

    
238
	-- set state as inactive 
239
	idTOP_N2_2
240
	 = if (not isInner) then 0 else idTOP_N2_1;
241

    
242

    
243
	(idTOP_N2) 
244
	= (idTOP_N2_1);
245
	
246

    
247
tel
248

    
249

    
250

    
251

    
252

    
253

    
254
-- Entry action for state :TOP_N2
255
node TOP_N2_en(idTOP_N2_1:int;
256
	idParallel2_TOP_1:int;
257
	x_1:real;
258
	isInner:bool)
259

    
260
returns (idTOP_N2:int;
261
	idParallel2_TOP:int;
262
	x:real);
263

    
264

    
265
var 	idTOP_N2_2, idTOP_N2_3, idTOP_N2_4, idTOP_N2_5, idTOP_N2_6:int;
266
	idParallel2_TOP_2, idParallel2_TOP_3, idParallel2_TOP_4:int;
267
	x_2, x_3, x_4, x_5, x_6, x_7:real;
268

    
269

    
270
let
271

    
272

    
273

    
274
	-- set state as active 
275
	idParallel2_TOP_2 
276
	= 1394;
277
	
278

    
279
	x_2 
280
	= if (not isInner) then  x_1 +100000.
281
	 else x_1;
282
	
283

    
284
	
285
-- transition trace :
286
	--POINT__To__N2_C_1
287
		(idTOP_N2_2, x_3) 
288
	= N2_C_en(idTOP_N2_1, x_2, false);
289
		
290

    
291
	(idTOP_N2_3, idParallel2_TOP_3, x_4) 
292
	= 
293

    
294
	if ( idTOP_N2_1 = 0) then
295

    
296
	 (idTOP_N2_2, idParallel2_TOP_2, x_3)
297

    
298
	 else(idTOP_N2_1, idParallel2_TOP_2, x_2);
299

    
300
	
301

    
302
	(idTOP_N2_4, x_5) 
303
	= 
304
	if ( idTOP_N2_1 = 1397) then
305
	N2_C_en(idTOP_N2_1, x_2, false)
306
	 else (idTOP_N2_1, x_2);
307

    
308
	
309

    
310
	(idTOP_N2_5, x_6) 
311
	= 
312
	if ( idTOP_N2_1 = 1398) then
313
	N2_D_en(idTOP_N2_1, x_2, false)
314
	 else (idTOP_N2_1, x_2);
315

    
316
	
317

    
318
	(idTOP_N2_6, idParallel2_TOP_4, x_7) 
319
	= 
320
		 if ( idTOP_N2_1 = 0) then 
321
		(idTOP_N2_3, idParallel2_TOP_3, x_4)
322
		 else
323
		 if ( idTOP_N2_1 = 1397) then 
324
		(idTOP_N2_4, idParallel2_TOP_3, x_5)
325
		 else
326
		 if ( idTOP_N2_1 = 1398) then 
327
		(idTOP_N2_5, idParallel2_TOP_3, x_6)
328
		 else (idTOP_N2_1, idParallel2_TOP_2, x_2);
329

    
330

    
331
	(idTOP_N2, idParallel2_TOP, x) 
332
	= (idTOP_N2_6, idParallel2_TOP_4, x_7);
333
	
334

    
335
tel
336

    
337

    
338

    
339

    
340

    
341
-- Exit action for state :TOP_N2
342
node TOP_N2_ex(idTOP_N2_1:int;
343
	x_1:real;
344
	idParallel2_TOP_1:int;
345
	isInner:bool)
346

    
347
returns (idTOP_N2:int;
348
	x:real;
349
	idParallel2_TOP:int);
350

    
351

    
352
var 	idTOP_N2_2, idTOP_N2_3, idTOP_N2_4, idTOP_N2_5:int;
353
	x_2:real;
354
	idParallel2_TOP_2:int;
355

    
356

    
357
let
358

    
359

    
360

    
361
	
362
	(idTOP_N2_2) 
363
	= 
364
	if ( idTOP_N2_1 = 1397) then
365
	N2_C_ex(idTOP_N2_1, false)
366
	 else (idTOP_N2_1);
367

    
368
	
369

    
370
	(idTOP_N2_3) 
371
	= 
372
	if ( idTOP_N2_1 = 1398) then
373
	N2_D_ex(idTOP_N2_1, false)
374
	 else (idTOP_N2_1);
375

    
376
	
377

    
378
	(idTOP_N2_4) 
379
	= 
380
		 if ( idTOP_N2_1 = 1397) then 
381
		(idTOP_N2_2)
382
		 else
383
		 if ( idTOP_N2_1 = 1398) then 
384
		(idTOP_N2_3)
385
		 else (idTOP_N2_1);
386

    
387

    
388
	x_2 
389
	= if (not isInner) then  x_1 -100000.
390
	 else x_1;
391
	
392

    
393
	-- set state as inactive 
394
	idParallel2_TOP_2
395
	 = if (not isInner) then 0 else idParallel2_TOP_1;
396

    
397
	idTOP_N2_5 
398
	= 0;
399
	
400

    
401
	(idTOP_N2, x, idParallel2_TOP) 
402
	= (idTOP_N2_5, x_2, idParallel2_TOP_1);
403
	
404

    
405
tel
406

    
407

    
408

    
409

    
410

    
411

    
412
-- Entry action for state :N1_A
413
node N1_A_en(idTOP_N1_1:int;
414
	x_1:real;
415
	isInner:bool)
416

    
417
returns (idTOP_N1:int;
418
	x:real);
419

    
420

    
421
var 	idTOP_N1_2:int;
422
	x_2:real;
423

    
424

    
425
let
426

    
427

    
428

    
429
	-- set state as active 
430
	idTOP_N1_2 
431
	= 1395;
432
	
433

    
434
	x_2 
435
	= if (not isInner) then  x_1 +10.
436
	 else x_1;
437
	
438

    
439
	(idTOP_N1, x) 
440
	= (idTOP_N1_2, x_2);
441
	
442

    
443
tel
444

    
445

    
446

    
447

    
448

    
449
-- Exit action for state :N1_A
450
node N1_A_ex(idTOP_N1_1:int;
451
	isInner:bool)
452

    
453
returns (idTOP_N1:int);
454

    
455

    
456
var 	idTOP_N1_2:int;
457

    
458

    
459
let
460

    
461

    
462

    
463
	-- set state as inactive 
464
	idTOP_N1_2
465
	 = if (not isInner) then 0 else idTOP_N1_1;
466

    
467

    
468
	(idTOP_N1) 
469
	= (idTOP_N1_1);
470
	
471

    
472
tel
473

    
474

    
475

    
476

    
477

    
478

    
479
-- Entry action for state :N1_B
480
node N1_B_en(idTOP_N1_1:int;
481
	x_1:real;
482
	isInner:bool)
483

    
484
returns (idTOP_N1:int;
485
	x:real);
486

    
487

    
488
var 	idTOP_N1_2:int;
489
	x_2:real;
490

    
491

    
492
let
493

    
494

    
495

    
496
	-- set state as active 
497
	idTOP_N1_2 
498
	= 1396;
499
	
500

    
501
	x_2 
502
	= if (not isInner) then  x_1 -10.
503
	 else x_1;
504
	
505

    
506
	(idTOP_N1, x) 
507
	= (idTOP_N1_2, x_2);
508
	
509

    
510
tel
511

    
512

    
513

    
514

    
515

    
516
-- Exit action for state :N1_B
517
node N1_B_ex(idTOP_N1_1:int;
518
	isInner:bool)
519

    
520
returns (idTOP_N1:int);
521

    
522

    
523
var 	idTOP_N1_2:int;
524

    
525

    
526
let
527

    
528

    
529

    
530
	-- set state as inactive 
531
	idTOP_N1_2
532
	 = if (not isInner) then 0 else idTOP_N1_1;
533

    
534

    
535
	(idTOP_N1) 
536
	= (idTOP_N1_1);
537
	
538

    
539
tel
540

    
541

    
542

    
543

    
544

    
545

    
546
-- Entry action for state :TOP_N1
547
node TOP_N1_en(idTOP_N1_1:int;
548
	idParallel2_TOP_1:int;
549
	x_1:real;
550
	isInner:bool)
551

    
552
returns (idTOP_N1:int;
553
	idParallel2_TOP:int;
554
	x:real);
555

    
556

    
557
var 	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4, idTOP_N1_5, idTOP_N1_6:int;
558
	idParallel2_TOP_2, idParallel2_TOP_3, idParallel2_TOP_4:int;
559
	x_2, x_3, x_4, x_5, x_6, x_7:real;
560

    
561

    
562
let
563

    
564

    
565

    
566
	-- set state as active 
567
	idParallel2_TOP_2 
568
	= 1393;
569
	
570

    
571
	x_2 
572
	= if (not isInner) then  x_1 +10000.
573
	 else x_1;
574
	
575

    
576
	
577
-- transition trace :
578
	--POINT__To__N1_A_1
579
		(idTOP_N1_2, x_3) 
580
	= N1_A_en(idTOP_N1_1, x_2, false);
581
		
582

    
583
	(idTOP_N1_3, idParallel2_TOP_3, x_4) 
584
	= 
585

    
586
	if ( idTOP_N1_1 = 0) then
587

    
588
	 (idTOP_N1_2, idParallel2_TOP_2, x_3)
589

    
590
	 else(idTOP_N1_1, idParallel2_TOP_2, x_2);
591

    
592
	
593

    
594
	(idTOP_N1_4, x_5) 
595
	= 
596
	if ( idTOP_N1_1 = 1395) then
597
	N1_A_en(idTOP_N1_1, x_2, false)
598
	 else (idTOP_N1_1, x_2);
599

    
600
	
601

    
602
	(idTOP_N1_5, x_6) 
603
	= 
604
	if ( idTOP_N1_1 = 1396) then
605
	N1_B_en(idTOP_N1_1, x_2, false)
606
	 else (idTOP_N1_1, x_2);
607

    
608
	
609

    
610
	(idTOP_N1_6, idParallel2_TOP_4, x_7) 
611
	= 
612
		 if ( idTOP_N1_1 = 0) then 
613
		(idTOP_N1_3, idParallel2_TOP_3, x_4)
614
		 else
615
		 if ( idTOP_N1_1 = 1395) then 
616
		(idTOP_N1_4, idParallel2_TOP_3, x_5)
617
		 else
618
		 if ( idTOP_N1_1 = 1396) then 
619
		(idTOP_N1_5, idParallel2_TOP_3, x_6)
620
		 else (idTOP_N1_1, idParallel2_TOP_2, x_2);
621

    
622

    
623
	(idTOP_N1, idParallel2_TOP, x) 
624
	= (idTOP_N1_6, idParallel2_TOP_4, x_7);
625
	
626

    
627
tel
628

    
629

    
630

    
631

    
632

    
633
-- Exit action for state :TOP_N1
634
node TOP_N1_ex(idTOP_N1_1:int;
635
	x_1:real;
636
	idParallel2_TOP_1:int;
637
	isInner:bool)
638

    
639
returns (idTOP_N1:int;
640
	x:real;
641
	idParallel2_TOP:int);
642

    
643

    
644
var 	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4, idTOP_N1_5:int;
645
	x_2:real;
646
	idParallel2_TOP_2:int;
647

    
648

    
649
let
650

    
651

    
652

    
653
	
654
	(idTOP_N1_2) 
655
	= 
656
	if ( idTOP_N1_1 = 1395) then
657
	N1_A_ex(idTOP_N1_1, false)
658
	 else (idTOP_N1_1);
659

    
660
	
661

    
662
	(idTOP_N1_3) 
663
	= 
664
	if ( idTOP_N1_1 = 1396) then
665
	N1_B_ex(idTOP_N1_1, false)
666
	 else (idTOP_N1_1);
667

    
668
	
669

    
670
	(idTOP_N1_4) 
671
	= 
672
		 if ( idTOP_N1_1 = 1395) then 
673
		(idTOP_N1_2)
674
		 else
675
		 if ( idTOP_N1_1 = 1396) then 
676
		(idTOP_N1_3)
677
		 else (idTOP_N1_1);
678

    
679

    
680
	x_2 
681
	= if (not isInner) then  x_1 -10000.
682
	 else x_1;
683
	
684

    
685
	-- set state as inactive 
686
	idParallel2_TOP_2
687
	 = if (not isInner) then 0 else idParallel2_TOP_1;
688

    
689
	idTOP_N1_5 
690
	= 0;
691
	
692

    
693
	(idTOP_N1, x, idParallel2_TOP) 
694
	= (idTOP_N1_5, x_2, idParallel2_TOP_1);
695
	
696

    
697
tel
698

    
699

    
700

    
701

    
702

    
703

    
704
-- Entry action for state :Parallel2_TOP
705
node Parallel2_TOP_en(idParallel2_TOP_1:int;
706
	idParallel2_Parallel2_1:int;
707
	x_1:real;
708
	idTOP_N1_1:int;
709
	idTOP_N2_1:int;
710
	isInner:bool)
711

    
712
returns (idParallel2_TOP:int;
713
	idParallel2_Parallel2:int;
714
	x:real;
715
	idTOP_N1:int;
716
	idTOP_N2:int);
717

    
718

    
719
var 	idParallel2_TOP_2, idParallel2_TOP_3:int;
720
	idParallel2_Parallel2_2:int;
721
	x_2, x_3, x_4:real;
722
	idTOP_N1_2:int;
723
	idTOP_N2_2:int;
724

    
725

    
726
let
727

    
728

    
729

    
730
	-- set state as active 
731
	idParallel2_Parallel2_2 
732
	= 1399;
733
	
734

    
735
	x_2 
736
	= if (not isInner) then  x_1 +1000000.
737
	 else x_1;
738
	
739

    
740
	
741
	(idTOP_N1_2, idParallel2_TOP_2, x_3) 
742
	= TOP_N1_en(idTOP_N1_1, idParallel2_TOP_1, x_2, false);
743

    
744
	(idTOP_N2_2, idParallel2_TOP_3, x_4) 
745
	= TOP_N2_en(idTOP_N2_1, idParallel2_TOP_2, x_3, false);
746

    
747

    
748
	(idParallel2_TOP, idParallel2_Parallel2, x, idTOP_N1, idTOP_N2) 
749
	= (idParallel2_TOP_3, idParallel2_Parallel2_2, x_4, idTOP_N1_2, idTOP_N2_2);
750
	
751

    
752
tel
753

    
754

    
755

    
756

    
757

    
758
-- Exit action for state :Parallel2_TOP
759
node Parallel2_TOP_ex(idTOP_N2_1:int;
760
	x_1:real;
761
	idParallel2_TOP_1:int;
762
	idTOP_N1_1:int;
763
	idParallel2_Parallel2_1:int;
764
	isInner:bool)
765

    
766
returns (idTOP_N2:int;
767
	x:real;
768
	idParallel2_TOP:int;
769
	idTOP_N1:int;
770
	idParallel2_Parallel2:int);
771

    
772

    
773
var 	idTOP_N2_2:int;
774
	x_2, x_3, x_4:real;
775
	idParallel2_TOP_2, idParallel2_TOP_3, idParallel2_TOP_4:int;
776
	idTOP_N1_2:int;
777
	idParallel2_Parallel2_2:int;
778

    
779

    
780
let
781

    
782

    
783

    
784
	
785
	(idTOP_N2_2, x_2, idParallel2_TOP_2) 
786
	= TOP_N2_ex(idTOP_N2_1, x_1, idParallel2_TOP_1, false);
787

    
788
	(idTOP_N1_2, x_3, idParallel2_TOP_3) 
789
	= TOP_N1_ex(idTOP_N1_1, x_2, idParallel2_TOP_2, false);
790

    
791

    
792
	x_4 
793
	= if (not isInner) then  x_3 -1000000.
794
	 else x_3;
795
	
796

    
797
	-- set state as inactive 
798
	idParallel2_Parallel2_2
799
	 = if (not isInner) then 0 else idParallel2_Parallel2_1;
800

    
801
	idParallel2_TOP_4 
802
	= 0;
803
	
804

    
805
	(idTOP_N2, x, idParallel2_TOP, idTOP_N1, idParallel2_Parallel2) 
806
	= (idTOP_N2_2, x_4, idParallel2_TOP_4, idTOP_N1_2, idParallel2_Parallel2_1);
807
	
808

    
809
tel
810

    
811

    
812
--***************************************************State :TOP_N2 Automaton***************************************************
813

    
814
node TOP_N2_node(idTOP_N2_1:int;
815
	x_1:real;
816
	S2:bool;
817
	R2:bool)
818

    
819
returns (idTOP_N2:int;
820
	x:real);
821

    
822

    
823
let
824

    
825
	 automaton top_n2
826

    
827
	state POINTTOP_N2:
828
	unless (idTOP_N2_1=0) restart POINT__TO__N2_C_1
829

    
830

    
831

    
832
	unless (idTOP_N2_1=1397) and S2 restart N2_C__TO__N2_D_1
833

    
834

    
835

    
836
	unless (idTOP_N2_1=1398) and R2 restart N2_D__TO__N2_C_1
837

    
838

    
839

    
840
	unless (idTOP_N2_1=1397) restart N2_C_IDL
841

    
842
	unless (idTOP_N2_1=1398) restart N2_D_IDL
843

    
844
	let
845

    
846
		(idTOP_N2, x) 
847
	= (idTOP_N2_1, x_1);
848
	
849

    
850
	tel
851

    
852

    
853

    
854
	state POINT__TO__N2_C_1:
855

    
856
	 var 	idTOP_N2_2:int;
857
	x_2:real;
858
	let
859

    
860
		-- transition trace :
861
	--POINT__To__N2_C_1
862
		(idTOP_N2_2, x_2) 
863
	= N2_C_en(idTOP_N2_1, x_1, false);
864
		
865

    
866
	(idTOP_N2, x) 
867
	=  (idTOP_N2_2, x_2);
868

    
869

    
870
	tel
871

    
872
	until true restart POINTTOP_N2
873

    
874

    
875

    
876
	state N2_C__TO__N2_D_1:
877

    
878
	 var 	idTOP_N2_2, idTOP_N2_3:int;
879
	x_2, x_3:real;
880
	let
881

    
882
		-- transition trace :
883
	--N2_C__To__N2_D_1
884
		-- condition Action : x+=100;
885
		
886
		(x_2) 
887
	= N2_C__To__N2_D_1_Condition_Action(x_1);
888
		
889

    
890
		(idTOP_N2_2) 
891
	= N2_C_ex(idTOP_N2_1, false);
892
		
893

    
894
		(idTOP_N2_3, x_3) 
895
	= N2_D_en(idTOP_N2_2, x_2, false);
896
		
897

    
898
	(idTOP_N2, x) 
899
	=  (idTOP_N2_3, x_3);
900

    
901

    
902
	tel
903

    
904
	until true restart POINTTOP_N2
905

    
906

    
907

    
908
	state N2_D__TO__N2_C_1:
909

    
910
	 var 	idTOP_N2_2, idTOP_N2_3:int;
911
	x_2, x_3:real;
912
	let
913

    
914
		-- transition trace :
915
	--N2_D__To__N2_C_1
916
		-- condition Action : x-=100;
917
		
918
		(x_2) 
919
	= N2_D__To__N2_C_1_Condition_Action(x_1);
920
		
921

    
922
		(idTOP_N2_2) 
923
	= N2_D_ex(idTOP_N2_1, false);
924
		
925

    
926
		(idTOP_N2_3, x_3) 
927
	= N2_C_en(idTOP_N2_2, x_2, false);
928
		
929

    
930
	(idTOP_N2, x) 
931
	=  (idTOP_N2_3, x_3);
932

    
933

    
934
	tel
935

    
936
	until true restart POINTTOP_N2
937

    
938

    
939

    
940
	state N2_C_IDL:
941

    
942
	 	let
943

    
944
		
945

    
946
	(idTOP_N2, x) 
947
	= (idTOP_N2_1, x_1);
948
	
949

    
950
	tel
951

    
952
	until true restart POINTTOP_N2
953

    
954

    
955

    
956
	state N2_D_IDL:
957

    
958
	 	let
959

    
960
		
961

    
962
	(idTOP_N2, x) 
963
	= (idTOP_N2_1, x_1);
964
	
965

    
966
	tel
967

    
968
	until true restart POINTTOP_N2
969

    
970

    
971

    
972
tel
973

    
974

    
975
--***************************************************State :TOP_N1 Automaton***************************************************
976

    
977
node TOP_N1_node(idTOP_N1_1:int;
978
	x_1:real;
979
	S1:bool;
980
	R1:bool)
981

    
982
returns (idTOP_N1:int;
983
	x:real);
984

    
985

    
986
let
987

    
988
	 automaton top_n1
989

    
990
	state POINTTOP_N1:
991
	unless (idTOP_N1_1=0) restart POINT__TO__N1_A_1
992

    
993

    
994

    
995
	unless (idTOP_N1_1=1395) and S1 restart N1_A__TO__N1_B_1
996

    
997

    
998

    
999
	unless (idTOP_N1_1=1396) and R1 restart N1_B__TO__N1_A_1
1000

    
1001

    
1002

    
1003
	unless (idTOP_N1_1=1395) restart N1_A_IDL
1004

    
1005
	unless (idTOP_N1_1=1396) restart N1_B_IDL
1006

    
1007
	let
1008

    
1009
		(idTOP_N1, x) 
1010
	= (idTOP_N1_1, x_1);
1011
	
1012

    
1013
	tel
1014

    
1015

    
1016

    
1017
	state POINT__TO__N1_A_1:
1018

    
1019
	 var 	idTOP_N1_2:int;
1020
	x_2:real;
1021
	let
1022

    
1023
		-- transition trace :
1024
	--POINT__To__N1_A_1
1025
		(idTOP_N1_2, x_2) 
1026
	= N1_A_en(idTOP_N1_1, x_1, false);
1027
		
1028

    
1029
	(idTOP_N1, x) 
1030
	=  (idTOP_N1_2, x_2);
1031

    
1032

    
1033
	tel
1034

    
1035
	until true restart POINTTOP_N1
1036

    
1037

    
1038

    
1039
	state N1_A__TO__N1_B_1:
1040

    
1041
	 var 	idTOP_N1_2, idTOP_N1_3:int;
1042
	x_2, x_3:real;
1043
	let
1044

    
1045
		-- transition trace :
1046
	--N1_A__To__N1_B_1
1047
		-- condition Action : x+=1;
1048
		
1049
		(x_2) 
1050
	= N1_A__To__N1_B_1_Condition_Action(x_1);
1051
		
1052

    
1053
		(idTOP_N1_2) 
1054
	= N1_A_ex(idTOP_N1_1, false);
1055
		
1056

    
1057
		(idTOP_N1_3, x_3) 
1058
	= N1_B_en(idTOP_N1_2, x_2, false);
1059
		
1060

    
1061
	(idTOP_N1, x) 
1062
	=  (idTOP_N1_3, x_3);
1063

    
1064

    
1065
	tel
1066

    
1067
	until true restart POINTTOP_N1
1068

    
1069

    
1070

    
1071
	state N1_B__TO__N1_A_1:
1072

    
1073
	 var 	idTOP_N1_2, idTOP_N1_3:int;
1074
	x_2, x_3:real;
1075
	let
1076

    
1077
		-- transition trace :
1078
	--N1_B__To__N1_A_1
1079
		-- condition Action : x-=1;
1080
		
1081
		(x_2) 
1082
	= N1_B__To__N1_A_1_Condition_Action(x_1);
1083
		
1084

    
1085
		(idTOP_N1_2) 
1086
	= N1_B_ex(idTOP_N1_1, false);
1087
		
1088

    
1089
		(idTOP_N1_3, x_3) 
1090
	= N1_A_en(idTOP_N1_2, x_2, false);
1091
		
1092

    
1093
	(idTOP_N1, x) 
1094
	=  (idTOP_N1_3, x_3);
1095

    
1096

    
1097
	tel
1098

    
1099
	until true restart POINTTOP_N1
1100

    
1101

    
1102

    
1103
	state N1_A_IDL:
1104

    
1105
	 	let
1106

    
1107
		
1108

    
1109
	(idTOP_N1, x) 
1110
	= (idTOP_N1_1, x_1);
1111
	
1112

    
1113
	tel
1114

    
1115
	until true restart POINTTOP_N1
1116

    
1117

    
1118

    
1119
	state N1_B_IDL:
1120

    
1121
	 	let
1122

    
1123
		
1124

    
1125
	(idTOP_N1, x) 
1126
	= (idTOP_N1_1, x_1);
1127
	
1128

    
1129
	tel
1130

    
1131
	until true restart POINTTOP_N1
1132

    
1133

    
1134

    
1135
tel
1136

    
1137

    
1138
--***************************************************State :Parallel2_TOP Automaton***************************************************
1139

    
1140
node Parallel2_TOP_node(idParallel2_TOP_1:int;
1141
	idTOP_N1_1:int;
1142
	x_1:real;
1143
	idTOP_N2_1:int;
1144
	R1:bool;
1145
	S1:bool;
1146
	R2:bool;
1147
	S2:bool)
1148

    
1149
returns (idParallel2_TOP:int;
1150
	idTOP_N1:int;
1151
	x:real;
1152
	idTOP_N2:int);
1153

    
1154

    
1155
let
1156

    
1157
	 automaton parallel2_top
1158

    
1159
	state POINTParallel2_TOP:
1160
	unless (idParallel2_TOP_1=0) restart PARALLEL2_TOP_PARALLEL_ENTRY
1161
	unless true  restart PARALLEL2_TOP_PARALLEL_IDL
1162

    
1163
	let
1164

    
1165
		(idParallel2_TOP, idTOP_N1, x, idTOP_N2) 
1166
	= (idParallel2_TOP_1, idTOP_N1_1, x_1, idTOP_N2_1);
1167
	
1168

    
1169
	tel
1170

    
1171

    
1172

    
1173
	state PARALLEL2_TOP_PARALLEL_ENTRY:
1174

    
1175
	 var 	idParallel2_TOP_2, idParallel2_TOP_3:int;
1176
	idTOP_N1_2:int;
1177
	x_2, x_3:real;
1178
	idTOP_N2_2:int;
1179
	let
1180

    
1181
		
1182
	(idTOP_N1_2, idParallel2_TOP_2, x_2) 
1183
	= TOP_N1_en(idTOP_N1_1, idParallel2_TOP_1, x_1, false);
1184

    
1185
	(idTOP_N2_2, idParallel2_TOP_3, x_3) 
1186
	= TOP_N2_en(idTOP_N2_1, idParallel2_TOP_2, x_2, false);
1187

    
1188

    
1189
	(idParallel2_TOP, idTOP_N1, x, idTOP_N2) 
1190
	= (idParallel2_TOP_3, idTOP_N1_2, x_3, idTOP_N2_2);
1191
	
1192

    
1193
	tel
1194

    
1195
	until true restart POINTParallel2_TOP
1196

    
1197

    
1198

    
1199
	state PARALLEL2_TOP_PARALLEL_IDL:
1200

    
1201
	 var 	idTOP_N1_2:int;
1202
	x_2, x_3:real;
1203
	idTOP_N2_2:int;
1204
	let
1205

    
1206
		
1207

    
1208
		(idTOP_N1_2, x_2)
1209
	= if not (idTOP_N1_1= 0 ) then TOP_N1_node(idTOP_N1_1, x_1, S1, R1)
1210

    
1211
		 else (idTOP_N1_1, x_1);
1212

    
1213
		
1214

    
1215
		
1216

    
1217
		(idTOP_N2_2, x_3)
1218
	= if not (idTOP_N2_1= 0 ) then TOP_N2_node(idTOP_N2_1, x_2, S2, R2)
1219

    
1220
		 else (idTOP_N2_1, x_2);
1221

    
1222
		
1223

    
1224
		
1225

    
1226
	(idParallel2_TOP, idTOP_N1, x, idTOP_N2) 
1227
	= (idParallel2_TOP_1, idTOP_N1_2, x_3, idTOP_N2_2);
1228
	
1229

    
1230
	tel
1231

    
1232
	until true restart POINTParallel2_TOP
1233

    
1234

    
1235

    
1236
tel
1237

    
1238

    
1239
--***************************************************State :Parallel2_Parallel2 Automaton***************************************************
1240

    
1241
node Parallel2_Parallel2_node(idParallel2_Parallel2_1:int;
1242
	idParallel2_TOP_1:int;
1243
	idTOP_N1_1:int;
1244
	idTOP_N2_1:int;
1245
	x_1:real;
1246
	R1:bool;
1247
	S1:bool;
1248
	R2:bool;
1249
	S2:bool)
1250

    
1251
returns (idParallel2_Parallel2:int;
1252
	idParallel2_TOP:int;
1253
	idTOP_N1:int;
1254
	idTOP_N2:int;
1255
	x:real);
1256

    
1257

    
1258
let
1259

    
1260
	 automaton parallel2_parallel2
1261

    
1262
	state POINTParallel2_Parallel2:
1263
	unless (idParallel2_Parallel2_1=0) restart POINT__TO__PARALLEL2_TOP_1
1264

    
1265

    
1266

    
1267
	unless (idParallel2_Parallel2_1=1399) restart PARALLEL2_TOP_IDL
1268

    
1269
	let
1270

    
1271
		(idParallel2_Parallel2, idParallel2_TOP, idTOP_N1, idTOP_N2, x) 
1272
	= (idParallel2_Parallel2_1, idParallel2_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1);
1273
	
1274

    
1275
	tel
1276

    
1277

    
1278

    
1279
	state POINT__TO__PARALLEL2_TOP_1:
1280

    
1281
	 var 	idParallel2_Parallel2_2:int;
1282
	idParallel2_TOP_2:int;
1283
	idTOP_N1_2:int;
1284
	idTOP_N2_2:int;
1285
	x_2:real;
1286
	let
1287

    
1288
		-- transition trace :
1289
	--POINT__To__Parallel2_TOP_1
1290
		(idParallel2_TOP_2, idParallel2_Parallel2_2, x_2, idTOP_N1_2, idTOP_N2_2) 
1291
	= Parallel2_TOP_en(idParallel2_TOP_1, idParallel2_Parallel2_1, x_1, idTOP_N1_1, idTOP_N2_1, false);
1292
		
1293

    
1294
	(idParallel2_Parallel2, idParallel2_TOP, idTOP_N1, idTOP_N2, x) 
1295
	=  (idParallel2_Parallel2_2, idParallel2_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2);
1296

    
1297

    
1298
	tel
1299

    
1300
	until true restart POINTParallel2_Parallel2
1301

    
1302

    
1303

    
1304
	state PARALLEL2_TOP_IDL:
1305

    
1306
	 var 	idTOP_N1_2:int;
1307
	idTOP_N2_2:int;
1308
	x_2, x_3:real;
1309
	let
1310

    
1311
		
1312

    
1313
		(idTOP_N1_2, x_2)
1314
	= if not (idTOP_N1_1= 0 ) then TOP_N1_node(idTOP_N1_1, x_1, S1, R1)
1315

    
1316
		 else (idTOP_N1_1, x_1);
1317

    
1318
		
1319

    
1320
		
1321

    
1322
		(idTOP_N2_2, x_3)
1323
	= if not (idTOP_N2_1= 0 ) then TOP_N2_node(idTOP_N2_1, x_2, S2, R2)
1324

    
1325
		 else (idTOP_N2_1, x_2);
1326

    
1327
		
1328

    
1329
		
1330

    
1331
	(idParallel2_Parallel2, idParallel2_TOP, idTOP_N1, idTOP_N2, x) 
1332
	= (idParallel2_Parallel2_1, idParallel2_TOP_1, idTOP_N1_2, idTOP_N2_2, x_3);
1333
	
1334

    
1335
	tel
1336

    
1337
	until true restart POINTParallel2_Parallel2
1338

    
1339

    
1340

    
1341
tel
1342

    
1343

    
1344
--***************************************************State :Parallel2_Parallel2 Automaton***************************************************
1345

    
1346
node Parallel2_Parallel2(S1:bool;
1347
	R1:bool;
1348
	S2:bool;
1349
	R2:bool)
1350

    
1351
returns (x:real);
1352

    
1353

    
1354
var x_1: real;
1355

    
1356
	idParallel2_Parallel2, idParallel2_Parallel2_1: int;
1357

    
1358
	idTOP_N2, idTOP_N2_1: int;
1359

    
1360
	idTOP_N1, idTOP_N1_1: int;
1361

    
1362
	idParallel2_TOP, idParallel2_TOP_1: int;
1363

    
1364
		idParallel2_Parallel2_2, idParallel2_Parallel2_3, idParallel2_Parallel2_4:int;
1365
	idParallel2_TOP_2, idParallel2_TOP_3, idParallel2_TOP_4:int;
1366
	idTOP_N1_2, idTOP_N1_3, idTOP_N1_4:int;
1367
	idTOP_N2_2, idTOP_N2_3, idTOP_N2_4:int;
1368
	x_2, x_3, x_4:real;
1369
let
1370

    
1371
	x_1 = 0.0 -> pre x;
1372

    
1373
	idParallel2_Parallel2_1 = 0 -> pre idParallel2_Parallel2;
1374

    
1375
	idTOP_N2_1 = 0 -> pre idTOP_N2;
1376

    
1377
	idTOP_N1_1 = 0 -> pre idTOP_N1;
1378

    
1379
	idParallel2_TOP_1 = 0 -> pre idParallel2_TOP;
1380

    
1381
	
1382

    
1383

    
1384

    
1385
	(idParallel2_Parallel2_2, idParallel2_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2)
1386
	 = 
1387

    
1388
	 if S1 then Parallel2_Parallel2_node(idParallel2_Parallel2_1, idParallel2_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1, false, S1, false, false)
1389

    
1390
	 else (idParallel2_Parallel2_1, idParallel2_TOP_1, idTOP_N1_1, idTOP_N2_1, x_1);
1391

    
1392
	
1393

    
1394

    
1395

    
1396
	(idParallel2_Parallel2_3, idParallel2_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3)
1397
	 = 
1398

    
1399
	 if R1 then Parallel2_Parallel2_node(idParallel2_Parallel2_2, idParallel2_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2, R1, false, false, false)
1400

    
1401
	 else (idParallel2_Parallel2_2, idParallel2_TOP_2, idTOP_N1_2, idTOP_N2_2, x_2);
1402

    
1403
	
1404

    
1405

    
1406

    
1407
	(idParallel2_Parallel2_4, idParallel2_TOP_4, idTOP_N1_4, idTOP_N2_4, x_4)
1408
	 = 
1409

    
1410
	 if S2 then Parallel2_Parallel2_node(idParallel2_Parallel2_3, idParallel2_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3, false, false, false, S2)
1411

    
1412
	 else (idParallel2_Parallel2_3, idParallel2_TOP_3, idTOP_N1_3, idTOP_N2_3, x_3);
1413

    
1414
	
1415

    
1416

    
1417

    
1418
	(idParallel2_Parallel2, idParallel2_TOP, idTOP_N1, idTOP_N2, x)
1419
	 = 
1420

    
1421
	 if R2 then Parallel2_Parallel2_node(idParallel2_Parallel2_4, idParallel2_TOP_4, idTOP_N1_4, idTOP_N2_4, x_4, false, false, R2, false)
1422

    
1423
	 else (idParallel2_Parallel2_4, idParallel2_TOP_4, idTOP_N1_4, idTOP_N2_4, x_4);
1424

    
1425
	
1426

    
1427

    
1428
--unused outputs
1429
	
1430

    
1431
tel
1432

    
1433

    
1434

    
1435
node Parallel2 (S1_1_1 : real; R1_1_1 : real; S2_1_1 : real; R2_1_1 : real)
1436
returns (x_1_1 : real); 
1437
var
1438
	Mux_1_1 : real; Mux_1_2 : real; Mux_1_3 : real; Mux_1_4 : real;
1439
	Parallel2_1_1 : real;
1440
	i_virtual_local : real;
1441
	Parallel2Mux_1_1_event: bool;
1442
	Parallel2Mux_1_2_event: bool;
1443
	Parallel2Mux_1_3_event: bool;
1444
	Parallel2Mux_1_4_event: bool;
1445
let 
1446
	Mux_1_1 = S1_1_1 ;
1447
	Mux_1_2 = R1_1_1 ;
1448
	Mux_1_3 = S2_1_1 ;
1449
	Mux_1_4 = R2_1_1 ;
1450
	Parallel2Mux_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));
1451
	Parallel2Mux_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));
1452
	Parallel2Mux_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));
1453
	Parallel2Mux_1_4_event = false -> ((pre(Mux_1_4) > 0.0 and Mux_1_4 <= 0.0) or (pre(Mux_1_4) <= 0.0 and Mux_1_4 > 0.0));
1454
	Parallel2_1_1 =  Parallel2_Parallel2(Parallel2Mux_1_1_event, Parallel2Mux_1_2_event, Parallel2Mux_1_3_event, Parallel2Mux_1_4_event);
1455
	x_1_1 = Parallel2_1_1;
1456
	i_virtual_local= 0.0 -> 1.0;
1457
tel
1458