Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lutin
Commits
4342b156
Commit
4342b156
authored
Jan 13, 2011
by
Erwan Jahier
Browse files
Merging Pascal and R1 branches.
parents
568eae01
6803cd52
Changes
48
Expand all
Hide whitespace changes
Inline
Side-by-side
GBDDML/gbdd_cml.cc
View file @
4342b156
...
...
@@ -316,6 +316,35 @@ CHECK_NOT_NULL(res);
CAMLreturn
(
res
);
}
value
gbdd_cml_constrain
(
value
b1
,
value
b2
){
CAMLparam2
(
b1
,
b2
);
CAMLlocal1
(
res
);
CHECK_NOT_NULL
(
b1
);
CHECK_NOT_NULL
(
b2
);
res
=
alloc_gdbb_block
();
#ifdef GBDD_CML_DBG
printf
(
"creating %lx = constrain %lx %lx
\n
"
,
res
,
b1
,
b2
);
#endif
set_gbdd_value
(
res
,
constrain
(
*
GBdd_value
(
b1
),
*
GBdd_value
(
b2
)));
CHECK_NOT_NULL
(
res
);
CAMLreturn
(
res
);
}
value
gbdd_cml_restrict
(
value
b1
,
value
b2
){
CAMLparam2
(
b1
,
b2
);
CAMLlocal1
(
res
);
CHECK_NOT_NULL
(
b1
);
CHECK_NOT_NULL
(
b2
);
res
=
alloc_gdbb_block
();
#ifdef GBDD_CML_DBG
printf
(
"creating %lx = restrict %lx %lx
\n
"
,
res
,
b1
,
b2
);
#endif
set_gbdd_value
(
res
,
restrict
(
*
GBdd_value
(
b1
),
*
GBdd_value
(
b2
)));
CHECK_NOT_NULL
(
res
);
CAMLreturn
(
res
);
}
value
gbdd_cml_xor
(
value
b1
,
value
b2
){
CAMLparam2
(
b1
,
b2
);
CAMLlocal1
(
res
);
...
...
Makefile.common.source
View file @
4342b156
...
...
@@ -230,8 +230,12 @@ LUTIN_FILES = \
$(OBJDIR)
/coTraceExp.mli
\
$(OBJDIR)
/expand.ml
\
$(OBJDIR)
/expand.mli
\
$(OBJDIR)
/guard.ml
\
$(OBJDIR)
/guard.mli
\
$(OBJDIR)
/autoExplore.ml
\
$(OBJDIR)
/autoExplore.mli
\
$(OBJDIR)
/autoGen.ml
\
$(OBJDIR)
/autoGen.mli
\
$(OBJDIR)
/auto2Lucky.ml
\
$(OBJDIR)
/auto2Lucky.mli
\
$(OBJDIR)
/lutProg.mli
\
...
...
examples/Makefile
View file @
4342b156
...
...
@@ -37,8 +37,9 @@ endif
test-lutin
:
cd
lutin/up_and_down
&&
make
test
;
cd
lutin/
xlurette
&&
make
test
;
cd
lutin/
test_ok
&&
make
test
;
cd
lutin/C
&&
make
test
;
cd
lutin/xlurette
&&
make
test
;
cd
lutin/ocaml
&&
make
test
;
cd
lutin/external_code
&&
make
test
;
cd
lutin/luciole
&&
make
test
;
...
...
@@ -46,6 +47,8 @@ test-lutin:
cd
lutin/test_ok
&&
make
test
;
echo
"All lutin tests ran correctly."
# problem ~
test
:
test-lucky test-lutin
examples/lutin/C/test.rif.exp
View file @
4342b156
...
...
@@ -4,20 +4,20 @@
# step 0
10 0 20.000000 #outs 6 0 16.278233
# step 1
10 0 20.000000 #outs
6
1
21.603283
10 0 20.000000 #outs
11
1
16.610070
# step 2
10 0 20.000000 #outs 9 1 17.399245
# step 3
10 0 20.000000 #outs
13
1
19.172617
10 0 20.000000 #outs
9
1
24.170976
# step 4
10 0 20.000000 #outs
11
0
19.251183
10 0 20.000000 #outs
8
0
24.249699
# step 5
10 0 20.000000 #outs 8 1 15.253516
# step 6
10 0 20.000000 #outs
7
0
2
1.425
417
10 0 20.000000 #outs
14
0 1
6
.4
3
25
61
# step 7
10 0 20.000000 #outs 9 1 17.336461
# step 8
10 0 20.000000 #outs 7 0 19.618259
# step 9
10 0 20.000000 #outs
14
0
16.016641
10 0 20.000000 #outs
7
0
21.008662
examples/lutin/lustre/test.rif.exp
View file @
4342b156
# Interpreting the lutin file foo.lut with node main
-1 true 7.188031
-2
true
10
.88
0835
0
true 9.91
6883
1 true
8
.88
9484
3
true 8.69
492
3
7
true 9.6
81718
3
true 1
2
.27
5496
6
true 8.4
23593
5
true 4.45
5
37
9
2
true
8
.27
4838
6
true 1
0
.19
3351
3
true
5
.88
3434
2
true 9.91
7567
1 true
13
.88
8125
0
true
1
8.69
319
3
4
true
1
9.6
79989
6
true 1
7
.27
8568
5
true
1
8.4
18950
4
true
1
4.45
07
37
7
true
13
.27
2541
11
true 1
5
.19
1055
examples/lutin/ocaml/call_foo.rif.exp
View file @
4342b156
...
...
@@ -3,200 +3,200 @@
#step 1
0 T 0.00 #outs 0 T 1.27
#step 2
0 F 1.27 #outs
-4
T 2.
87
0 F 1.27 #outs
1
T
-
2.
12
#step 3
-4
F 2.
87
#outs
-5
T
0.27
1
F
-
2.
12
#outs
0
T
-4.72
#step 4
-5
F
0.27
#outs -
2
T -0.55
0
F
-4.72
#outs -
1
T -0.55
#step 5
-
2
F -0.55 #outs -
1
F
-1.3
0
-
1
F -0.55 #outs -
3
F
3.7
0
#step 6
-
1
T
-1.3
0 #outs -
3
T -
6
.05
-
3
T
3.7
0 #outs -
5
T -
1
.05
#step 7
-
3
F -
6
.05 #outs -
6
F -4.6
2
-
5
F -
1
.05 #outs -
1
F -4.6
1
#step 8
-
6
T -4.6
2
#outs -2 T -
7
.2
9
-
1
T -4.6
1
#outs -2 T -
2
.2
8
#step 9
-2 F -
7
.2
9
#outs -5 F -
7
.6
7
-2 F -
2
.2
8
#outs -5 F -
2
.6
6
#step 10
-5 T -
7
.6
7
#outs -
1
T -1
1
.6
5
-5 T -
2
.6
6
#outs -
8
T -1.6
6
#step 11
-
1
F -1
1
.6
5
#outs -
1
F
-7.22
-
8
F -1.6
6
#outs -
8
F
2.78
#step 12
-
1
T
-7.22
#outs -
2
T -
5
.8
7
-
8
T
2.78
#outs -
5
T -
0
.8
6
#step 13
-
2
F -
5
.8
7
#outs -
6
F -2.9
0
-
5
F -
0
.8
6
#outs -
1
F -2.
8
9
#step 14
-
6
T -2.9
0
#outs -
8
T -7.0
9
-
1
T -2.
8
9 #outs -
3
T -7.0
8
#step 15
-
8
F -7.0
9
#outs
-12
T -
3
.4
4
-
3
F -7.0
8
#outs
0
T -
8
.4
2
#step 16
-12
F -
3
.4
4
#outs
-1
1 F
0.14
0
F -
8
.4
2
#outs 1 F
-4.85
#step 17
-1
1 T
0.14
#outs
-1
1 T
4.01
1 T
-4.85
#outs 1 T
-0.98
#step 18
-1
1 F
4.01
#outs
-1
5 T
6.2
4
1 F
-0.98
#outs 5 T
-3.7
4
#step 19
-1
5 F
6.2
4 #outs
-1
9 F
10.55
5 F
-3.7
4 #outs 9 F
-4.43
#step 20
-1
9 T
10.55
#outs
-15 T 11.1
9
9 T
-4.43
#outs
13 T -3.7
9
#step 21
-15 F 11.19 #outs -16 F 9.95
13 F -3.79 #outs 12 F -5.03
#step 22
-16 T 9.95
#outs
-18
T 7.
1
9
12 T -5.03
#outs
10
T
-
7.
7
9
#step 23
-18
F 7.
1
9 #outs
-1
9 T
4.33
10
F
-
7.
7
9 #outs 9 T
-10.65
#step 24
-1
9 F
4.33
#outs
-20 T 6.30
9 F
-10.65
#outs
12 T -13.68
#step 25
-20 F 6.30 #outs -16 T 2.88
12 F -13.68 #outs 9 T -12.10
#step 26
-16 F 2.88 #outs -15 F 5.0
4
9 F -12.10 #outs 10 F -9.9
4
#step 27
-15 T 5.0
4 #outs
-15
T 7.
31
10 T -9.9
4 #outs
10
T
-
7.
67
#step 28
-15
F 7.
31
#outs
-16 F 3.1
4
10
F
-
7.
67
#outs
9 F -11.8
4
#step 29
-16 T 3.14 #outs -20 T 0.48
9 T -11.84 #outs 5 T -14.50
#step 30
-20 F 0.48
#outs
-19
F -0.0
9
5 F -14.50
#outs
4
F -
1
0.0
7
#step 31
-19
T -0.0
9
#outs
-21 T 4.59
4
T -
1
0.0
7
#outs
6 T -10.40
#step 32
-21 F 4.59 #outs -20 T 5.88
6 F -10.40 #outs 7 T -9.11
#step 33
-20 F 5.88 #outs -20 F 8.11
7 F -9.11 #outs 7 F -6.87
#step 34
-20 T 8.11 #outs -19 T 11.00
7 T -6.87 #outs 8 T -3.98
#step 35
-19 F 11.00 #outs -18 T 7.29
8 F -3.98 #outs 4 T -2.70
#step 36
-18 F 7.29 #outs -22 F 3.31
4 F -2.70 #outs 0 F -6.68
#step 37
-22 T 3.31 #outs -23 T 8.27
0 T -6.68 #outs 0 T -6.72
#step 38
-23 F 8.27
#outs -
27
F 7.
32
0 F -6.72
#outs -
4
F
-
7.
67
#step 39
-
27
T 7.
32
#outs -
31
T 9.99
-
4
T
-
7.
67
#outs -
4
T
-
9.99
#step 40
-
31
F 9.99 #outs -
28
T
14.7
9
-
4
F
-
9.99 #outs -
1
T
-5.1
9
#step 41
-
28
F
14.7
9 #outs -
29
T
18
.49
-
1
F
-5.1
9 #outs -
1
T
-6
.49
#step 42
-
29
F
18
.49 #outs -
32
F
13.89
-
1
F
-6
.49 #outs -
4
F
-11.10
#step 43
-
32
T
13.89
#outs -3
3
T
18.40
-
4
T
-11.10
#outs -3 T
-11.58
#step 44
-3
3
F
18.40
#outs -3
3
F
19.28
-3 F
-11.58
#outs -3 F
-10.70
#step 45
-3
3
T
19.28
#outs -3
3
T
22.28
-3 T
-10.70
#outs -3 T
-7.70
#step 46
-3
3
F
22.28
#outs
-3
0 T
25.10
-3 F
-7.70
#outs 0 T
-4.88
#step 47
-3
0 F
25.10
#outs
-28 F 26.73
0 F
-4.88
#outs
2 F -3.26
#step 48
-28 T 26.73 #outs -29 T 26.75
2 T -3.26 #outs 2 T -8.22
#step 49
-29 F 26.75 #outs -30 T 22.08
2 F -8.22 #outs 1 T -12.89
#step 50
-30 F 22.08 #outs -29 F 24.3
4
1 F -12.89 #outs 2 F -10.6
4
#step 51
-29 T 24.34 #outs -26 T 22.27
2 T -10.64 #outs 1 T -7.71
#step 52
-26 F 22.27 #outs -30 F 23.27
1 F -7.71 #outs 1 F -11.70
#step 53
-30 T 23.27 #outs -34 T 25.21
1 T -11.70 #outs 2 T -14.75
#step 54
-34 F 25.21 #outs -30 F 27.14
2 F -14.75 #outs 6 F -12.82
#step 55
-30 T 27.14 #outs -33 T 29.39
6 T -12.82 #outs 7 T -15.57
#step 56
-33 F 29.39 #outs -30 T 24.5
8
7 F -15.57 #outs 3 T -15.3
8
#step 57
-30 F 24.58 #outs -29 F 26.22
3 F -15.38 #outs 4 F -13.74
#step 58
-29 T 26.22 #outs -29 T 26.73
4 T -13.74 #outs 4 T -13.24
#step 59
-29 F 26.73 #outs -31 T 22.00
4 F -13.24 #outs 2 T -17.97
#step 60
-31 F 22.00
#outs
-3
5 T 22.
7
3
2 F -17.97
#outs 5 T
-
22.
2
3
#step 61
-3
5 F 22.
7
3 #outs
-32 F 27.24
5 F
-
22.
2
3 #outs
8 F -17.72
#step 62
-32 T 27.24 #outs -29 T 31.10
8 T -17.72 #outs 11 T -13.86
#step 63
-29 F 31.10
#outs
-3
0 F
28.86
11 F -13.86
#outs
1
0 F
-16.10
#step 64
-3
0 T
28.86
#outs
-31 T 23
.98
1
0 T
-16.10
#outs
9 T -20
.98
#step 65
-31 F 23
.98 #outs
-32 T 27.40
9 F -20
.98 #outs
9 T -22.55
#step 66
-32 F 27.40
#outs
-36
F 27.8
7
9 F -22.55
#outs
9
F
-
27.
0
8
#step 67
-36
T 27.8
7
#outs
-36 T 31.65
9
T
-
27.
0
8 #outs
9 T -23.30
#step 68
-36 F 31.65 #outs -40 F 34.81
9 F -23.30 #outs 13 F -25.13
#step 69
-40 T 34.81 #outs -43 T 31
.9
9
13 T -25.13 #outs 10 T -27
.9
5
#step 70
-43 F 31
.9
9
#outs
-40 F 29.09
10 F -27
.9
5
#outs
8 F -25.86
#step 71
-40 T 29.09
#outs
-4
2 T
30.44
8 T -25.86
#outs
1
2 T
-29.50
#step 72
-4
2 F
30.44
#outs
-46 F 25.59
1
2 F
-29.50
#outs
8 F -34.35
#step 73
-46 T 25.59 #outs -50 T 28.74
8 T -34.35 #outs 9 T -36.19
#step 74
-50 F 28.74 #outs -49 F 30.13
9 F -36.19 #outs 10 F -34.81
#step 75
-49 T 30.13 #outs -51 T 25.89
10 T -34.81 #outs 8 T -39.05
#step 76
-51 F 25.89 #outs -49 F 26.71
8 F -39.05 #outs 10 F -38.23
#step 77
-49 T 26.71 #outs -49 T 24.85
10 T -38.23 #outs 7 T -35.09
#step 78
-49 F 24.85 #outs -52 F 21.4
2
7 F -35.09 #outs 4 F -38.5
2
#step 79
-52 T 21.42 #outs -56 T 22.05
4 T -38.52 #outs 5 T -42.89
#step 80
-56 F 22.05
#outs
-5
9 F
26.56
5 F -42.89
#outs 9 F
-43.37
#step 81
-5
9 T
26.56
#outs
-56 T 26
.9
4
9 T
-43.37
#outs
12 T -42
.9
9
#step 82
-56 F 26
.9
4
#outs
-5
4 T
31.18
12 F -42
.9
9
#outs
1
4 T
-38.75
#step 83
-5
4 F
31.18
#outs
-5
4 T
35.55
1
4 F
-38.75
#outs
1
4 T
-34.38
#step 84
-5
4 F
35.55
#outs
-55 F 34.23
1
4 F
-34.38
#outs
13 F -35.70
#step 85
-55 T 34.23 #outs -58 T 33.14
13 T -35.70 #outs 10 T -36.79
#step 86
-58 F 33.14 #outs -58 F 29.7
2
10 F -36.79 #outs 6 F -35.2
2
#step 87
-58 T 29.7
2 #outs
-6
0 T
30
.4
8
6 T -35.2
2 #outs
1
0 T
-39
.4
5
#step 88
-6
0 F
30
.4
8
#outs
-58 T 26.51
1
0 F
-39
.4
5
#outs
6 T -38.42
#step 89
-58 F 26.51 #outs -57 T 25.39
6 F -38.42 #outs 2 T -34.55
#step 90
-57 F 25.39 #outs -57 F 26.90
2 F -34.55 #outs 2 F -33.04
#step 91
-57 T 26.90 #outs -55 T 22.86
2 T -33.04 #outs 0 T -32.09
#step 92
-55 F 22.86
#outs -
59
F
21.60
0 F -32.09
#outs -
4
F
-33.35
#step 93
-
59
T
21.60
#outs -
61
T
26.38
-
4
T
-33.35
#outs -
4
T
-33.56
#step 94
-
61
F
26.38
#outs
-57 F 28.28
-
4
F
-33.56
#outs
0 F -31.67
#step 95
-57 T 28.28
#outs -
60
T
26.62
0 T -31.67
#outs -
3
T
-33.33
#step 96
-
60
F
26.62
#outs -
62
T
29.70
-
3
F
-33.33
#outs -
3
T
-35.25
#step 97
-
62
F
29.70
#outs
-63 T 31.80
-
3
F
-35.25
#outs
0 T -38.14
#step 98
-63 F 31.80 #outs -60 T 31.89
0 F -38.14 #outs 3 T -38.05
#step 99
-60 F 31.89 #outs -64 T 32.38
3 F -38.05 #outs 3 T -42.54
#step 100
-64 F 32.38
#outs -
68
T
30.22
3 F -42.54
#outs -
1
T
-44.71
examples/lutin/test_ok/erwan.lut
View file @
4342b156
...
...
@@ -15,6 +15,7 @@ let up_and_down(speed, pspeed : real ref; min, max, delta : real) =
(*let rabbit_speed(speed : real ref) : trace = *)
system
rs
(
dummy
:
bool
)
returns
(
speed
:
real
=
0
.
0
;
min
,
max
,
delta
:
real
=
0
.
0
;
...
...
source/Lucky/Makefile.luc2luciole
View file @
4342b156
...
...
@@ -102,6 +102,8 @@ SOURCES_OCAML = \
$(OBJDIR)
/lucProg.ml
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
\
$(OBJDIR)
/luciole.ml
\
$(OBJDIR)
/gen_stubs_common.mli
\
...
...
source/Lucky/Makefile.luc4c
View file @
4342b156
...
...
@@ -126,6 +126,8 @@ SOURCES = $(SOURCES_C) \
$(OBJDIR)
/lucProg.ml
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
$(OBJDIR)
/print.mli
\
$(OBJDIR)
/print.ml
\
$(OBJDIR)
/rif.mli
\
...
...
source/Lucky/Makefile.luc4ocaml
View file @
4342b156
...
...
@@ -100,6 +100,8 @@ SOURCES_OCAML = \
$(OBJDIR)
/lucProg.ml
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
$(OBJDIR)
/print.mli
\
$(OBJDIR)
/print.ml
\
$(OBJDIR)
/rif.mli
\
...
...
source/Lucky/Makefile.lucky
View file @
4342b156
...
...
@@ -107,6 +107,8 @@ SOURCES_OCAML0:= \
$(OBJDIR)
/lucProg.ml
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
$(OBJDIR)
/print.mli
\
$(OBJDIR)
/print.ml
\
$(OBJDIR)
/rif.mli
\
...
...
source/Lucky/Makefile.lucky.src
View file @
4342b156
...
...
@@ -63,6 +63,7 @@ SOURCES = \
./show_env.ml
\
./prog.ml
\
./fGen.ml
\
./lucFGen.ml
\
./print.ml
\
.//rif.ml
\
./sim2chro.ml
\
...
...
source/Lucky/Makefile.show_luc
View file @
4342b156
...
...
@@ -106,6 +106,8 @@ SOURCES_OCAML := \
$(OBJDIR)
/lucProg.ml
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
$(OBJDIR)
/print.mli
\
$(OBJDIR)
/print.ml
\
$(OBJDIR)
/rif.mli
\
...
...
source/Lucky/luc4c.ml
View file @
4342b156
...
...
@@ -180,7 +180,7 @@ let (step: lucky_process -> step_mode -> unit) =
);
match
state_of_lp
lp
with
|
Some
(
st0
,
inp
,_
outp
)
->
let
ral
=
FGen
.
get
inp
st0
in
let
ral
=
Luc
FGen
.
get
inp
st0
in
let
(
st
,
(
outs
,
_locs
))
=
try
Lucky
.
env_step
...
...
source/Lucky/luc4ocaml.ml
View file @
4342b156
...
...
@@ -126,7 +126,7 @@ let (map2list : Value.OfIdent.t -> subst list) = (fun vl ->
let
step
?
(
mode
=
StepInside
)
st0
inputs
=
let
inp
=
list2map
inputs
in
let
ral
=
FGen
.
get
inp
st0
in
let
ral
=
Luc
FGen
.
get
inp
st0
in
let
(
st
,
(
outs
,
locs
))
=
try
Lucky
.
env_step
...
...
source/Lucky/luc_exe.ml
View file @
4342b156
...
...
@@ -264,7 +264,7 @@ and
let
next_state
=
if
options
.
boot
then
let
ins
=
Value
.
OfIdent
.
empty
in
let
ral
=
FGen
.
get
ins
init_state
in
let
ral
=
Luc
FGen
.
get
ins
init_state
in
let
(
next_state
,
(
out
,
loc
))
=
try
Lucky
.
env_step
options
.
draw_mode
ins
init_state
ral
...
...
@@ -316,7 +316,7 @@ and
in
let
(
input
,
state'
)
=
Rif
.
read
(
LucProg
.
make_state
None
)
stdin
state
in
(* let input_list = Hashtbl.fold (fun vn x acc -> (vn,x)::acc) input [] in *)
let
ral
=
FGen
.
get
input
state'
in
let
ral
=
Luc
FGen
.
get
input
state'
in
let
(
next_state
,
(
out
,
loc
))
=
try
Lucky
.
env_step
options
.
draw_mode
input
state'
ral
...
...
source/Lutin/Makefile.lutin
View file @
4342b156
...
...
@@ -99,6 +99,8 @@ LURETTE_SOURCES=\
$(OBJDIR)
/prog.mli
\
$(OBJDIR)
/fGen.mli
\
$(OBJDIR)
/fGen.ml
\
$(OBJDIR)
/lucFGen.mli
\
$(OBJDIR)
/lucFGen.ml
\
$(OBJDIR)
/lucParse.mli
\
$(OBJDIR)
/lucParse.ml
\
$(OBJDIR)
/lucky.mli
\
...
...
@@ -140,10 +142,14 @@ SOURCES=\
$(OBJDIR)
/coAlgExp.mli
\
$(OBJDIR)
/coTraceExp.ml
\
$(OBJDIR)
/coTraceExp.mli
\
$(OBJDIR)
/guard.ml
\
$(OBJDIR)
/guard.mli
\
$(OBJDIR)
/expand.ml
\
$(OBJDIR)
/expand.mli
\
$(OBJDIR)
/autoExplore.ml
\
$(OBJDIR)
/autoExplore.mli
\
$(OBJDIR)
/autoGen.ml
\
$(OBJDIR)
/autoGen.mli
\
$(OBJDIR)
/auto2Lucky.ml
\
$(OBJDIR)
/auto2Lucky.mli
\
$(OBJDIR)
/lutProg.ml
\
...
...
source/Lutin/auto2Lucky.ml
View file @
4342b156
open
Printf
open
Expand
open
AutoExplore
(** Impression des expressions algbriques *)
...
...
@@ -20,7 +19,7 @@ let print_header
(
srcname
:
string
)
(
mnode
:
string
)
(
os
:
Pervasives
.
out_channel
)
(
auto
:
Auto
Explore
.
t
)
=
(
auto
:
Auto
Gen
.
t
)
=
(
fprintf
os
"-- generated by lutin2 %s.%s
\n
"
LutVersion
.
number
LutVersion
.
release
;
...
...
@@ -46,12 +45,12 @@ let print_header
let
make
(
srcname
:
string
)
(
mnode
:
string
)
(
auto
:
Auto
Explore
.
t
)
(
auto
:
Auto
Gen
.
t
)
(
os
:
Pervasives
.
out_channel
)
=
(
(* le source au cas ou ... *)
let
source_code
=
Auto
Explore
.
source
auto
in
let
source_code
=
Auto
Gen
.
source
auto
in
(*************** EN-TTE ************************************)
print_header
srcname
mnode
os
auto
;
...
...
@@ -151,7 +150,7 @@ let make
List
.
iter
print_alias
(
Expand
.
alias_list
source_code
);
(* - les compteurs de boucles (de auto) *)
(* OBSOLETE List.iter print_counter (Auto
Explore
.counters auto); *)
(* OBSOLETE List.iter print_counter (Auto
Gen
.counters auto); *)
for
i
=
0
to
(
CoTraceExp
.
nb_loops
()
-
1
)
do
print_counter
i
done
;
...
...
@@ -162,23 +161,23 @@ let make
(*************** ETATS *************************************)
(***********************************************************)
let
print_state
(
nme
:
string
)
(
info
:
Auto
Explore
.
state_info
)
=
(
let
print_state
(
nme
:
string
)
(
info
:
Auto
Gen
.
state_info
)
=
(
match
info
with
Auto
Explore
.
SS_transient
->
(
Auto
Gen
.
SS_transient
->
(
fprintf
os
" %s : transient;
\n
"
nme
)
|
Auto
Explore
.
SS_final
_
->
(
Auto
Gen
.
SS_final
_
->
(
fprintf
os
" %s : final;
\n
"
nme
)
|
Auto
Explore
.
SS_stable
tracexp
->
(
Auto
Gen
.
SS_stable
tracexp
->
(
fprintf
os
" %s : stable;
\n
"
nme
)
)
in
fprintf
os
"nodes {
\n
"
;
Hashtbl
.
iter
print_state
(
Auto
Explore
.
states
auto
)
;
Hashtbl
.
iter
print_state
(
Auto
Gen
.
states
auto
)
;
fprintf
os
"}
\n
"
;
fprintf
os
"start_node { %s }
\n
"
(
Auto
Explore
.
init_control
auto
)
;
fprintf
os
"start_node { %s }
\n
"
(
Auto
Gen
.
init_control
auto
)
;
(*