Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Flowchart3 / Flowchart3.lus @ eb639349

History | View | Annotate | Download (4.27 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node Flowchart3_A__To__Flowchart3_Flowchart3Junction791_1_Condition_Action(x_1:int)
10

    
11
returns (x:int);
12

    
13

    
14
var 	x_2:int;
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
-- Entry action for state :Flowchart3_A
37
node Flowchart3_A_en(idFlowchart3_A_1:int;
38
	idFlowchart3_Flowchart3_1:int;
39
	isInner:bool)
40

    
41
returns (idFlowchart3_A:int;
42
	idFlowchart3_Flowchart3:int);
43

    
44

    
45
var 	idFlowchart3_A_2:int;
46
	idFlowchart3_Flowchart3_2:int;
47

    
48

    
49
let
50

    
51

    
52

    
53
	-- set state as active 
54
	idFlowchart3_Flowchart3_2 
55
	= 790;
56
	
57

    
58
	-- case of state without states but contains transitions 
59
	idFlowchart3_A_2 
60
	= -1;
61
	
62

    
63
	(idFlowchart3_A, idFlowchart3_Flowchart3) 
64
	= (idFlowchart3_A_2, idFlowchart3_Flowchart3_2);
65
	
66

    
67
tel
68

    
69

    
70

    
71

    
72

    
73
-- Exit action for state :Flowchart3_A
74
node Flowchart3_A_ex(idFlowchart3_Flowchart3_1:int;
75
	isInner:bool)
76

    
77
returns (idFlowchart3_Flowchart3:int);
78

    
79

    
80
var 	idFlowchart3_Flowchart3_2:int;
81

    
82

    
83
let
84

    
85

    
86

    
87
	-- set state as inactive 
88
	idFlowchart3_Flowchart3_2
89
	 = if (not isInner) then 0 else idFlowchart3_Flowchart3_1;
90

    
91

    
92
	(idFlowchart3_Flowchart3) 
93
	= (idFlowchart3_Flowchart3_1);
94
	
95

    
96
tel
97

    
98

    
99

    
100

    
101

    
102
--During action for state :Flowchart3_A
103
node Flowchart3_A_du(x_1:int)
104

    
105
returns (x:int);
106

    
107

    
108

    
109

    
110
let
111

    
112

    
113

    
114
		 automaton flowchart3_a_INNER
115

    
116
	state POINTFlowchart3_A_INNER:
117
	unless true restart FLOWCHART3_A__TO__FLOWCHART3_FLOWCHART3JUNCTION791_1
118

    
119

    
120

    
121
	let
122

    
123
		(x) 
124
	= (x_1);
125
	
126

    
127
	tel
128

    
129

    
130

    
131
	state FLOWCHART3_A__TO__FLOWCHART3_FLOWCHART3JUNCTION791_1:
132

    
133
	 var 	x_2:int;
134
	let
135

    
136
		-- transition trace :
137
	--Flowchart3_A__To__Junction791_1
138
		-- condition Action : x++;
139
		
140
		(x_2) 
141
	= Flowchart3_A__To__Flowchart3_Flowchart3Junction791_1_Condition_Action(x_1);
142
		
143

    
144
	(x) 
145
	=  (x_2);
146

    
147

    
148
	tel
149

    
150
	until true restart POINTFlowchart3_A_INNER
151

    
152

    
153

    
154
tel
155

    
156

    
157
--***************************************************State :Flowchart3_A Automaton***************************************************
158

    
159
node Flowchart3_A_node(idFlowchart3_A_1:int)
160

    
161
returns (idFlowchart3_A:int);
162

    
163

    
164
let
165

    
166
	 automaton flowchart3_a
167

    
168
	state POINTFlowchart3_A:
169
	let
170

    
171
		(idFlowchart3_A) 
172
	= (idFlowchart3_A_1);
173
	
174

    
175
	tel
176

    
177

    
178

    
179
tel
180

    
181

    
182
--***************************************************State :Flowchart3_Flowchart3 Automaton***************************************************
183

    
184
node Flowchart3_Flowchart3_node(idFlowchart3_Flowchart3_1:int;
185
	idFlowchart3_A_1:int)
186

    
187
returns (idFlowchart3_Flowchart3:int;
188
	idFlowchart3_A:int);
189

    
190

    
191
let
192

    
193
	 automaton flowchart3_flowchart3
194

    
195
	state POINTFlowchart3_Flowchart3:
196
	unless (idFlowchart3_Flowchart3_1=0) restart POINT__TO__FLOWCHART3_A_1
197

    
198

    
199

    
200
	unless true  restart FLOWCHART3_FLOWCHART3_PARALLEL_IDL
201

    
202
	let
203

    
204
		(idFlowchart3_Flowchart3, idFlowchart3_A) 
205
	= (idFlowchart3_Flowchart3_1, idFlowchart3_A_1);
206
	
207

    
208
	tel
209

    
210

    
211

    
212
	state POINT__TO__FLOWCHART3_A_1:
213

    
214
	 var 	idFlowchart3_Flowchart3_2:int;
215
	idFlowchart3_A_2:int;
216
	let
217

    
218
		-- transition trace :
219
	--POINT__To__Flowchart3_A_1
220
		(idFlowchart3_A_2, idFlowchart3_Flowchart3_2) 
221
	= Flowchart3_A_en(idFlowchart3_A_1, idFlowchart3_Flowchart3_1, false);
222
		
223

    
224
	(idFlowchart3_Flowchart3, idFlowchart3_A) 
225
	=  (idFlowchart3_Flowchart3_2, idFlowchart3_A_2);
226

    
227

    
228
	tel
229

    
230
	until true restart POINTFlowchart3_Flowchart3
231

    
232

    
233

    
234
	state FLOWCHART3_FLOWCHART3_PARALLEL_IDL:
235

    
236
	 var 	idFlowchart3_A_2:int;
237
	let
238

    
239
		
240

    
241
		(idFlowchart3_A_2)
242
	= if not (idFlowchart3_A_1= 0 ) then Flowchart3_A_node(idFlowchart3_A_1)
243

    
244
		 else (idFlowchart3_A_1);
245

    
246
		
247

    
248
		
249

    
250
	(idFlowchart3_Flowchart3, idFlowchart3_A) 
251
	= (idFlowchart3_Flowchart3_1, idFlowchart3_A_2);
252
	
253

    
254
	tel
255

    
256
	until true restart POINTFlowchart3_Flowchart3
257

    
258

    
259

    
260
tel
261

    
262

    
263
--***************************************************State :Flowchart3_Flowchart3 Automaton***************************************************
264

    
265
node Flowchart3_Flowchart3(noInput :bool)
266

    
267
returns (x:int);
268

    
269

    
270
var x_1: int;
271

    
272
	idFlowchart3_Flowchart3, idFlowchart3_Flowchart3_1: int;
273

    
274
	idFlowchart3_A, idFlowchart3_A_1: int;
275

    
276
	let
277

    
278
	x_1 = 0 -> pre x;
279

    
280
	idFlowchart3_Flowchart3_1 = 0 -> pre idFlowchart3_Flowchart3;
281

    
282
	idFlowchart3_A_1 = 0 -> pre idFlowchart3_A;
283

    
284
	
285

    
286

    
287

    
288
	(idFlowchart3_Flowchart3, idFlowchart3_A)
289
	 = Flowchart3_Flowchart3_node(idFlowchart3_Flowchart3_1, idFlowchart3_A_1);
290

    
291

    
292
--unused outputs
293
	x = 0;
294

    
295
	
296

    
297
tel
298

    
299

    
300

    
301
node Flowchart3 (i_virtual : real)
302
returns (Out1_1_1 : int); 
303
var
304
	Flowchart3_1_1 : int;
305
	i_virtual_local : real;
306
let 
307
	Flowchart3_1_1 =  Flowchart3_Flowchart3(true);
308
	Out1_1_1 = Flowchart3_1_1;
309
	i_virtual_local= 0.0 -> 1.0;
310
tel
311