Commit caa32faa authored by Erwan Jahier's avatar Erwan Jahier

lurette 1.19 Mon, 19 Jan 2004 14:36:43 +0100 by jahier

Parent-Version:      1.18
Version-Log:

Add support for structured types in lurette.

source/type.ml/.mli:
   New file containing lucky var type definition (moved from var.ml).

source/gen_stubs_*.ml:
source/parse_c*.ml:

Project-Description: Lurette
parent c3756573
This diff is collapsed.
****** A faire vite *******
* Les structures et les tableaux pour scade/lurette
* Portage pour TNI
* Rajouter un mot clef final_nodes { node list } dans lucky
qui verifie si le noeud courant est dans la liste quand lucky se bloque
et qui ral le cas écheant.
* Rajouter la fonction abs
* mettre les .rif etc dans un repertoire
*********** BUGS
pbs de maj des nouveuax fichiers dans xlurette
* les .saod, quand ils sont modifiés, ne sont pas recompilé.
* Quand j'essayz un prog scade sous linux, le msg d'erreur
est pas tiptop
* quand une formule s'avere fausse du point de vue des variables
numeriques, il ne faut pas repartir du haut du graphe, mais backtraker
depuis la branche qui s'avere fausse. Sinon, les probabilités induites
......
#FIG 3.2
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
6 3900 1050 5400 1875
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
5400 1875 5400 1050 3900 1050 3900 1875 5400 1875
4 1 0 50 0 0 12 0.0000 6 180 810 4725 1500 Envt Spec.\001
-6
6 3900 2475 5400 3450
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
5400 3450 5400 2475 3900 2475 3900 3450 5400 3450
4 1 0 50 0 0 12 0.0000 6 135 915 4725 3000 Envt. kernel\001
-6
6 3825 5850 5775 6750
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
5775 6750 5775 5850 3825 5850 3825 6750 5775 6750
4 1 0 50 0 0 12 0.0000 6 135 1245 4875 6375 Result Observer\001
-6
6 3750 4425 5475 5325
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
5475 5325 5475 4425 3750 4425 3750 5325 5475 5325
4 1 0 50 0 0 12 0.0000 6 180 900 4650 4950 main engine\001
-6
6 6375 4275 9525 5550
6 6375 4425 7650 5325
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
7650 5325 7650 4425 6375 4425 6375 5325 7650 5325
4 1 0 50 0 0 12 0.0000 6 135 1035 7050 4950 SUT Interface\001
-6
6 8325 4275 9525 5325
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
9525 5325 9525 4275 8325 4275 8325 5325 9525 5325
4 1 0 50 0 0 12 0.0000 6 135 330 8925 4875 SUT\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
8325 4575 7650 4575
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
7650 4950 8325 4950
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
7650 5250 8325 5250
4 1 0 50 0 0 12 0.0000 6 135 135 8025 4875 in\001
4 1 0 50 0 0 12 0.0000 6 105 240 8025 4500 out\001
4 1 0 50 0 0 12 0.0000 6 180 585 8025 5475 try/step\001
4 1 0 50 0 0 12 0.0000 6 135 90 8925 4650 6\001
4 1 0 50 0 0 12 0.0000 6 135 90 7050 4650 7\001
-6
6 1575 4350 3150 5325
6 1575 4350 3150 5325
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
3150 5325 3150 4350 1575 4350 1575 5325 3150 5325
4 1 0 50 0 0 12 0.0000 6 135 1320 2400 4875 Constraint Solver\001
-6
4 1 0 50 0 0 12 0.0000 6 135 90 2400 4650 4\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
4650 1875 4650 2475
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
6375 4575 5475 4575
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
5475 5175 6375 5175
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
5475 4950 6375 4950
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
5100 4425 5100 3450
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
4200 3450 4200 4425
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
4350 5325 4350 5850
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
3750 4575 3150 4575
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
3150 5100 3750 5100
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
4800 5850 4800 5325
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
3 1 1.00 60.00 120.00
5325 5325 5325 5850
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4
3 1 1.00 60.00 120.00
4650 1875 3450 2475 3450 5550 3825 6000
4 0 0 50 0 0 12 0.0000 6 180 480 4725 2250 compil\001
4 2 0 50 0 0 12 0.0000 6 105 405 4125 3900 const\001
4 1 0 50 0 0 12 0.0000 6 135 135 3300 5250 in\001
4 2 0 50 0 0 12 0.0000 6 135 420 4275 5625 in/out\001
4 0 0 50 0 0 12 0.0000 6 180 315 4875 5700 diag\001
4 2 0 50 0 0 12 0.0000 6 150 330 5775 5700 step\001
4 0 0 50 0 0 12 0.0000 6 135 420 5175 3975 in/out\001
4 1 0 50 0 0 12 0.0000 6 135 90 4650 4725 1\001
4 1 0 50 0 0 12 0.0000 6 135 90 4650 2700 2\001
4 1 0 50 0 0 12 0.0000 6 135 90 4650 1275 3\001
4 1 0 50 0 0 12 0.0000 6 135 90 4800 6150 5\001
4 1 0 50 0 0 12 0.0000 6 180 585 5925 5325 try/step\001
4 1 0 50 0 0 12 0.0000 6 135 135 5850 4875 in\001
4 1 0 50 0 0 12 0.0000 6 105 240 5850 4500 out\001
4 1 0 50 0 0 12 0.0000 6 105 405 3450 4500 const\001
......@@ -305,6 +305,8 @@ class customized_callbacks = object(self)
let
display = self#top_xlurette#output_window#insert
and
display_misc = self#top_xlurette#error_window#insert
and
progress =
( fun f ->
let p = f /. length in
......@@ -365,6 +367,11 @@ class customized_callbacks = object(self)
String.length str > 7 && String.sub str 0 8 = "<lurette"
then
()
else if
String.length str > 18 &&
String.sub str 0 19 = "warning unused code"
then
display_misc (str ^ "\n")
else if
((String.length str > 9) && ((String.sub str 0 9) = "--- step "))
then
......@@ -524,8 +531,8 @@ class customized_callbacks = object(self)
method ok_extra_cfiles_clicked () =
let cfile = self#top_fileselection_extra_cfiles#fileselection_extra_cfiles#get_filename in
self#top_extra_env_var_window#extra_cfiles_entry#set_text (
((self#top_extra_env_var_window#extra_cfiles_entry#text) ^ " " ^ cfile)) ;
self#top_extra_env_var_window#extra_cfiles_entry#set_text (cfile ^ " " ^
((self#top_extra_env_var_window#extra_cfiles_entry#text))) ;
self#top_fileselection_extra_cfiles#fileselection_extra_cfiles#misc#hide ()
method cancel_extra_cfiles_clicked () =
......@@ -537,8 +544,8 @@ class customized_callbacks = object(self)
method ok_extra_libs_clicked () =
let cfile = self#top_fileselection_extra_libs#fileselection_extra_libs#get_filename in
self#top_extra_env_var_window#extra_libs_entry#set_text (
((self#top_extra_env_var_window#extra_libs_entry#text) ^ " " ^ cfile)) ;
self#top_extra_env_var_window#extra_libs_entry#set_text (cfile ^ " -l" ^
((self#top_extra_env_var_window#extra_libs_entry#text) )) ;
self#top_fileselection_extra_libs#fileselection_extra_libs#misc#hide ()
method cancel_extra_libs_clicked () =
......@@ -550,8 +557,8 @@ class customized_callbacks = object(self)
method ok_extra_libdirs_clicked () =
let cfile = self#top_fileselection_extra_libdirs#fileselection_extra_libdirs#get_filename in
self#top_extra_env_var_window#extra_libdirs_entry#set_text (
((self#top_extra_env_var_window#extra_libdirs_entry#text) ^ " " ^ cfile)) ;
self#top_extra_env_var_window#extra_libdirs_entry#set_text (cfile ^ " -L" ^
((self#top_extra_env_var_window#extra_libdirs_entry#text))) ;
self#top_fileselection_extra_libdirs#fileselection_extra_libdirs#misc#hide ()
method cancel_extra_libdirs_clicked () =
......@@ -563,8 +570,8 @@ class customized_callbacks = object(self)
method ok_extra_includedirs_clicked () =
let cfile = self#top_fileselection_extra_includedirs#fileselection_extra_includedirs#get_filename in
self#top_extra_env_var_window#extra_includedirs_entry#set_text (
((self#top_extra_env_var_window#extra_includedirs_entry#text) ^ " " ^ cfile)) ;
self#top_extra_env_var_window#extra_includedirs_entry#set_text (cfile ^ " -I" ^
((self#top_extra_env_var_window#extra_includedirs_entry#text))) ;
self#top_fileselection_extra_includedirs#fileselection_extra_includedirs#misc#hide ()
method cancel_extra_includedirs_clicked () =
......
This diff is collapsed.
pkint.h.o: pkint.h
config.h.o: config.h
polka.h.o: polka.h config.h
internal.h.o: internal.h config.h polka.h bit.h pkint.h
bit.h.o: bit.h config.h polka.h
satmat.h.o: satmat.h config.h polka.h bit.h
vector.h.o: vector.h config.h polka.h pkint.h
matrix.h.o: matrix.h config.h polka.h pkint.h vector.h satmat.h bit.h
cherni.h.o: cherni.h config.h polka.h pkint.h vector.h satmat.h bit.h \
matrix.h
poly.h.o: poly.h config.h polka.h pkint.h vector.h satmat.h bit.h \
matrix.h
polka.o: polka.c config.h polka.h internal.h bit.h pkint.h vector.h \
matrix.h satmat.h
internal.o: internal.c config.h internal.h polka.h bit.h pkint.h
bit.o: bit.c bit.h config.h polka.h
satmat.o: satmat.c config.h satmat.h polka.h bit.h
vector.o: vector.c vector.h config.h polka.h pkint.h internal.h bit.h
matrix.o: matrix.c polka.h config.h matrix.h pkint.h vector.h satmat.h \
bit.h internal.h
cherni.o: cherni.c cherni.h config.h polka.h pkint.h vector.h satmat.h \
bit.h matrix.h internal.h
poly.o: poly.c poly.h config.h polka.h pkint.h vector.h satmat.h bit.h \
matrix.h internal.h cherni.h
vector.cmo: vector.cmi
vector.cmx: vector.cmi
matrix.cmo: matrix.cmi
matrix.cmx: matrix.cmi
poly.cmo: poly.cmi
poly.cmx: poly.cmi
vector.cmi: polka.cmi
matrix.cmi: vector.cmi
poly.cmi: matrix.cmi vector.cmi
polka.cmo: polka.cmi
polka.cmx: polka.cmi
vector.cmo: polka.cmi polka_lexer.cmi polka_parser.cmi vector.cmi
vector.cmx: polka.cmx polka_lexer.cmi polka_parser.cmx vector.cmi
matrix.cmo: polka.cmi vector.cmi matrix.cmi
matrix.cmx: polka.cmx vector.cmx matrix.cmi
poly.cmo: matrix.cmi vector.cmi poly.cmi
poly.cmx: matrix.cmx vector.cmx poly.cmi
polka_parser.cmo: polka.cmi polka_parser.cmi
polka_parser.cmx: polka.cmx polka_parser.cmi
polka_parser.cmi: polka.cmi
polka_lexer.cmi: polka_parser.cmi
polkaIO.cmo: matrix.cmi polka.cmi poly.cmi vector.cmi polkaIO.cmi
polkaIO.cmx: matrix.cmx polka.cmx poly.cmx vector.cmx polkaIO.cmi
polkaIO.cmi: matrix.cmi poly.cmi vector.cmi
s/vector__t/t/g;
s/matrix__t/t/g;
s/poly__t/t/g;
s/dimsup_t/dimsup/g;
s/external vector_/external /g;
s/external matrix_/external /g;
s/external poly_/external /g;
s/Tbool_bottom/Bottom/;
s/Tbool_true/True/;
s/Tbool_false/False/;
s/Tbool_top/Top/;
......@@ -52,8 +52,8 @@ all: nc
SCADE_LIB_DIR=$(SCADE_INSTALL_DIR)/lib
SCADE_LIBDIRS=-L$(SCADE_INSTALL_DIR)/lib $(LIBDIRS)
SCADE_INCLUDE_DIR= \
SCADE_LIB_DIRS=-L$(SCADE_INSTALL_DIR)/lib $(LIBDIRS)
SCADE_INCLUDE_DIRS= \
-I$(SCADE_INSTALL_DIR)/lib \
-I$(SCADE_INSTALL_DIR)/SimulinkGateway/include \
-I$(SCADE_INSTALL_DIR)/include $(INCLUDEDIRS) \
......@@ -104,11 +104,11 @@ $(NODE_OBJECTS)/$(HOST_TYPE)/ocaml2c_stubs.o : $(LURETTE_TMP_DIR)/ocaml2c_stubs.
-c $(LURETTE_TMP_DIR)/ocaml2c_stubs.c -o $@
$(NODE_OBJECTS)/$(HOST_TYPE)/lurette__sut.o : $(LURETTE_TMP_DIR)/lurette__sut.c
$(CC) $(DEBUG) $(LIBDIRS) $(SCADE_INCLUDE_DIR) \
$(CC) $(DEBUG) $(LIBDIRS) $(SCADE_INCLUDE_DIRS) \
-c $(LURETTE_TMP_DIR)/lurette__sut.c -o $@
$(NODE_OBJECTS)/$(HOST_TYPE)/lurette__oracle.o : $(LURETTE_TMP_DIR)/lurette__oracle.c
$(CC) $(DEBUG) $(LIBDIRS) $(SCADE_INCLUDE_DIR) \
$(CC) $(DEBUG) $(LIBDIRS) $(SCADE_INCLUDE_DIRS) \
-c $(LURETTE_TMP_DIR)/lurette__oracle.c -o $@
$(NODE_OBJECTS)/$(HOST_TYPE)/lurette_exe.o : $(LURETTE_TMP_DIR)/lurette_exe.c
......@@ -123,27 +123,27 @@ $(NODE_OBJECTS)/$(HOST_TYPE)/call_lurette_main.o : $(LURETTE_TMP_DIR)/call_luret
$(NODE_OBJECTS)/$(HOST_TYPE)/$(SUT).o : $(SUT_DIR)/$(SUT).c
$(CC) $(DEBUG) -I$(SCADE_LIB_DIR) -I$(USER_TESTING_DIR) \
$(SCADE_INCLUDE_DIR) $(CFLAGS) -c $(SUT_DIR)/$(SUT).c -o $@
$(CC) $(DEBUG) -I$(SCADE_LIB_DIRS) -I$(USER_TESTING_DIR) \
$(SCADE_INCLUDE_DIRS) $(CFLAGS) -c $(SUT_DIR)/$(SUT).c -o $@
$(NODE_OBJECTS)/$(HOST_TYPE)/$(ORACLE).o : $(ORACLE_DIR)/$(ORACLE).c
$(CC) $(DEBUG) -I$(SCADE_LIB_DIR) -I$(USER_TESTING_DIR) \
$(SCADE_INCLUDE_DIR) $(CFLAGS) -c $(ORACLE_DIR)/$(ORACLE).c -o $@
$(CC) $(DEBUG) -I$(SCADE_LIB_DIRS) -I$(USER_TESTING_DIR) \
$(SCADE_INCLUDE_DIRS) $(CFLAGS) -c $(ORACLE_DIR)/$(ORACLE).c -o $@
$(NODE_OBJECTS)/$(HOST_TYPE)/LibMathAdvanced.o : $(SCADE_INSTALL_DIR)/libraries/libmathadvanced/LibMathAdvanced.c
$(CC) $(NODE_SOURCES) -I$(SCADE_INSTALL_DIR)/libraries/libmathadvanced \
-I$(SCADE_LIB_DIR) -I$(USER_TESTING_DIR) $(SCADE_INCLUDE_DIR) \
-I$(SCADE_LIB_DIRS) -I$(USER_TESTING_DIR) $(SCADE_INCLUDE_DIRS) \
-c $(CFLAGS) $(SCADE_INSTALL_DIR)/libraries/libmathadvanced/LibMathAdvanced.c \
-o $(NODE_OBJECTS)/$(HOST_TYPE)/LibMathAdvanced.o
$(NODE_OBJECTS)/$(HOST_TYPE)/memories.o: $(MEMORIES)
$(CC) -I$(SCADE_LIB_DIR) -c $(MEMORIES) -o $@
$(CC) -I$(SCADE_LIB_DIRS) -c $(MEMORIES) -o $@
scade: $(NODE_OBJ)
$(CC) $(DEBUG) $(LIBDIRS) $(INCLUDEDIRS) $(NODE_OBJ) $(LDFLAGS) \
$(CC) $(DEBUG) $(SCADE_LIB_DIRS) $(SCADE_INCLUDE_DIRS) $(NODE_OBJ) $(LDFLAGS) \
$(LIB_GC) $(LIB_OS) $(EXTRA_CFILES) -llurette_lib_nc $(LIBS) -o lurette
......
......@@ -5,17 +5,20 @@
#
if test $# -lt 1
then
echo "usage: gnuplot-rif <rif file> [-plot]"
echo ""
echo "gnuplot-rif generate a .plot file to used by gnuplot"
echo "if -plot option is provided, then it calls gnuplot on the generated file."
exit 1
fi;
case $1 in
-h|-help|--help|"")
echo ""
echo "usage: gnuplot-rif <rif file> [-plot|-ps|-help]"
echo " generates a <rif file>.gp file in a format suitable for gnuplot."
echo ""
echo "The meaning of the possible options is:"
echo " -p, -plot: launch gnuplot to visualize the gp file"
echo " -ps: generates a post-script file and launch gv on it."
echo " -h, -help: display this help message."
echo ""
exit 0
;;
esac
FILE=$1
......@@ -55,14 +58,25 @@ if test -f $FILE ;
# cat $FILE.gp | plot -cps > $FILE.ps
cat $FILE.gp | plot -dump > $FILE.plot
rm $FILE.gp
case $2 in
"")
cat $FILE.gp | plot -dump > $FILE.plot
rm $FILE.gp
;;
-plot|-gnuplot|-print|-p)
cat $FILE.gp | plot -dump > $FILE.plot
rm $FILE.gp
gnuplot $FILE.plot
;;
-ps)
cat $FILE.gp | plot -cps > $FILE.ps
rm $FILE.gp
gv $FILE.ps
;;
*)
cat $FILE.gp | plot $2
rm $FILE.gp
;;
esac
......
#!/bin/sh
# $Id: plot 1.6 Tue, 09 Dec 2003 15:44:28 +0100 jahier $
# $Id: plot 1.7 Mon, 19 Jan 2004 14:36:43 +0100 jahier $
#
# pl: general wrapper script for plotting with gnuplot from shell cmdline
#
......@@ -320,7 +320,7 @@ do
#sep=","
## from gnuplot-3.6beta:
printf "%s\"%s\" us 1:%d ti \"%s\"", \
printf "%s\"%s\" us 1:%d ti %s", \
sep, DATANAME, col, coltitle
sep=", \\\\\n\t"
}
......
# setting usefull environment variables
VERSION=@VERSION@
export VERSION
LURETTE_PATH=@LURETTEPATH@
export LURETTE_PATH
......
......@@ -237,6 +237,9 @@ ltop_debug:
show:
make -k nc -f Makefile.show_luc OCAMLFLAGS="-noassert -unsafe"
show_debug:
make -k dc -f Makefile.show_luc OCAMLFLAGS=""
show_assert:
make -k nc -f Makefile.show_luc OCAMLFLAGS=""
cp show_luc show_luc_assert
......@@ -270,9 +273,9 @@ xlurette:
# in order to perform unit testing
all_assert: clean libnc_assert lucky_assert ltop_assert show_assert stubs_assert \
gen_lut_assert gen_luc_assert
gen_luc_assert
all: libnc lucky ltop show stubs gen_lut gen_luc
all: libnc lucky ltop show stubs gen_luc
clean_exe:
......
......@@ -4,6 +4,8 @@
SOURCES = $(LURETTE_PATH)/source/util.ml \
$(LURETTE_PATH)/source/type.mli \
$(LURETTE_PATH)/source/type.ml \
$(LURETTE_PATH)/source/gen_stubs_common.mli \
$(LURETTE_PATH)/source/gen_stubs_common.ml \
$(LURETTE_PATH)/source/parse_c_scade.mli \
......
......@@ -4,6 +4,9 @@
SOURCES = $(LURETTE_PATH)/source/util.ml \
\
$(LURETTE_PATH)/source/type.mli \
$(LURETTE_PATH)/source/type.ml \
\
$(LURETTE_PATH)/source/gen_stubs_common.mli \
$(LURETTE_PATH)/source/gen_stubs_common.ml \
......
......@@ -33,6 +33,7 @@ USE_CAMLP4 = yes
SOURCES_OCAML = \
$(LURETTE_PATH)/source/util.ml \
$(LURETTE_PATH)/source/type.ml \
$(LURETTE_PATH)/source/thickness.ml \
$(LURETTE_PATH)/source/genlex.ml \
$(LURETTE_PATH)/source/lexeme.ml \
......@@ -67,6 +68,8 @@ SOURCES_OCAML = \
ifndef MLONLY
SOURCES_OCAML := \
$(LURETTE_PATH)/source/util.ml \
$(LURETTE_PATH)/source/type.mli \
$(LURETTE_PATH)/source/type.ml \
$(LURETTE_PATH)/source/thickness.ml \
$(LURETTE_PATH)/source/genlex.mli \
$(LURETTE_PATH)/source/genlex.ml \
......
......@@ -37,6 +37,8 @@ SOURCES_C = ocaml2c.idl call_lurette_main.c
SOURCES = $(SOURCES_C) \
$(LURETTE_PATH)/source/util.ml \
$(LURETTE_PATH)/source/type.mli \
$(LURETTE_PATH)/source/type.ml \
$(LURETTE_PATH)/source/thickness.ml \
$(LURETTE_PATH)/source/genlex.mli \
$(LURETTE_PATH)/source/genlex.ml \
......
......@@ -17,6 +17,8 @@ USE_CAMLP4 = yes
SOURCES_OCAML = \
$(LURETTE_PATH)/source/util.ml \
$(LURETTE_PATH)/source/type.mli \
$(LURETTE_PATH)/source/type.ml \
$(LURETTE_PATH)/source/genlex.mli $(LURETTE_PATH)/source/genlex.ml \
$(LURETTE_PATH)/source/lexeme.mli $(LURETTE_PATH)/source/lexeme.ml \
$(LURETTE_PATH)/source/prevar.mli $(LURETTE_PATH)/source/prevar.ml \
......
......@@ -98,10 +98,10 @@ let (merge_var : Exp.var list -> Exp.var list -> Exp.var list) =
" is defined twice with different type or mode," ^
" which is forbidden.\n\t" ^
(Var.name var1) ^ " of type " ^
(Var.typ_to_string (Var.typ var1)) ^ " as " ^
(Type.to_string (Var.typ var1)) ^ " as " ^
(Var.mode_to_string (Var.mode var1)) ^
" is different from \n\t" ^ (Var.name var2) ^ " of type " ^
(Var.typ_to_string (Var.typ var2))
(Type.to_string (Var.typ var2))
^ " as " ^ (Var.mode_to_string (Var.mode var2)) ^ "\n"
);
exit 1
......@@ -261,7 +261,7 @@ let (read_env_state_one_automaton : t * Exp.var list -> Parse_luc.automata
let (bvl_current0, nvl_current0) =
(* split the Boolean and the numeric vars *)
List.partition
(fun var -> Var.typ var = Var.BoolT)
(fun var -> Var.typ var = Type.BoolT)
(rev_append (fst list_out) (fst list_loc))
in
let (bvl_current1, nvl_current1) =
......@@ -517,7 +517,7 @@ let (dump_env_state_stat : out_channel -> unit) =
(fold_left
(fun acc var ->
acc ^ ", " ^ (Var.name var) ^ ":" ^
(Var.typ_to_string (Var.typ var)))
(Type.to_string (Var.typ var)))
"" env_state.output_vars));
dump "\n";
......
......@@ -198,7 +198,7 @@ let (to_string : t -> string) =
)
let var_to_string var =
((Var.name var) ^ ":" ^ (Var.typ_to_string (Var.typ var)) ^ ":" ^
((Var.name var) ^ ":" ^ (Type.to_string (Var.typ var)) ^ ":" ^
(Var.mode_to_string (Var.mode var))
)
......
......@@ -16,7 +16,7 @@ open Constraint
open Env_state
(** [lookup input pre vn] looks up the value of vn in [pre] and [input] *)
let (lookup: Var.env_in -> Env_state.t -> Exp.var -> Value.t option) =
let rec (lookup: Var.env_in -> Env_state.t -> Exp.var -> Value.t option) =
fun input state var ->
match (Var.mode var) with
| Var.Output -> None
......@@ -51,38 +51,40 @@ let (lookup: Var.env_in -> Env_state.t -> Exp.var -> Value.t option) =
with
(* if not in memory, look at a possible init value *)
Not_found ->
match (Var.init var) with
match (Var.init var) with
| Some (Numer (Ival i)) -> Some (N (I i))
| Some (Numer (Fval f)) -> Some (N (F f))
| Some (Numer (Ivar vi)) -> lookup input state vi
| Some (Numer (Fvar vf)) -> lookup input state vf
| Some (Formu True) -> Some (B true)
| Some (Formu False) -> Some (B false)
| Some (Liste [Nu (Ival i)]) -> Some (N (I i))
| Some _ ->
(* Structured expression ougth to have been
flattened before *)
assert false
| None ->
let cnl = List.flatten state.d.current_nodes in
let nodes_str = String.concat " " cnl in
let node_msg =
if
(List.length cnl) = 1
then
("(current node is " ^ nodes_str ^ ").\n")
else
("(current nodes are " ^ nodes_str ^ ").\n")
in
print_string (
"*** The expression " ^ (Prevar.format (Var.name var))
^ " is undefined at current step " ^ node_msg
^ "*** You need to rewrite your environment"
^ " spec in such a way that no pre is used"
^ " for that variable at that step\n "
^ " or to give it an initial value (with"
^ " the ~init option).\n");
flush stdout;
exit 1
| Some (Liste [Nu (Ival i)]) -> Some (N (I i))
| Some _ ->
(* Structured expression ougth to have been
flattened before *)
assert false
| None ->
let cnl = List.flatten state.d.current_nodes in
let nodes_str = String.concat " " cnl in
let node_msg =
if
(List.length cnl) = 1
then
("(current node is " ^ nodes_str ^ ").\n")
else
("(current nodes are " ^ nodes_str ^ ").\n")
in
print_string (
"*** The expression " ^ (Prevar.format (Var.name var))
^ " is undefined at current step " ^ node_msg
^ "*** You need to rewrite your environment"
^ " spec in such a way that no pre is used"
^ " for that variable at that step\n "
^ " or to give it an initial value (with"
^ " the ~init option).\n");
flush stdout;
exit 1
)
......
......@@ -24,77 +24,48 @@ let usage = "gen_fake_lucky <C header file> <verimag|scade> <dir>
(* open Parse_poc *)
type luckyT = Int | Bool | Real
let (c_type_to_lucky_type : string -> luckyT) =
fun ct ->
(** *)
match ct with
"byte" -> Int
| "short" -> Int
| "short int" -> Int
| "int" -> Int
| "long" -> Int
| "long int" -> Int