Commit 7bb39435 authored by Erwan Jahier's avatar Erwan Jahier

Plug the --step-edges and --step_vertices option in Lutin.

Fix a bug in the lutin toplevel when using the --precision option..

Also, clean-up the distribution and fix some minor pbs while writing
the lutin tutorial.
parent 30964784
...@@ -29,6 +29,9 @@ gen_version: ...@@ -29,6 +29,9 @@ gen_version:
rm -f version.tex ; \ rm -f version.tex ; \
date +VERSION_DATE=%d-%m-%y > version.tex ; \ date +VERSION_DATE=%d-%m-%y > version.tex ; \
echo "\\\newcommand{\\\version}{$(VERSION)}" > doc/version.tex ; \ echo "\\\newcommand{\\\version}{$(VERSION)}" > doc/version.tex ; \
echo "\\\newcommand{\\\sha}{$(SHA)}" >> doc/version.tex ; \
echo "\\\newcommand{\\\versionname}{Trilby}" >> doc/version.tex ; \
echo "\\\newcommand{\\\versiondate}{`date +%d-%m-%y`}" >> doc/version.tex ;\ echo "\\\newcommand{\\\versiondate}{`date +%d-%m-%y`}" >> doc/version.tex ;\
[ -d doc/lutin-man/objs ] || mkdir doc/lutin-man/objs; \ [ -d doc/lutin-man/objs ] || mkdir doc/lutin-man/objs; \
cp doc/version.tex doc/lutin-man/objs/ cp doc/version.tex doc/lutin-man/objs/ ;\
\ No newline at end of file cp doc/version.tex doc/lutin-man/
\ No newline at end of file
...@@ -78,9 +78,7 @@ objs: ...@@ -78,9 +78,7 @@ objs:
./objs/version.tex: $(LUTINSRC)/lutVersion.ml Makefile ./objs/version.tex: $(LUTINSRC)/lutVersion.ml Makefile
cat $< | grep "number.*=" | sed -e "s/^.*number.*\"\([^\"]*\)\"/\\\\newcommand{\\\\versionname}{\1}/" > $@ cd ../.. ; make gen_version
cat $< | grep "release.*=" | sed -e "s/^.*release.*\"\([^\"]*\)\"/\\\\newcommand{\\\\release}{\1}/" >> $@
cat ../version.tex >> $@
clean: clean:
rm -f ./objs/* rm -f ./objs/*
......
...@@ -17,12 +17,10 @@ abstract types are not yet implemented (coming soon hopefully). ...@@ -17,12 +17,10 @@ abstract types are not yet implemented (coming soon hopefully).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Nodes} \subsection{Nodes}
Nodes are entry points for \lutin\ programs. Nodes are made of an Nodes are entry points for \lutin\ programs. Nodes are made of an
interface declaration and a body. \lutin\ nodes cannot be reused in interface declaration and a body. \lutin\ nodes can be reused in
other \lutin\ nodes (as in \lustre node); they can only be top-level other \lutin\ nodes (as \lustre nodes); they can also be top-level
programs. If one wants to write reusable statements, one can use programs.
combinators (cf Section~\ref{combinators}).
\subsubsection{Support variables} \subsubsection{Support variables}
...@@ -494,7 +492,7 @@ the sequel. ...@@ -494,7 +492,7 @@ the sequel.
{\em Combinator} were introduced in the language to allow code {\em Combinator} were introduced in the language to allow code
reuse. It's a kind of well-types macro. One can define a combinator reuse. It's a kind of well-typed macro. One can define a combinator
with the \key{let} statement:\\ with the \key{let} statement:\\
{\tt \key{let} \syn{id} (\syn{Params}) :~\syn{Type} = \syn{St1} {\tt \key{let} \syn{id} (\syn{Params}) :~\syn{Type} = \syn{St1}
......
...@@ -36,7 +36,8 @@ down (resp up), and so on forever. ...@@ -36,7 +36,8 @@ down (resp up), and so on forever.
\begin{figure} \begin{figure}
\includegraphics[width=15cm]{ud.jpg} \includegraphics[width=15cm]{ud.jpg}
\caption{ \caption{
This image has been obtained with the command {\tt lutin -l 100 ud.lut -main main > ud.rif ;gnuplot-rif -jpg ud.rif} This image has been obtained with the command {\tt lutin -l 100
ud.lut -main main > ud.rif ; gnuplot-rif -jpg ud.rif}
}\label{gnuplot-ud} }\label{gnuplot-ud}
\end{figure} \end{figure}
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
\pagestyle{fancy} \pagestyle{fancy}
\title{\lutin \\ Version \versionname-\version \hspace{.5cm}(\versiondate) } \title{\lutin Reference manual\\ Version \versionname-\version (sha:\sha)}
\author{Pascal Raymond\\Erwan Jahier} \author{Pascal Raymond\\Erwan Jahier}
\begin{document} \begin{document}
......
...@@ -7,4 +7,5 @@ go: ...@@ -7,4 +7,5 @@ go:
../../../$(HOSTTYPE)/bin/luc2c --luciole foo.luc ../../../$(HOSTTYPE)/bin/luc2c --luciole foo.luc
test: go test: go
make -f Makefile.foo && make clean make -f Makefile.foo && make clean
\ No newline at end of file
...@@ -58,7 +58,7 @@ foo: foo.o call_foo.o call_foo_ext_func.o call_foo_loop.o ...@@ -58,7 +58,7 @@ foo: foo.o call_foo.o call_foo_ext_func.o call_foo_loop.o
################################################################ ################################################################
clean: clean:
rm -f run *.o *~ call_foo_ext* call_foo.c call_foo.h call_foo_loop.c call_foo_loop.h foo.h foo.c *.gp *.plot *.rif *.ec foo #* rm -f run *.o *~ call_foo_ext* call_foo.c call_foo.h call_foo_loop.c call_foo_loop.h foo.h foo.c *.gp *.plot *.rif *.ec foo$(EXE) #*
test : clean foo test : clean foo
ifeq ($(HOSTTYPE),win32) ifeq ($(HOSTTYPE),win32)
......
...@@ -8,8 +8,8 @@ CFLAGS = \ ...@@ -8,8 +8,8 @@ CFLAGS = \
-I../../../include $(DEBUG) -I../../../include $(DEBUG)
LIBS = -lluc4c_nc -llucky_nc -lgmp -lm -ldl -lstdc++ LIBS = -lluc4c_nc -llucky_nc -lgmp -lm -ldl -lstdc++
LUC2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c -seed 42 LUT2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c -seed 42
LUC2CSOCK=../../../$(HOSTTYPE)/bin/lutin --2c-4c-socks 127.0.0.1 -seed 42 LUT2CSOCK=../../../$(HOSTTYPE)/bin/lutin --2c-4c-socks 127.0.0.1 -seed 42
CALLVIASOCKET=../../../$(HOSTTYPE)/bin/call-via-socket -addr 127.0.0.1 -port 2001 CALLVIASOCKET=../../../$(HOSTTYPE)/bin/call-via-socket -addr 127.0.0.1 -port 2001
LUTIN=../../../$(HOSTTYPE)/bin/lutin -seed 42 -only-outputs -exe LUTIN=../../../$(HOSTTYPE)/bin/lutin -seed 42 -only-outputs -exe
...@@ -28,8 +28,8 @@ ifneq (,$(findstring win32,$(HOSTTYPE))) ...@@ -28,8 +28,8 @@ ifneq (,$(findstring win32,$(HOSTTYPE)))
LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++ -lole32 LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++ -lole32
LIBSSOCK = -lws2_32 -lole32 LIBSSOCK = -lws2_32 -lole32
LUC2C=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c LUT2C=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c
LUC2CSOCK=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c-socks 127.0.0.1 -seed 42 LUT2CSOCK=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c-socks 127.0.0.1 -seed 42
endif endif
ifeq ($(HOSTTYPE),cygwin) ifeq ($(HOSTTYPE),cygwin)
EXE=.exe EXE=.exe
...@@ -39,7 +39,7 @@ ifeq ($(HOSTTYPE),cygwin) ...@@ -39,7 +39,7 @@ ifeq ($(HOSTTYPE),cygwin)
-Winline -Wimplicit-function-declaration -Winline -Wimplicit-function-declaration
LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++ LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++
LUC2C=../../../$(HOSTTYPE)/bin/luc2c$(EXE) LUT2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c-socks 127.0.0.1 -seed 42
endif endif
...@@ -47,7 +47,7 @@ endif ...@@ -47,7 +47,7 @@ endif
# Calling lucky from C # Calling lucky from C
foo.c: foo.lut foo.c: foo.lut
$(LUC2C) foo.lut $(LUT2C) foo.lut
foo.o : foo.c foo.o : foo.c
$(CC) -c $(CFLAGS) foo.c $(CC) -c $(CFLAGS) foo.c
...@@ -65,7 +65,7 @@ call_foo_sock.o: call_foo_sock.c ...@@ -65,7 +65,7 @@ call_foo_sock.o: call_foo_sock.c
$(CC) -c $(CFLAGS) call_foo_sock.c $(CC) -c $(CFLAGS) call_foo_sock.c
sock: sock:
$(LUC2CSOCK) foo.lut $(LUT2CSOCK) foo.lut
make foo.o make foo.o
......
...@@ -12,6 +12,9 @@ int main(){ ...@@ -12,6 +12,9 @@ int main(){
int i = 0; int i = 0;
foo_ctx* ctx; foo_ctx* ctx;
#ifdef _DEBUG
fp = fopen("debug.log", "w");
#endif
ctx = foo_new_ctx(NULL); ctx = foo_new_ctx(NULL);
lucky_set_seed(1); lucky_set_seed(1);
......
...@@ -7,7 +7,6 @@ void foo_O_x(foo_ctx* ctx, _int v) { ctx->_x = v; }; ...@@ -7,7 +7,6 @@ void foo_O_x(foo_ctx* ctx, _int v) { ctx->_x = v; };
void foo_O_y(foo_ctx* ctx, _bool v) { ctx->_y = v; }; void foo_O_y(foo_ctx* ctx, _bool v) { ctx->_y = v; };
void foo_O_z(foo_ctx* ctx, _real v) { ctx->_z = v; }; void foo_O_z(foo_ctx* ctx, _real v) { ctx->_z = v; };
// a little main that calls the foo.lut program // a little main that calls the foo.lut program
int main(){ int main(){
int i = 0; int i = 0;
...@@ -18,6 +17,8 @@ int main(){ ...@@ -18,6 +17,8 @@ int main(){
#endif #endif
ctx = foo_new_ctx(NULL); ctx = foo_new_ctx(NULL);
lucky_set_seed(1);
printf("#inputs \"a\":int \"b\":bool \"c\":real\n"); printf("#inputs \"a\":int \"b\":bool \"c\":real\n");
printf("#outputs \"x\":int \"y\":bool \"z\":real\n"); printf("#outputs \"x\":int \"y\":bool \"z\":real\n");
......
...@@ -55,7 +55,7 @@ node main(T : real; On : bool) returns (t: real) = ...@@ -55,7 +55,7 @@ node main(T : real; On : bool) returns (t: real) =
-- t = ( 3.0 * (pre t) + T ) / 4.0 -- t = ( 3.0 * (pre t) + T ) / 4.0
--} --}
loop [pre cpt, pre cpt] { loop [pre cpt, pre cpt] {
delta = 0.0 and cpt = pre cpt and delta = 0.0 and cpt = pre cpt and
t = ( 3.0 * (pre t) + T ) / 4.0 t = ( 3.0 * (pre t) + T ) / 4.0
} }
} }
......
...@@ -91,7 +91,7 @@ utest2: ...@@ -91,7 +91,7 @@ utest2:
utest: utest1 utest2 utest: utest1 utest2
clean: clean:
rm -rf $(OBJDIR) *.rif *.rif0 *.res rm -rf $(OBJDIR) *.rif *.rif0 *.res *.gp *.plot *.tex
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
#inputs #inputs
#outputs "f1":real "f2":real "i":int #outputs "f1":real "f2":real "i":int
#step 1 #step 1
#outs 87.36 0.84 9 #outs 87.36 0.84 9
#step 2 #step 2
#outs 61.26 0.08 4 #outs 61.26 0.08 4
#step 3 #step 3
#outs 31.94 1.00 8 #outs 31.94 1.00 8
#step 4 #step 4
#outs 64.31 -0.59 8 #outs 64.31 -0.59 8
#step 5 #step 5
#outs 96.69 0.99 10 #outs 96.69 0.99 10
#step 6 #step 6
#outs 66.59 -0.40 2 #outs 66.59 -0.40 2
#step 7 #step 7
#outs 15.51 0.95 3 #outs 15.51 0.95 3
#step 8 #step 8
#outs 77.29 -0.72 8 #outs 77.29 -0.72 8
#step 9 #step 9
#outs 26.98 0.59 3 #outs 26.98 0.59 3
#step 10 #step 10
#outs 24.66 -0.89 6 #outs 24.66 -0.89 6
#end. Max step number reached. #end. Max step number reached.
...@@ -33,7 +33,7 @@ $(MAIN):$(MAIN).ml ...@@ -33,7 +33,7 @@ $(MAIN):$(MAIN).ml
clean: clean:
rm -f *.top *.cmi *.cmo *.cmx *.o *.cma *.cmxa *.a *.cmi *.cmo *.cmi *.cmx *.o *~ $(MAIN) $(MAIN).opt *~ *.pp_luc *.rif test.res rm -f *.top *.cmi *.cmo *.cmx *.o *.cma *.cmxa *.a *.cmi *.cmo *.cmi *.cmx *.o *~ $(MAIN) $(MAIN).opt *~ *.pp_luc *.rif test.res *.gp *.plot
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
#inputs #inputs
#outputs "a":int "b":int "c":int "d":int "e":int #outputs "a":int "b":int "c":int "d":int "e":int
#step 1 #step 1
#outs 7830685 -100788248 -180225080 -250991873 197072396 #outs 7830685 -100788248 -180225080 -250991873 197072396
#step 2 #step 2
#outs -149066158 -180031442 -92668403 -117879803 184839769 #outs -149066158 -180031442 -92668403 -117879803 184839769
#step 3 #step 3
#outs -77141518 49170124 -177856997 -97639089 -94952018 #outs -77141518 49170124 -177856997 -97639089 -94952018
#step 4 #step 4
#end. Simulation ended normally. #end. Simulation ended normally.
...@@ -2,203 +2,203 @@ ...@@ -2,203 +2,203 @@
#inputs #inputs
#outputs "a":bool #outputs "a":bool
#step 1 #step 1
#outs t #outs t
#step 2 #step 2
#outs t #outs t
#step 3 #step 3
#outs t #outs t
#step 4 #step 4
#outs t #outs t
#step 5 #step 5
#outs t #outs t
#step 6 #step 6
#outs t #outs t
#step 7 #step 7
#outs t #outs t
#step 8 #step 8
#outs t #outs t
#step 9 #step 9
#outs t #outs t
#step 10 #step 10
#outs f #outs f
#step 11 #step 11
#outs f #outs f
#step 12 #step 12
#outs f #outs f
#step 13 #step 13
#outs f #outs f
#step 14 #step 14
#outs f #outs f
#step 15 #step 15
#outs f #outs f
#step 16 #step 16
#outs f #outs f
#step 17 #step 17
#outs f #outs f
#step 18 #step 18
#outs f #outs f
#step 19 #step 19
#outs f #outs f
#step 20 #step 20
#outs f #outs f
#step 21 #step 21
#outs f #outs f
#step 22 #step 22
#outs f #outs f
#step 23 #step 23
#outs f #outs f
#step 24 #step 24
#outs f #outs f
#step 25 #step 25
#outs f #outs f
#step 26 #step 26
#outs f #outs f
#step 27 #step 27
#outs f #outs f
#step 28 #step 28
#outs f #outs f
#step 29 #step 29
#outs f #outs f
#step 30 #step 30
#outs f #outs f
#step 31 #step 31
#outs f #outs f
#step 32 #step 32
#outs f #outs f
#step 33 #step 33
#outs f #outs f
#step 34 #step 34
#outs f #outs f
#step 35 #step 35
#outs f #outs f
#step 36 #step 36
#outs f #outs f
#step 37 #step 37
#outs f #outs f
#step 38 #step 38
#outs f #outs f
#step 39 #step 39
#outs f #outs f
#step 40 #step 40
#outs f #outs f
#step 41 #step 41
#outs f #outs f
#step 42 #step 42
#outs f #outs f
#step 43 #step 43
#outs f #outs f
#step 44 #step 44
#outs f #outs f
#step 45 #step 45
#outs f #outs f
#step 46 #step 46
#outs f #outs f
#step 47 #step 47
#outs f #outs f
#step 48 #step 48
#outs f #outs f
#step 49 #step 49
#outs f #outs f
#step 50 #step 50
#outs f #outs f
#step 51 #step 51
#outs f #outs f
#step 52 #step 52
#outs f #outs f
#step 53 #step 53
#outs f #outs f
#step 54 #step 54
#outs f #outs f
#step 55 #step 55
#outs f #outs f
#step 56 #step 56
#outs f #outs f
#step 57 #step 57
#outs f #outs f
#step 58 #step 58
#outs f #outs f
#step 59 #step 59
#outs f #outs f
#step 60 #step 60
#outs f #outs f
#step 61 #step 61
#outs f #outs f
#step 62 #step 62
#outs f #outs f
#step 63 #step 63
#outs f #outs f
#step 64 #step 64
#outs f #outs f
#step 65 #step 65
#outs f #outs f
#step 66 #step 66
#outs f #outs f
#step 67 #step 67
#outs f #outs f
#step 68 #step 68
#outs f #outs f
#step 69 #step 69
#outs f #outs f
#step 70 #step 70
#outs f #outs f
#step 71 #step 71
#outs f #outs f
#step 72 #step 72
#outs f #outs f
#step 73 #step 73
#outs f #outs f
#step 74 #step 74
#outs f #outs f
#step 75 #step 75
#outs f #outs f
#step 76 #step 76
#outs f #outs f
#step 77 #step 77
#outs f #outs f
#step 78 #step 78
#outs f #outs f
#step 79 #step 79
#outs f #outs f
#step 80 #step 80
#outs f #outs f
#step 81 #step 81
#outs f #outs f