Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Junctions7 / Junctions7.lus @ eb639349

History | View | Annotate | Download (5.74 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node Junctions7_A__To__Junctions7_Junctions7Junction1322_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  + 1;
23
	
24

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

    
29
tel
30

    
31

    
32

    
33

    
34

    
35

    
36

    
37

    
38
node Junctions7_A__To__Junctions7_Junctions7Junction1322_2_Condition_Action(y_1:int)
39

    
40
returns (y:int);
41

    
42

    
43
var 	y_2:int;
44

    
45

    
46
let
47

    
48

    
49

    
50
	y_2 
51
	=  y_1  - 1;
52
	
53

    
54
	(y) 
55
	= (y_2);
56
	
57

    
58
tel
59

    
60

    
61

    
62

    
63

    
64

    
65
-- Entry action for state :Junctions7_B
66
node Junctions7_B_en(idJunctions7_Junctions7_1:int;
67
	isInner:bool)
68

    
69
returns (idJunctions7_Junctions7:int);
70

    
71

    
72
var 	idJunctions7_Junctions7_2:int;
73

    
74

    
75
let
76

    
77

    
78

    
79
	-- set state as active 
80
	idJunctions7_Junctions7_2 
81
	= 1319;
82
	
83

    
84
	(idJunctions7_Junctions7) 
85
	= (idJunctions7_Junctions7_2);
86
	
87

    
88
tel
89

    
90

    
91

    
92

    
93

    
94
-- Exit action for state :Junctions7_B
95
node Junctions7_B_ex(idJunctions7_Junctions7_1:int;
96
	isInner:bool)
97

    
98
returns (idJunctions7_Junctions7:int);
99

    
100

    
101
var 	idJunctions7_Junctions7_2:int;
102

    
103

    
104
let
105

    
106

    
107

    
108
	-- set state as inactive 
109
	idJunctions7_Junctions7_2
110
	 = if (not isInner) then 0 else idJunctions7_Junctions7_1;
111

    
112

    
113
	(idJunctions7_Junctions7) 
114
	= (idJunctions7_Junctions7_1);
115
	
116

    
117
tel
118

    
119

    
120

    
121

    
122

    
123

    
124
-- Entry action for state :Junctions7_A
125
node Junctions7_A_en(idJunctions7_Junctions7_1:int;
126
	isInner:bool)
127

    
128
returns (idJunctions7_Junctions7:int);
129

    
130

    
131
var 	idJunctions7_Junctions7_2:int;
132

    
133

    
134
let
135

    
136

    
137

    
138
	-- set state as active 
139
	idJunctions7_Junctions7_2 
140
	= 1318;
141
	
142

    
143
	(idJunctions7_Junctions7) 
144
	= (idJunctions7_Junctions7_2);
145
	
146

    
147
tel
148

    
149

    
150

    
151

    
152

    
153
-- Exit action for state :Junctions7_A
154
node Junctions7_A_ex(idJunctions7_Junctions7_1:int;
155
	isInner:bool)
156

    
157
returns (idJunctions7_Junctions7:int);
158

    
159

    
160
var 	idJunctions7_Junctions7_2:int;
161

    
162

    
163
let
164

    
165

    
166

    
167
	-- set state as inactive 
168
	idJunctions7_Junctions7_2
169
	 = if (not isInner) then 0 else idJunctions7_Junctions7_1;
170

    
171

    
172
	(idJunctions7_Junctions7) 
173
	= (idJunctions7_Junctions7_1);
174
	
175

    
176
tel
177

    
178

    
179
--***************************************************State :Junctions7_Junctions7 Automaton***************************************************
180

    
181
node Junctions7_Junctions7_node(idJunctions7_Junctions7_1:int;
182
	x:int;
183
	y_1:int)
184

    
185
returns (idJunctions7_Junctions7:int;
186
	y:int);
187

    
188

    
189
let
190

    
191
	 automaton junctions7_junctions7
192

    
193
	state POINTJunctions7_Junctions7:
194
	unless (idJunctions7_Junctions7_1=0) restart POINT__TO__JUNCTIONS7_A_1
195

    
196

    
197

    
198
	unless (idJunctions7_Junctions7_1=1318) and ( x!=0 ) restart JUNCTIONS7_A__TO__JUNCTIONS7_JUNCTIONS7JUNCTION1322_1
199

    
200

    
201

    
202
	unless (idJunctions7_Junctions7_1=1318) and ( x=0 ) restart JUNCTIONS7_A__TO__JUNCTIONS7_JUNCTIONS7JUNCTION1322_2
203

    
204

    
205

    
206
	unless (idJunctions7_Junctions7_1=1318) restart JUNCTIONS7_A_IDL
207

    
208
	unless (idJunctions7_Junctions7_1=1319) restart JUNCTIONS7_B_IDL
209

    
210
	let
211

    
212
		(idJunctions7_Junctions7, y) 
213
	= (idJunctions7_Junctions7_1, y_1);
214
	
215

    
216
	tel
217

    
218

    
219

    
220
	state POINT__TO__JUNCTIONS7_A_1:
221

    
222
	 var 	idJunctions7_Junctions7_2:int;
223
	let
224

    
225
		-- transition trace :
226
	--POINT__To__Junctions7_A_1
227
		(idJunctions7_Junctions7_2) 
228
	= Junctions7_A_en(idJunctions7_Junctions7_1, false);
229
		
230

    
231
	(idJunctions7_Junctions7) 
232
	=  (idJunctions7_Junctions7_2);
233

    
234
	--add unused variables
235
	(y) 
236
	= (y_1);
237
	
238

    
239
	tel
240

    
241
	until true restart POINTJunctions7_Junctions7
242

    
243

    
244

    
245
	state JUNCTIONS7_A__TO__JUNCTIONS7_JUNCTIONS7JUNCTION1322_1:
246

    
247
	 var 	idJunctions7_Junctions7_2, idJunctions7_Junctions7_3:int;
248
	y_2:int;
249
	let
250

    
251
		
252

    
253
-- transition trace :
254
	--Junctions7_A__To__Junction1322_1, Junction1322__To__Junctions7_B_1
255
		-- condition Action : y++
256
		
257
		(y_2) 
258
	= Junctions7_A__To__Junctions7_Junctions7Junction1322_1_Condition_Action(y_1);
259
		
260

    
261
		(idJunctions7_Junctions7_2) 
262
	= 
263
		 if (( x<2 )) then 
264
		Junctions7_A_ex(idJunctions7_Junctions7_1, false)
265
		 else (idJunctions7_Junctions7_1);
266
		
267

    
268
		(idJunctions7_Junctions7_3) 
269
	= 
270
		 if (( x<2 )) then 
271
		Junctions7_B_en(idJunctions7_Junctions7_2, false)
272
		 else (idJunctions7_Junctions7_2);
273
		
274

    
275
	(idJunctions7_Junctions7, y) 
276
	= 
277
		 if (( x<2 )) then 
278
		(idJunctions7_Junctions7_3, y_2)
279
		 else (idJunctions7_Junctions7_1, y_2);
280

    
281

    
282
	tel
283

    
284
	until true restart POINTJunctions7_Junctions7
285

    
286

    
287

    
288
	state JUNCTIONS7_A__TO__JUNCTIONS7_JUNCTIONS7JUNCTION1322_2:
289

    
290
	 var 	idJunctions7_Junctions7_2, idJunctions7_Junctions7_3:int;
291
	y_2:int;
292
	let
293

    
294
		
295

    
296
-- transition trace :
297
	--Junctions7_A__To__Junction1322_2, Junction1322__To__Junctions7_B_1
298
		-- condition Action : y--
299
		
300
		(y_2) 
301
	= Junctions7_A__To__Junctions7_Junctions7Junction1322_2_Condition_Action(y_1);
302
		
303

    
304
		(idJunctions7_Junctions7_2) 
305
	= 
306
		 if (( x<2 )) then 
307
		Junctions7_A_ex(idJunctions7_Junctions7_1, false)
308
		 else (idJunctions7_Junctions7_1);
309
		
310

    
311
		(idJunctions7_Junctions7_3) 
312
	= 
313
		 if (( x<2 )) then 
314
		Junctions7_B_en(idJunctions7_Junctions7_2, false)
315
		 else (idJunctions7_Junctions7_2);
316
		
317

    
318
	(idJunctions7_Junctions7, y) 
319
	= 
320
		 if (( x<2 )) then 
321
		(idJunctions7_Junctions7_3, y_2)
322
		 else (idJunctions7_Junctions7_1, y_2);
323

    
324

    
325
	tel
326

    
327
	until true restart POINTJunctions7_Junctions7
328

    
329

    
330

    
331
	state JUNCTIONS7_A_IDL:
332

    
333
	 	let
334

    
335
		
336

    
337
	(idJunctions7_Junctions7, y) 
338
	= (idJunctions7_Junctions7_1, y_1);
339
	
340

    
341
	tel
342

    
343
	until true restart POINTJunctions7_Junctions7
344

    
345

    
346

    
347
	state JUNCTIONS7_B_IDL:
348

    
349
	 	let
350

    
351
		
352

    
353
	(idJunctions7_Junctions7, y) 
354
	= (idJunctions7_Junctions7_1, y_1);
355
	
356

    
357
	tel
358

    
359
	until true restart POINTJunctions7_Junctions7
360

    
361

    
362

    
363
tel
364

    
365

    
366
--***************************************************State :Junctions7_Junctions7 Automaton***************************************************
367

    
368
node Junctions7_Junctions7(x:int)
369

    
370
returns (y:int);
371

    
372

    
373
var y_1: int;
374

    
375
	idJunctions7_Junctions7, idJunctions7_Junctions7_1: int;
376

    
377
	let
378

    
379
	y_1 = 0 -> pre y;
380

    
381
	idJunctions7_Junctions7_1 = 0 -> pre idJunctions7_Junctions7;
382

    
383
	
384

    
385

    
386

    
387
	(idJunctions7_Junctions7, y)
388
	 = Junctions7_Junctions7_node(idJunctions7_Junctions7_1, x, y_1);
389

    
390

    
391
--unused outputs
392
	
393

    
394
tel
395

    
396

    
397

    
398
node Junctions7 (x_1_1 : int)
399
returns (y_1_1 : int); 
400
var
401
	Junctions7_1_1 : int;
402
	i_virtual_local : real;
403
let 
404
	Junctions7_1_1 =  Junctions7_Junctions7(x_1_1);
405
	y_1_1 = Junctions7_1_1;
406
	i_virtual_local= 0.0 -> 1.0;
407
tel
408