Project

General

Profile

Download (7.54 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:35:16
5
(*
6
Original block name: enable_test2_PP/Subsystem0
7
*)
8
node  Subsystem0_90_482_automaton(In1_1 : real;
9
	_isEnabled : bool;
10
	_isTriggered : bool;
11
	__time_step : real;
12
	__nb_step : int;)
13
returns(Out1_1 : real;);
14
var pre_Out1_1 : real;
15
let
16
	pre_Out1_1 = if (__nb_step > 0) then
17
		(pre Out1_1)
18
	    else 0.000000000000000;
19
	automaton enabled_Subsystem0_90_482
20
	state Active_Subsystem0_90_482:
21
	unless (not _isEnabled) restart Inactive_Subsystem0_90_482
22
	let
23
		automaton triggered_Subsystem0_90_482
24
	state Active_triggered_Subsystem0_90_482:
25
	unless (not _isTriggered) resume Inactive_triggered_Subsystem0_90_482
26
	let
27
		Out1_1 = Subsystem0_90_482(In1_1, __time_step, __nb_step);
28
	tel
29

    
30
	state Inactive_triggered_Subsystem0_90_482:
31
	unless _isTriggered resume Active_triggered_Subsystem0_90_482
32
	let
33
		Out1_1 = pre_Out1_1;
34
	tel
35

    
36

    
37
	tel
38

    
39
	state Inactive_Subsystem0_90_482:
40
	unless _isEnabled resume Active_Subsystem0_90_482
41
	let
42
		Out1_1 = pre_Out1_1;
43
	tel
44

    
45

    
46
tel
47

    
48
(*
49
Original block name: enable_test2_PP/Subsystem0
50
*)
51
node  Subsystem0_90_482(In1_1 : real;
52
	__time_step : real;
53
	__nb_step : int;)
54
returns(Out1_1 : real;);
55
let
56
	Out1_1 = In1_1;
57
tel
58

    
59
(*
60
Original block name: enable_test2_PP/Subsystem1/CompareToZero
61
*)
62
node  CompareToZero_101_043(u_1 : real;
63
	__time_step : real;
64
	__nb_step : int;)
65
returns(y_1 : bool;);
66
var Compare_1 : bool;
67
	Constant_1 : real;
68
let
69
	Compare_1 = (u_1 <= Constant_1);
70
	Constant_1 = 0.000000000000000;
71
	y_1 = Compare_1;
72
tel
73

    
74
(*
75
Original block name: enable_test2_PP/Subsystem1
76
*)
77
node  Subsystem1_96_047_automaton(In1_1 : real;
78
	Enable_1 : bool;
79
	Trigger_1 : real;
80
	_isEnabled : bool;
81
	_isTriggered : bool;
82
	__time_step : real;
83
	__nb_step : int;)
84
returns(Out1_1 : bool;
85
	Out2_1 : real;);
86
var pre_Out1_1 : bool;
87
	pre_Out2_1 : real;
88
let
89
	pre_Out1_1 = if (__nb_step > 0) then
90
		(pre Out1_1)
91
	    else false;
92
	pre_Out2_1 = if (__nb_step > 0) then
93
		(pre Out2_1)
94
	    else 0.000000000000000;
95
	automaton enabled_Subsystem1_96_047
96
	state Active_Subsystem1_96_047:
97
	unless (not _isEnabled) restart Inactive_Subsystem1_96_047
98
	let
99
		automaton triggered_Subsystem1_96_047
100
	state Active_triggered_Subsystem1_96_047:
101
	unless (not _isTriggered) resume Inactive_triggered_Subsystem1_96_047
102
	let
103
		(Out1_1, Out2_1) = Subsystem1_96_047(In1_1, Enable_1, Trigger_1, __time_step, __nb_step);
104
	tel
105

    
106
	state Inactive_triggered_Subsystem1_96_047:
107
	unless _isTriggered resume Active_triggered_Subsystem1_96_047
108
	let
109
		Out1_1 = pre_Out1_1;
110
		Out2_1 = pre_Out2_1;
111
	tel
112

    
113

    
114
	tel
115

    
116
	state Inactive_Subsystem1_96_047:
117
	unless _isEnabled resume Active_Subsystem1_96_047
118
	let
119
		Out1_1 = pre_Out1_1;
120
		Out2_1 = pre_Out2_1;
121
	tel
122

    
123

    
124
tel
125

    
126
(*
127
Original block name: enable_test2_PP/Subsystem1
128
*)
129
node  Subsystem1_96_047(In1_1 : real;
130
	Enable_1 : bool;
131
	Trigger_1 : real;
132
	__time_step : real;
133
	__nb_step : int;)
134
returns(Out1_1 : bool;
135
	Out2_1 : real;);
136
var Add_1 : real;
137
	CompareToZero_1 : bool;
138
	LogicalOperator_1 : bool;
139
let
140
	Add_1 = 0.0 + Trigger_1 + In1_1;
141
	CompareToZero_1 = CompareToZero_101_043(Add_1, __time_step, __nb_step);
142
	LogicalOperator_1 = ( CompareToZero_1 and Enable_1 );
143
	Out1_1 = LogicalOperator_1;
144
	Out2_1 = Add_1;
145
tel
146

    
147
(*
148
Original block name: enable_test2_PP/Subsystem2/CompareToZero
149
*)
150
node  CompareToZero_120_052(u_1 : real;
151
	__time_step : real;
152
	__nb_step : int;)
153
returns(y_1 : bool;);
154
var Compare_1 : bool;
155
	Constant_1 : real;
156
let
157
	Compare_1 = (u_1 <= Constant_1);
158
	Constant_1 = 0.000000000000000;
159
	y_1 = Compare_1;
160
tel
161

    
162
(*
163
Original block name: enable_test2_PP/Subsystem2
164
*)
165
node  Subsystem2_115_506_automaton(In1_1 : real;
166
	Enable_1 : bool;
167
	Trigger_1 : real;
168
	_isEnabled : bool;
169
	_isTriggered : bool;
170
	__time_step : real;
171
	__nb_step : int;)
172
returns(Out1_1 : bool;
173
	Out2_1 : real;);
174
var pre_Out1_1 : bool;
175
	pre_Out2_1 : real;
176
let
177
	pre_Out1_1 = if (__nb_step > 0) then
178
		(pre Out1_1)
179
	    else false;
180
	pre_Out2_1 = if (__nb_step > 0) then
181
		(pre Out2_1)
182
	    else 0.000000000000000;
183
	automaton enabled_Subsystem2_115_506
184
	state Active_Subsystem2_115_506:
185
	unless (not _isEnabled) restart Inactive_Subsystem2_115_506
186
	let
187
		automaton triggered_Subsystem2_115_506
188
	state Active_triggered_Subsystem2_115_506:
189
	unless (not _isTriggered) resume Inactive_triggered_Subsystem2_115_506
190
	let
191
		(Out1_1, Out2_1) = Subsystem2_115_506(In1_1, Enable_1, Trigger_1, __time_step, __nb_step);
192
	tel
193

    
194
	state Inactive_triggered_Subsystem2_115_506:
195
	unless _isTriggered resume Active_triggered_Subsystem2_115_506
196
	let
197
		Out1_1 = pre_Out1_1;
198
		Out2_1 = pre_Out2_1;
199
	tel
200

    
201

    
202
	tel
203

    
204
	state Inactive_Subsystem2_115_506:
205
	unless _isEnabled restart Active_Subsystem2_115_506
206
	let
207
		Out1_1 = pre_Out1_1;
208
		Out2_1 = pre_Out2_1;
209
	tel
210

    
211

    
212
tel
213

    
214
(*
215
Original block name: enable_test2_PP/Subsystem2
216
*)
217
node  Subsystem2_115_506(In1_1 : real;
218
	Enable_1 : bool;
219
	Trigger_1 : real;
220
	__time_step : real;
221
	__nb_step : int;)
222
returns(Out1_1 : bool;
223
	Out2_1 : real;);
224
var Add_1 : real;
225
	CompareToZero_1 : bool;
226
	LogicalOperator_1 : bool;
227
let
228
	Add_1 = 0.0 + Trigger_1 + In1_1;
229
	CompareToZero_1 = CompareToZero_120_052(Add_1, __time_step, __nb_step);
230
	LogicalOperator_1 = ( CompareToZero_1 and Enable_1 );
231
	Out1_1 = LogicalOperator_1;
232
	Out2_1 = Add_1;
233
tel
234

    
235
(*
236
Original block name: enable_test2_PP
237
*)
238
node  enable_test2_PP(in1_1 : real;
239
	in2_1 : real;
240
	in3_1 : bool;)
241
returns(Out1_1 : real;
242
	Out2_1 : bool;
243
	Out3_1 : real;
244
	Out4_1 : bool;
245
	Out5_1 : real;);
246
var ExecutionCond_of_Subsystem0_90_482 : bool;
247
	TriggerCond_of_Subsystem0_90_482 : bool;
248
	EnableCond_of_Subsystem0_90_482 : bool;
249
	Subsystem0_1 : real;
250
	ExecutionCond_of_Subsystem1_96_047 : bool;
251
	TriggerCond_of_Subsystem1_96_047 : bool;
252
	EnableCond_of_Subsystem1_96_047 : bool;
253
	Subsystem1_1 : bool;
254
	Subsystem1_2 : real;
255
	ExecutionCond_of_Subsystem2_115_506 : bool;
256
	TriggerCond_of_Subsystem2_115_506 : bool;
257
	EnableCond_of_Subsystem2_115_506 : bool;
258
	Subsystem2_1 : bool;
259
	Subsystem2_2 : real;
260
	__time_step : real;
261
	__nb_step : int;
262
let
263
	EnableCond_of_Subsystem0_90_482 = in3_1;
264
	TriggerCond_of_Subsystem0_90_482 = (false -> ((not in3_1) and (pre in3_1)));
265
	ExecutionCond_of_Subsystem0_90_482 = (EnableCond_of_Subsystem0_90_482 and TriggerCond_of_Subsystem0_90_482);
266
	Subsystem0_1 = Subsystem0_90_482_automaton(in2_1, EnableCond_of_Subsystem0_90_482, TriggerCond_of_Subsystem0_90_482, __time_step, __nb_step);
267
	EnableCond_of_Subsystem1_96_047 = in3_1;
268
	TriggerCond_of_Subsystem1_96_047 = (false -> ((in3_1 and (not (pre in3_1))) or ((not in3_1) and (pre in3_1))));
269
	ExecutionCond_of_Subsystem1_96_047 = (EnableCond_of_Subsystem1_96_047 and TriggerCond_of_Subsystem1_96_047);
270
	(Subsystem1_1, Subsystem1_2) = Subsystem1_96_047_automaton(in1_1, in3_1, (0.0 -> if TriggerCond_of_Subsystem1_96_047 then
271
		if (false -> (in3_1 and (not (pre in3_1)))) then
272
		1.0
273
	    else (- 1.0)
274
	    else 0.0), EnableCond_of_Subsystem1_96_047, TriggerCond_of_Subsystem1_96_047, __time_step, __nb_step);
275
	EnableCond_of_Subsystem2_115_506 = in3_1;
276
	TriggerCond_of_Subsystem2_115_506 = (false -> ((in3_1 and (not (pre in3_1))) or ((not in3_1) and (pre in3_1))));
277
	ExecutionCond_of_Subsystem2_115_506 = (EnableCond_of_Subsystem2_115_506 and TriggerCond_of_Subsystem2_115_506);
278
	(Subsystem2_1, Subsystem2_2) = Subsystem2_115_506_automaton(in1_1, in3_1, (0.0 -> if TriggerCond_of_Subsystem2_115_506 then
279
		if (false -> (in3_1 and (not (pre in3_1)))) then
280
		1.0
281
	    else (- 1.0)
282
	    else 0.0), EnableCond_of_Subsystem2_115_506, TriggerCond_of_Subsystem2_115_506, __time_step, __nb_step);
283
	Out1_1 = Subsystem0_1;
284
	Out2_1 = Subsystem1_1;
285
	Out3_1 = Subsystem1_2;
286
	Out4_1 = Subsystem2_1;
287
	Out5_1 = Subsystem2_2;
288
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
289
	__nb_step = (0 -> ((pre __nb_step) + 1));
290
tel
291

    
(1054-1054/1153)