Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / Signum.LUSTREC.lus @ cd1faebc

History | View | Annotate | Download (1.48 KB)

1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:03:08
5
(*
6
Original block name: Signum
7
*)
8
node  Signum(x_1 : int;
9
	x_2 : int;
10
	x_3 : int;
11
	x1_1 : real;
12
	x1_2 : real;
13
	x1_3 : real;
14
	x2_1 : bool;
15
	x2_2 : bool;
16
	x2_3 : bool;)
17
returns(s_1 : int;
18
	s_2 : int;
19
	s_3 : int;
20
	s1_1 : real;
21
	s1_2 : real;
22
	s1_3 : real;
23
	s2_1 : int;
24
	s2_2 : int;
25
	s2_3 : int;);
26
var Sign_1 : int;
27
	Sign_2 : int;
28
	Sign_3 : int;
29
	Sign1_1 : real;
30
	Sign1_2 : real;
31
	Sign1_3 : real;
32
	Sign2_1 : int;
33
	Sign2_2 : int;
34
	Sign2_3 : int;
35
	__time_step : real;
36
	__nb_step : int;
37
let
38
	Sign_1 = if (x_1 > 0) then
39
		1
40
	    else if (x_1 < 0) then
41
		(- 1)
42
	    else 0;
43
	Sign_2 = if (x_2 > 0) then
44
		1
45
	    else if (x_2 < 0) then
46
		(- 1)
47
	    else 0;
48
	Sign_3 = if (x_3 > 0) then
49
		1
50
	    else if (x_3 < 0) then
51
		(- 1)
52
	    else 0;
53
	Sign1_1 = if (x1_1 > 0.0) then
54
		1.0
55
	    else if (x1_1 < 0.0) then
56
		(- 1.0)
57
	    else 0.0;
58
	Sign1_2 = if (x1_2 > 0.0) then
59
		1.0
60
	    else if (x1_2 < 0.0) then
61
		(- 1.0)
62
	    else 0.0;
63
	Sign1_3 = if (x1_3 > 0.0) then
64
		1.0
65
	    else if (x1_3 < 0.0) then
66
		(- 1.0)
67
	    else 0.0;
68
	Sign2_1 = if x2_1 then
69
		1
70
	    else 0;
71
	Sign2_2 = if x2_2 then
72
		1
73
	    else 0;
74
	Sign2_3 = if x2_3 then
75
		1
76
	    else 0;
77
	s_1 = Sign_1;
78
	s_2 = Sign_2;
79
	s_3 = Sign_3;
80
	s1_1 = Sign1_1;
81
	s1_2 = Sign1_2;
82
	s1_3 = Sign1_3;
83
	s2_1 = Sign2_1;
84
	s2_2 = Sign2_2;
85
	s2_3 = Sign2_3;
86
	__time_step = (0.0 -> ((pre __time_step) + 0.000000000000000));
87
	__nb_step = (0 -> ((pre __nb_step) + 1));
88
tel
89