Commit 4342b156 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Merging Pascal and R1 branches.

parents 568eae01 6803cd52
......@@ -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);
......
......@@ -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 \
......
......@@ -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
......@@ -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 21.425417
10 0 20.000000 #outs 14 0 16.432561
# 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
# Interpreting the lutin file foo.lut with node main
-1 true 7.188031
-2 true 10.880835
0 true 9.916883
1 true 8.889484
3 true 8.694923
7 true 9.681718
3 true 12.275496
6 true 8.423593
5 true 4.455379
2 true 8.274838
6 true 10.193351
3 true 5.883434
2 true 9.917567
1 true 13.888125
0 true 18.693193
4 true 19.679989
6 true 17.278568
5 true 18.418950
4 true 14.450737
7 true 13.272541
11 true 15.191055
......@@ -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.30
-1 F -0.55 #outs -3 F 3.70
#step 6
-1 T -1.30 #outs -3 T -6.05
-3 T 3.70 #outs -5 T -1.05
#step 7
-3 F -6.05 #outs -6 F -4.62
-5 F -1.05 #outs -1 F -4.61
#step 8
-6 T -4.62 #outs -2 T -7.29
-1 T -4.61 #outs -2 T -2.28
#step 9
-2 F -7.29 #outs -5 F -7.67
-2 F -2.28 #outs -5 F -2.66
#step 10
-5 T -7.67 #outs -1 T -11.65
-5 T -2.66 #outs -8 T -1.66
#step 11
-1 F -11.65 #outs -1 F -7.22
-8 F -1.66 #outs -8 F 2.78
#step 12
-1 T -7.22 #outs -2 T -5.87
-8 T 2.78 #outs -5 T -0.86
#step 13
-2 F -5.87 #outs -6 F -2.90
-5 F -0.86 #outs -1 F -2.89
#step 14
-6 T -2.90 #outs -8 T -7.09
-1 T -2.89 #outs -3 T -7.08
#step 15
-8 F -7.09 #outs -12 T -3.44
-3 F -7.08 #outs 0 T -8.42
#step 16
-12 F -3.44 #outs -11 F 0.14
0 F -8.42 #outs 1 F -4.85
#step 17
-11 T 0.14 #outs -11 T 4.01
1 T -4.85 #outs 1 T -0.98
#step 18
-11 F 4.01 #outs -15 T 6.24
1 F -0.98 #outs 5 T -3.74
#step 19
-15 F 6.24 #outs -19 F 10.55
5 F -3.74 #outs 9 F -4.43
#step 20
-19 T 10.55 #outs -15 T 11.19
9 T -4.43 #outs 13 T -3.79
#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.19
12 T -5.03 #outs 10 T -7.79
#step 23
-18 F 7.19 #outs -19 T 4.33
10 F -7.79 #outs 9 T -10.65
#step 24
-19 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.04
9 F -12.10 #outs 10 F -9.94
#step 27
-15 T 5.04 #outs -15 T 7.31
10 T -9.94 #outs 10 T -7.67
#step 28
-15 F 7.31 #outs -16 F 3.14
10 F -7.67 #outs 9 F -11.84
#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.09
5 F -14.50 #outs 4 F -10.07
#step 31
-19 T -0.09 #outs -21 T 4.59
4 T -10.07 #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.79
-4 F -9.99 #outs -1 T -5.19
#step 41
-28 F 14.79 #outs -29 T 18.49
-1 F -5.19 #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 -33 T 18.40
-4 T -11.10 #outs -3 T -11.58
#step 44
-33 F 18.40 #outs -33 F 19.28
-3 F -11.58 #outs -3 F -10.70
#step 45
-33 T 19.28 #outs -33 T 22.28
-3 T -10.70 #outs -3 T -7.70
#step 46
-33 F 22.28 #outs -30 T 25.10
-3 F -7.70 #outs 0 T -4.88
#step 47
-30 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.34
1 F -12.89 #outs 2 F -10.64
#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.58
7 F -15.57 #outs 3 T -15.38
#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 -35 T 22.73
2 F -17.97 #outs 5 T -22.23
#step 61
-35 F 22.73 #outs -32 F 27.24
5 F -22.23 #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 -30 F 28.86
11 F -13.86 #outs 10 F -16.10
#step 64
-30 T 28.86 #outs -31 T 23.98
10 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.87
9 F -22.55 #outs 9 F -27.08
#step 67
-36 T 27.87 #outs -36 T 31.65
9 T -27.08 #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.99
13 T -25.13 #outs 10 T -27.95
#step 70
-43 F 31.99 #outs -40 F 29.09
10 F -27.95 #outs 8 F -25.86
#step 71
-40 T 29.09 #outs -42 T 30.44
8 T -25.86 #outs 12 T -29.50
#step 72
-42 F 30.44 #outs -46 F 25.59
12 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.42
7 F -35.09 #outs 4 F -38.52
#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 -59 F 26.56
5 F -42.89 #outs 9 F -43.37
#step 81
-59 T 26.56 #outs -56 T 26.94
9 T -43.37 #outs 12 T -42.99
#step 82
-56 F 26.94 #outs -54 T 31.18
12 F -42.99 #outs 14 T -38.75
#step 83
-54 F 31.18 #outs -54 T 35.55
14 F -38.75 #outs 14 T -34.38
#step 84
-54 F 35.55 #outs -55 F 34.23
14 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.72
10 F -36.79 #outs 6 F -35.22
#step 87
-58 T 29.72 #outs -60 T 30.48
6 T -35.22 #outs 10 T -39.45
#step 88
-60 F 30.48 #outs -58 T 26.51
10 F -39.45 #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
......@@ -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;
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -63,6 +63,7 @@ SOURCES = \
./show_env.ml \
./prog.ml \
./fGen.ml \
./lucFGen.ml \
./print.ml \
.//rif.ml \
./sim2chro.ml \
......
......@@ -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 \
......
......@@ -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 = LucFGen.get inp st0 in
let (st, (outs, _locs)) =
try
Lucky.env_step
......
......@@ -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 = LucFGen.get inp st0 in
let (st, (outs, locs)) =
try
Lucky.env_step
......
......@@ -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 = LucFGen.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 = LucFGen.get input state' in
let (next_state, (out, loc)) =
try
Lucky.env_step options.draw_mode input state' ral
......
......@@ -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 \
......
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 : AutoExplore.t) =
(auto : AutoGen.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 : AutoExplore.t)
(auto : AutoGen.t)
(os : Pervasives.out_channel) =
(
(* le source au cas ou ... *)
let source_code = AutoExplore.source auto in
let source_code = AutoGen.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 (AutoExplore.counters auto); *)
(* OBSOLETE List.iter print_counter (AutoGen.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: AutoExplore.state_info) = (
let print_state (nme: string) (info: AutoGen.state_info) = (
match info with
AutoExplore.SS_transient -> (
AutoGen.SS_transient -> (
fprintf os " %s : transient;\n" nme
) |
AutoExplore.SS_final _ -> (
AutoGen.SS_final _ -> (
fprintf os " %s : final;\n" nme
) |
AutoExplore.SS_stable tracexp -> (
AutoGen.SS_stable tracexp -> (
fprintf os " %s : stable;\n" nme
)
) in
fprintf os "nodes {\n" ;
Hashtbl.iter print_state (AutoExplore.states auto) ;
Hashtbl.iter print_state (AutoGen.states auto) ;
fprintf os "}\n" ;
fprintf os "start_node { %s }\n" (AutoExplore.init_control auto) ;
fprintf os "start_node { %s }\n" (AutoGen.init_control auto) ;
(*