Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Outer1 / Outer1.lus @ eb639349

History | View | Annotate | Download (4.02 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9

    
10
node Outer1_A__To__Outer1_A_1_Condition_Action(x_1:int)
11

    
12
returns (x:int);
13

    
14

    
15
var 	x_2:int;
16

    
17

    
18
let
19

    
20

    
21

    
22
	x_2 
23
	=  x_1  + 1;
24
	
25

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

    
30
tel
31

    
32

    
33

    
34

    
35

    
36
node Outer1_A__To__Outer1_A_1_Transition_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  + 1;
50
	
51

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

    
56
tel
57

    
58

    
59

    
60

    
61

    
62

    
63
-- Entry action for state :Outer1_A
64
node Outer1_A_en(idOuter1_Outer1_1:int;
65
	z_1:int;
66
	isInner:bool)
67

    
68
returns (idOuter1_Outer1:int;
69
	z:int);
70

    
71

    
72
var 	idOuter1_Outer1_2:int;
73
	z_2:int;
74

    
75

    
76
let
77

    
78

    
79

    
80
	-- set state as active 
81
	idOuter1_Outer1_2 
82
	= 1360;
83
	
84

    
85
	z_2 
86
	= if (not isInner) then  z_1  + 1
87
	 else z_1;
88
	
89

    
90
	(idOuter1_Outer1, z) 
91
	= (idOuter1_Outer1_2, z_2);
92
	
93

    
94
tel
95

    
96

    
97

    
98

    
99

    
100
-- Exit action for state :Outer1_A
101
node Outer1_A_ex(w_1:int;
102
	idOuter1_Outer1_1:int;
103
	isInner:bool)
104

    
105
returns (w:int;
106
	idOuter1_Outer1:int);
107

    
108

    
109
var 	w_2:int;
110
	idOuter1_Outer1_2:int;
111

    
112

    
113
let
114

    
115

    
116

    
117
	w_2 
118
	= if (not isInner) then  w_1  + 1
119
	 else w_1;
120
	
121

    
122
	-- set state as inactive 
123
	idOuter1_Outer1_2
124
	 = if (not isInner) then 0 else idOuter1_Outer1_1;
125

    
126

    
127
	(w, idOuter1_Outer1) 
128
	= (w_2, idOuter1_Outer1_1);
129
	
130

    
131
tel
132

    
133

    
134
--***************************************************State :Outer1_Outer1 Automaton***************************************************
135

    
136
node Outer1_Outer1_node(idOuter1_Outer1_1:int;
137
	z_1:int;
138
	E:bool;
139
	x_1:int;
140
	w_1:int;
141
	y_1:int)
142

    
143
returns (idOuter1_Outer1:int;
144
	z:int;
145
	x:int;
146
	w:int;
147
	y:int);
148

    
149

    
150
let
151

    
152
	 automaton outer1_outer1
153

    
154
	state POINTOuter1_Outer1:
155
	unless (idOuter1_Outer1_1=0) restart POINT__TO__OUTER1_A_1
156

    
157

    
158

    
159
	unless (idOuter1_Outer1_1=1360) and E restart OUTER1_A__TO__OUTER1_A_1
160

    
161

    
162

    
163
	unless (idOuter1_Outer1_1=1360) restart OUTER1_A_IDL
164

    
165
	let
166

    
167
		(idOuter1_Outer1, z, x, w, y) 
168
	= (idOuter1_Outer1_1, z_1, x_1, w_1, y_1);
169
	
170

    
171
	tel
172

    
173

    
174

    
175
	state POINT__TO__OUTER1_A_1:
176

    
177
	 var 	idOuter1_Outer1_2:int;
178
	z_2:int;
179
	let
180

    
181
		-- transition trace :
182
	--POINT__To__Outer1_A_1
183
		(idOuter1_Outer1_2, z_2) 
184
	= Outer1_A_en(idOuter1_Outer1_1, z_1, false);
185
		
186

    
187
	(idOuter1_Outer1, z) 
188
	=  (idOuter1_Outer1_2, z_2);
189

    
190
	--add unused variables
191
	(w, x, y) 
192
	= (w_1, x_1, y_1);
193
	
194

    
195
	tel
196

    
197
	until true restart POINTOuter1_Outer1
198

    
199

    
200

    
201
	state OUTER1_A__TO__OUTER1_A_1:
202

    
203
	 var 	idOuter1_Outer1_2, idOuter1_Outer1_3:int;
204
	z_2:int;
205
	x_2:int;
206
	w_2:int;
207
	y_2:int;
208
	let
209

    
210
		-- transition trace :
211
	--Outer1_A__To__Outer1_A_1
212
		-- condition Action : x++;
213
		
214
		(x_2) 
215
	= Outer1_A__To__Outer1_A_1_Condition_Action(x_1);
216
		
217

    
218
		(w_2, idOuter1_Outer1_2) 
219
	= Outer1_A_ex(w_1, idOuter1_Outer1_1, false);
220
		
221

    
222
		(y_2) 
223
	= Outer1_A__To__Outer1_A_1_Transition_Action(y_1);
224
		
225

    
226
		(idOuter1_Outer1_3, z_2) 
227
	= Outer1_A_en(idOuter1_Outer1_2, z_1, false);
228
		
229

    
230
	(idOuter1_Outer1, z, x, w, y) 
231
	=  (idOuter1_Outer1_3, z_2, x_2, w_2, y_2);
232

    
233

    
234
	tel
235

    
236
	until true restart POINTOuter1_Outer1
237

    
238

    
239

    
240
	state OUTER1_A_IDL:
241

    
242
	 	let
243

    
244
		
245

    
246
	(idOuter1_Outer1, z, x, w, y) 
247
	= (idOuter1_Outer1_1, z_1, x_1, w_1, y_1);
248
	
249

    
250
	tel
251

    
252
	until true restart POINTOuter1_Outer1
253

    
254

    
255

    
256
tel
257

    
258

    
259
--***************************************************State :Outer1_Outer1 Automaton***************************************************
260

    
261
node Outer1_Outer1(E:bool)
262

    
263
returns (w:int;
264
	x:int;
265
	z:int;
266
	y:int);
267

    
268

    
269
var w_1: int;
270

    
271
	x_1: int;
272

    
273
	z_1: int;
274

    
275
	y_1: int;
276

    
277
	idOuter1_Outer1, idOuter1_Outer1_1: int;
278

    
279
	let
280

    
281
	w_1 = 0 -> pre w;
282

    
283
	x_1 = 0 -> pre x;
284

    
285
	z_1 = 0 -> pre z;
286

    
287
	y_1 = 0 -> pre y;
288

    
289
	idOuter1_Outer1_1 = 0 -> pre idOuter1_Outer1;
290

    
291
	
292

    
293

    
294

    
295
	(idOuter1_Outer1, z, x, w, y)
296
	 = 
297

    
298
	 if E then Outer1_Outer1_node(idOuter1_Outer1_1, z_1, E, x_1, w_1, y_1)
299

    
300
	 else (idOuter1_Outer1_1, z_1, x_1, w_1, y_1);
301

    
302
	
303

    
304

    
305
--unused outputs
306
	
307

    
308
tel
309

    
310

    
311

    
312
node Outer1 (E_1_1 : real)
313
returns (w_1_1 : int;
314
	x_2_1 : int;
315
	z_3_1 : int;
316
	y_4_1 : int); 
317
var
318
	Outer1_1_1 : int; Outer1_2_1 : int; Outer1_3_1 : int; Outer1_4_1 : int;
319
	i_virtual_local : real;
320
	Outer1E_1_1_event: bool;
321
let 
322
	Outer1E_1_1_event = false -> ((pre(E_1_1) > 0.0 and E_1_1 <= 0.0) or (pre(E_1_1) <= 0.0 and E_1_1 > 0.0));
323
	(Outer1_1_1, Outer1_2_1, Outer1_3_1, Outer1_4_1) =  Outer1_Outer1(Outer1E_1_1_event);
324
	w_1_1 = Outer1_1_1;
325
	x_2_1 = Outer1_2_1;
326
	z_3_1 = Outer1_3_1;
327
	y_4_1 = Outer1_4_1;
328
	i_virtual_local= 0.0 -> 1.0;
329
tel
330