Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Junctions2 / Junctions2.lus @ eb639349

History | View | Annotate | Download (11.2 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node Junctions2_Junctions2Junction1210__To__Junctions2_D_1_Condition_Action(y_1:int)
10

    
11
returns (y:int);
12

    
13

    
14
var 	y_2:int;
15

    
16

    
17
let
18

    
19

    
20

    
21
	y_2 
22
	=  y_1 +10000;
23
	
24

    
25
	(y) 
26
	= (y_2);
27
	
28

    
29
tel
30

    
31

    
32

    
33

    
34

    
35

    
36
node Junctions2_Junctions2Junction1209__To__Junctions2_B_2_Condition_Action(y_1:int)
37

    
38
returns (y:int);
39

    
40

    
41
var 	y_2:int;
42

    
43

    
44
let
45

    
46

    
47

    
48
	y_2 
49
	=  y_1 +10;
50
	
51

    
52
	(y) 
53
	= (y_2);
54
	
55

    
56
tel
57

    
58

    
59

    
60

    
61

    
62

    
63

    
64
node Junctions2_A__To__Junctions2_Junctions2Junction1209_1_Condition_Action(y_1:int)
65

    
66
returns (y:int);
67

    
68

    
69
var 	y_2:int;
70

    
71

    
72
let
73

    
74

    
75

    
76
	y_2 
77
	=  y_1  + 1;
78
	
79

    
80
	(y) 
81
	= (y_2);
82
	
83

    
84
tel
85

    
86

    
87

    
88

    
89

    
90

    
91
node Junctions2_Junctions2Junction1210__To__Junctions2_C_2_Condition_Action(y_1:int)
92

    
93
returns (y:int);
94

    
95

    
96
var 	y_2:int;
97

    
98

    
99
let
100

    
101

    
102

    
103
	y_2 
104
	=  y_1 +1000;
105
	
106

    
107
	(y) 
108
	= (y_2);
109
	
110

    
111
tel
112

    
113

    
114

    
115

    
116

    
117

    
118

    
119

    
120
node Junctions2_Junctions2Junction1209__To__Junctions2_Junctions2Junction1210_1_Condition_Action(y_1:int)
121

    
122
returns (y:int);
123

    
124

    
125
var 	y_2:int;
126

    
127

    
128
let
129

    
130

    
131

    
132
	y_2 
133
	=  y_1 +100;
134
	
135

    
136
	(y) 
137
	= (y_2);
138
	
139

    
140
tel
141

    
142

    
143

    
144

    
145

    
146

    
147

    
148
-- Entry action for state :Junctions2_D
149
node Junctions2_D_en(idJunctions2_Junctions2_1:int;
150
	isInner:bool)
151

    
152
returns (idJunctions2_Junctions2:int);
153

    
154

    
155
var 	idJunctions2_Junctions2_2:int;
156

    
157

    
158
let
159

    
160

    
161

    
162
	-- set state as active 
163
	idJunctions2_Junctions2_2 
164
	= 1206;
165
	
166

    
167
	(idJunctions2_Junctions2) 
168
	= (idJunctions2_Junctions2_2);
169
	
170

    
171
tel
172

    
173

    
174

    
175

    
176

    
177
-- Exit action for state :Junctions2_D
178
node Junctions2_D_ex(idJunctions2_Junctions2_1:int;
179
	isInner:bool)
180

    
181
returns (idJunctions2_Junctions2:int);
182

    
183

    
184
var 	idJunctions2_Junctions2_2:int;
185

    
186

    
187
let
188

    
189

    
190

    
191
	-- set state as inactive 
192
	idJunctions2_Junctions2_2
193
	 = if (not isInner) then 0 else idJunctions2_Junctions2_1;
194

    
195

    
196
	(idJunctions2_Junctions2) 
197
	= (idJunctions2_Junctions2_1);
198
	
199

    
200
tel
201

    
202

    
203

    
204

    
205

    
206

    
207
-- Entry action for state :Junctions2_C
208
node Junctions2_C_en(idJunctions2_Junctions2_1:int;
209
	isInner:bool)
210

    
211
returns (idJunctions2_Junctions2:int);
212

    
213

    
214
var 	idJunctions2_Junctions2_2:int;
215

    
216

    
217
let
218

    
219

    
220

    
221
	-- set state as active 
222
	idJunctions2_Junctions2_2 
223
	= 1205;
224
	
225

    
226
	(idJunctions2_Junctions2) 
227
	= (idJunctions2_Junctions2_2);
228
	
229

    
230
tel
231

    
232

    
233

    
234

    
235

    
236
-- Exit action for state :Junctions2_C
237
node Junctions2_C_ex(idJunctions2_Junctions2_1:int;
238
	isInner:bool)
239

    
240
returns (idJunctions2_Junctions2:int);
241

    
242

    
243
var 	idJunctions2_Junctions2_2:int;
244

    
245

    
246
let
247

    
248

    
249

    
250
	-- set state as inactive 
251
	idJunctions2_Junctions2_2
252
	 = if (not isInner) then 0 else idJunctions2_Junctions2_1;
253

    
254

    
255
	(idJunctions2_Junctions2) 
256
	= (idJunctions2_Junctions2_1);
257
	
258

    
259
tel
260

    
261

    
262

    
263

    
264

    
265

    
266
-- Entry action for state :Junctions2_A
267
node Junctions2_A_en(idJunctions2_Junctions2_1:int;
268
	isInner:bool)
269

    
270
returns (idJunctions2_Junctions2:int);
271

    
272

    
273
var 	idJunctions2_Junctions2_2:int;
274

    
275

    
276
let
277

    
278

    
279

    
280
	-- set state as active 
281
	idJunctions2_Junctions2_2 
282
	= 1203;
283
	
284

    
285
	(idJunctions2_Junctions2) 
286
	= (idJunctions2_Junctions2_2);
287
	
288

    
289
tel
290

    
291

    
292

    
293

    
294

    
295
-- Exit action for state :Junctions2_A
296
node Junctions2_A_ex(idJunctions2_Junctions2_1:int;
297
	isInner:bool)
298

    
299
returns (idJunctions2_Junctions2:int);
300

    
301

    
302
var 	idJunctions2_Junctions2_2:int;
303

    
304

    
305
let
306

    
307

    
308

    
309
	-- set state as inactive 
310
	idJunctions2_Junctions2_2
311
	 = if (not isInner) then 0 else idJunctions2_Junctions2_1;
312

    
313

    
314
	(idJunctions2_Junctions2) 
315
	= (idJunctions2_Junctions2_1);
316
	
317

    
318
tel
319

    
320

    
321

    
322

    
323

    
324

    
325
-- Entry action for state :Junctions2_B
326
node Junctions2_B_en(idJunctions2_Junctions2_1:int;
327
	isInner:bool)
328

    
329
returns (idJunctions2_Junctions2:int);
330

    
331

    
332
var 	idJunctions2_Junctions2_2:int;
333

    
334

    
335
let
336

    
337

    
338

    
339
	-- set state as active 
340
	idJunctions2_Junctions2_2 
341
	= 1204;
342
	
343

    
344
	(idJunctions2_Junctions2) 
345
	= (idJunctions2_Junctions2_2);
346
	
347

    
348
tel
349

    
350

    
351

    
352

    
353

    
354
-- Exit action for state :Junctions2_B
355
node Junctions2_B_ex(idJunctions2_Junctions2_1:int;
356
	isInner:bool)
357

    
358
returns (idJunctions2_Junctions2:int);
359

    
360

    
361
var 	idJunctions2_Junctions2_2:int;
362

    
363

    
364
let
365

    
366

    
367

    
368
	-- set state as inactive 
369
	idJunctions2_Junctions2_2
370
	 = if (not isInner) then 0 else idJunctions2_Junctions2_1;
371

    
372

    
373
	(idJunctions2_Junctions2) 
374
	= (idJunctions2_Junctions2_1);
375
	
376

    
377
tel
378

    
379

    
380
--***************************************************State :Junctions2_Junctions2 Automaton***************************************************
381

    
382
node Junctions2_Junctions2_node(idJunctions2_Junctions2_1:int;
383
	x:int;
384
	y_1:int)
385

    
386
returns (idJunctions2_Junctions2:int;
387
	y:int);
388

    
389

    
390
let
391

    
392
	 automaton junctions2_junctions2
393

    
394
	state POINTJunctions2_Junctions2:
395
	unless (idJunctions2_Junctions2_1=0) restart POINT__TO__JUNCTIONS2_A_1
396

    
397

    
398

    
399
	unless (idJunctions2_Junctions2_1=1203) and ( x>0 ) restart JUNCTIONS2_A__TO__JUNCTIONS2_JUNCTIONS2JUNCTION1209_1
400

    
401

    
402

    
403
	unless (idJunctions2_Junctions2_1=1204) and ( x=0 ) restart JUNCTIONS2_B__TO__JUNCTIONS2_C_1
404

    
405

    
406

    
407
	unless (idJunctions2_Junctions2_1=1205) and ( x=0 ) restart JUNCTIONS2_C__TO__JUNCTIONS2_D_1
408

    
409

    
410

    
411
	unless (idJunctions2_Junctions2_1=1206) and ( x=0 ) restart JUNCTIONS2_D__TO__JUNCTIONS2_A_1
412

    
413

    
414

    
415
	unless (idJunctions2_Junctions2_1=1203) restart JUNCTIONS2_A_IDL
416

    
417
	unless (idJunctions2_Junctions2_1=1204) restart JUNCTIONS2_B_IDL
418

    
419
	unless (idJunctions2_Junctions2_1=1205) restart JUNCTIONS2_C_IDL
420

    
421
	unless (idJunctions2_Junctions2_1=1206) restart JUNCTIONS2_D_IDL
422

    
423
	let
424

    
425
		(idJunctions2_Junctions2, y) 
426
	= (idJunctions2_Junctions2_1, y_1);
427
	
428

    
429
	tel
430

    
431

    
432

    
433
	state POINT__TO__JUNCTIONS2_A_1:
434

    
435
	 var 	idJunctions2_Junctions2_2:int;
436
	let
437

    
438
		-- transition trace :
439
	--POINT__To__Junctions2_A_1
440
		(idJunctions2_Junctions2_2) 
441
	= Junctions2_A_en(idJunctions2_Junctions2_1, false);
442
		
443

    
444
	(idJunctions2_Junctions2) 
445
	=  (idJunctions2_Junctions2_2);
446

    
447
	--add unused variables
448
	(y) 
449
	= (y_1);
450
	
451

    
452
	tel
453

    
454
	until true restart POINTJunctions2_Junctions2
455

    
456

    
457

    
458
	state JUNCTIONS2_A__TO__JUNCTIONS2_JUNCTIONS2JUNCTION1209_1:
459

    
460
	 var 	idJunctions2_Junctions2_2, idJunctions2_Junctions2_3, idJunctions2_Junctions2_4, idJunctions2_Junctions2_5, idJunctions2_Junctions2_6, idJunctions2_Junctions2_7:int;
461
	y_2, y_3, y_4, y_5, y_6, y_7, y_8, y_9:int;
462
	let
463

    
464
		
465

    
466

    
467

    
468
-- transition trace :
469
	--Junctions2_A__To__Junction1209_1, Junction1209__To__Junction1210_1, Junction1210__To__Junctions2_D_1
470
		-- condition Action : y++
471
		
472
		(y_2) 
473
	= Junctions2_A__To__Junctions2_Junctions2Junction1209_1_Condition_Action(y_1);
474
		
475

    
476
		-- condition Action : y+=100
477
		
478
		(y_3) 
479
	= 
480
		 if (( x>=2 )) then 
481
		Junctions2_Junctions2Junction1209__To__Junctions2_Junctions2Junction1210_1_Condition_Action(y_2)
482
		 else (y_2);
483
		
484

    
485
		-- condition Action : y+=10000
486
		
487
		(y_4) 
488
	= 
489
		 if (( x>=2 ) and ( x>=4 )) then 
490
		Junctions2_Junctions2Junction1210__To__Junctions2_D_1_Condition_Action(y_3)
491
		 else (y_3);
492
		
493

    
494
		(idJunctions2_Junctions2_2) 
495
	= 
496
		 if (( x>=2 ) and ( x>=4 )) then 
497
		Junctions2_A_ex(idJunctions2_Junctions2_1, false)
498
		 else (idJunctions2_Junctions2_1);
499
		
500

    
501
		(idJunctions2_Junctions2_3) 
502
	= 
503
		 if (( x>=2 ) and ( x>=4 )) then 
504
		Junctions2_D_en(idJunctions2_Junctions2_2, false)
505
		 else (idJunctions2_Junctions2_2);
506
		
507

    
508

    
509
-- transition trace :
510
	--Junctions2_A__To__Junction1209_1, Junction1209__To__Junction1210_1, Junction1210__To__Junctions2_C_2
511
		-- condition Action : y++
512
		
513
		(y_5) 
514
	= Junctions2_A__To__Junctions2_Junctions2Junction1209_1_Condition_Action(y_1);
515
		
516

    
517
		-- condition Action : y+=100
518
		
519
		(y_6) 
520
	= 
521
		 if (( x>=2 )) then 
522
		Junctions2_Junctions2Junction1209__To__Junctions2_Junctions2Junction1210_1_Condition_Action(y_5)
523
		 else (y_5);
524
		
525

    
526
		-- condition Action : y+=1000
527
		
528
		(y_7) 
529
	= 
530
		 if (( x>=2 ) and ( x<4 )) then 
531
		Junctions2_Junctions2Junction1210__To__Junctions2_C_2_Condition_Action(y_6)
532
		 else (y_6);
533
		
534

    
535
		(idJunctions2_Junctions2_4) 
536
	= 
537
		 if (( x>=2 ) and ( x<4 )) then 
538
		Junctions2_A_ex(idJunctions2_Junctions2_1, false)
539
		 else (idJunctions2_Junctions2_1);
540
		
541

    
542
		(idJunctions2_Junctions2_5) 
543
	= 
544
		 if (( x>=2 ) and ( x<4 )) then 
545
		Junctions2_C_en(idJunctions2_Junctions2_4, false)
546
		 else (idJunctions2_Junctions2_4);
547
		
548

    
549

    
550
-- transition trace :
551
	--Junctions2_A__To__Junction1209_1, Junction1209__To__Junctions2_B_2
552
		-- condition Action : y++
553
		
554
		(y_8) 
555
	= Junctions2_A__To__Junctions2_Junctions2Junction1209_1_Condition_Action(y_1);
556
		
557

    
558
		-- condition Action : y+=10
559
		
560
		(y_9) 
561
	= 
562
		 if (( x<2 )) then 
563
		Junctions2_Junctions2Junction1209__To__Junctions2_B_2_Condition_Action(y_8)
564
		 else (y_8);
565
		
566

    
567
		(idJunctions2_Junctions2_6) 
568
	= 
569
		 if (( x<2 )) then 
570
		Junctions2_A_ex(idJunctions2_Junctions2_1, false)
571
		 else (idJunctions2_Junctions2_1);
572
		
573

    
574
		(idJunctions2_Junctions2_7) 
575
	= 
576
		 if (( x<2 )) then 
577
		Junctions2_B_en(idJunctions2_Junctions2_6, false)
578
		 else (idJunctions2_Junctions2_6);
579
		
580

    
581
	(idJunctions2_Junctions2, y) 
582
	= 
583
		 if (( x>=2 ) and ( x>=4 )) then 
584
		(idJunctions2_Junctions2_3, y_4)
585
		 else
586
		 if (( x>=2 ) and ( x<4 )) then 
587
		(idJunctions2_Junctions2_5, y_7)
588
		 else
589
		 if (( x>=2 )) then 
590
		(idJunctions2_Junctions2_1, y_6)
591
		 else
592
		 if (( x<2 )) then 
593
		(idJunctions2_Junctions2_7, y_9)
594
		 else (idJunctions2_Junctions2_1, y_8);
595

    
596

    
597
	tel
598

    
599
	until true restart POINTJunctions2_Junctions2
600

    
601

    
602

    
603
	state JUNCTIONS2_B__TO__JUNCTIONS2_C_1:
604

    
605
	 var 	idJunctions2_Junctions2_2, idJunctions2_Junctions2_3:int;
606
	let
607

    
608
		-- transition trace :
609
	--Junctions2_B__To__Junctions2_C_1
610
		(idJunctions2_Junctions2_2) 
611
	= Junctions2_B_ex(idJunctions2_Junctions2_1, false);
612
		
613

    
614
		(idJunctions2_Junctions2_3) 
615
	= Junctions2_C_en(idJunctions2_Junctions2_2, false);
616
		
617

    
618
	(idJunctions2_Junctions2, y) 
619
	=  (idJunctions2_Junctions2_3, y_1);
620

    
621

    
622
	tel
623

    
624
	until true restart POINTJunctions2_Junctions2
625

    
626

    
627

    
628
	state JUNCTIONS2_C__TO__JUNCTIONS2_D_1:
629

    
630
	 var 	idJunctions2_Junctions2_2, idJunctions2_Junctions2_3:int;
631
	let
632

    
633
		-- transition trace :
634
	--Junctions2_C__To__Junctions2_D_1
635
		(idJunctions2_Junctions2_2) 
636
	= Junctions2_C_ex(idJunctions2_Junctions2_1, false);
637
		
638

    
639
		(idJunctions2_Junctions2_3) 
640
	= Junctions2_D_en(idJunctions2_Junctions2_2, false);
641
		
642

    
643
	(idJunctions2_Junctions2, y) 
644
	=  (idJunctions2_Junctions2_3, y_1);
645

    
646

    
647
	tel
648

    
649
	until true restart POINTJunctions2_Junctions2
650

    
651

    
652

    
653
	state JUNCTIONS2_D__TO__JUNCTIONS2_A_1:
654

    
655
	 var 	idJunctions2_Junctions2_2, idJunctions2_Junctions2_3:int;
656
	let
657

    
658
		-- transition trace :
659
	--Junctions2_D__To__Junctions2_A_1
660
		(idJunctions2_Junctions2_2) 
661
	= Junctions2_D_ex(idJunctions2_Junctions2_1, false);
662
		
663

    
664
		(idJunctions2_Junctions2_3) 
665
	= Junctions2_A_en(idJunctions2_Junctions2_2, false);
666
		
667

    
668
	(idJunctions2_Junctions2, y) 
669
	=  (idJunctions2_Junctions2_3, y_1);
670

    
671

    
672
	tel
673

    
674
	until true restart POINTJunctions2_Junctions2
675

    
676

    
677

    
678
	state JUNCTIONS2_A_IDL:
679

    
680
	 	let
681

    
682
		
683

    
684
	(idJunctions2_Junctions2, y) 
685
	= (idJunctions2_Junctions2_1, y_1);
686
	
687

    
688
	tel
689

    
690
	until true restart POINTJunctions2_Junctions2
691

    
692

    
693

    
694
	state JUNCTIONS2_B_IDL:
695

    
696
	 	let
697

    
698
		
699

    
700
	(idJunctions2_Junctions2, y) 
701
	= (idJunctions2_Junctions2_1, y_1);
702
	
703

    
704
	tel
705

    
706
	until true restart POINTJunctions2_Junctions2
707

    
708

    
709

    
710
	state JUNCTIONS2_C_IDL:
711

    
712
	 	let
713

    
714
		
715

    
716
	(idJunctions2_Junctions2, y) 
717
	= (idJunctions2_Junctions2_1, y_1);
718
	
719

    
720
	tel
721

    
722
	until true restart POINTJunctions2_Junctions2
723

    
724

    
725

    
726
	state JUNCTIONS2_D_IDL:
727

    
728
	 	let
729

    
730
		
731

    
732
	(idJunctions2_Junctions2, y) 
733
	= (idJunctions2_Junctions2_1, y_1);
734
	
735

    
736
	tel
737

    
738
	until true restart POINTJunctions2_Junctions2
739

    
740

    
741

    
742
tel
743

    
744

    
745
--***************************************************State :Junctions2_Junctions2 Automaton***************************************************
746

    
747
node Junctions2_Junctions2(x:int)
748

    
749
returns (y:int);
750

    
751

    
752
var y_1: int;
753

    
754
	idJunctions2_Junctions2, idJunctions2_Junctions2_1: int;
755

    
756
	let
757

    
758
	y_1 = 11111 -> pre y;
759

    
760
	idJunctions2_Junctions2_1 = 0 -> pre idJunctions2_Junctions2;
761

    
762
	
763

    
764

    
765

    
766
	(idJunctions2_Junctions2, y)
767
	 = Junctions2_Junctions2_node(idJunctions2_Junctions2_1, x, y_1);
768

    
769

    
770
--unused outputs
771
	
772

    
773
tel
774

    
775

    
776

    
777
node Junctions2 (In1_1_1 : int)
778
returns (y_1_1 : int); 
779
var
780
	Junctions2_1_1 : int;
781
	i_virtual_local : real;
782
let 
783
	Junctions2_1_1 =  Junctions2_Junctions2(In1_1_1);
784
	y_1_1 = Junctions2_1_1;
785
	i_virtual_local= 0.0 -> 1.0;
786
tel
787