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:
rm -f version.tex ; \
date +VERSION_DATE=%d-%m-%y > 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 ;\
[ -d doc/lutin-man/objs ] || mkdir 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/objs/ ;\
cp doc/version.tex doc/lutin-man/
\ No newline at end of file
......@@ -78,9 +78,7 @@ objs:
./objs/version.tex: $(LUTINSRC)/lutVersion.ml Makefile
cat $< | grep "number.*=" | sed -e "s/^.*number.*\"\([^\"]*\)\"/\\\\newcommand{\\\\versionname}{\1}/" > $@
cat $< | grep "release.*=" | sed -e "s/^.*release.*\"\([^\"]*\)\"/\\\\newcommand{\\\\release}{\1}/" >> $@
cat ../version.tex >> $@
cd ../.. ; make gen_version
clean:
rm -f ./objs/*
......
......@@ -18,11 +18,9 @@ abstract types are not yet implemented (coming soon hopefully).
\subsection{Nodes}
Nodes are entry points for \lutin\ programs. Nodes are made of an
interface declaration and a body. \lutin\ nodes cannot be reused in
other \lutin\ nodes (as in \lustre node); they can only be top-level
programs. If one wants to write reusable statements, one can use
combinators (cf Section~\ref{combinators}).
interface declaration and a body. \lutin\ nodes can be reused in
other \lutin\ nodes (as \lustre nodes); they can also be top-level
programs.
\subsubsection{Support variables}
......@@ -494,7 +492,7 @@ the sequel.
{\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:\\
{\tt \key{let} \syn{id} (\syn{Params}) :~\syn{Type} = \syn{St1}
......
......@@ -36,7 +36,8 @@ down (resp up), and so on forever.
\begin{figure}
\includegraphics[width=15cm]{ud.jpg}
\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}
\end{figure}
......
......@@ -47,7 +47,7 @@
\pagestyle{fancy}
\title{\lutin \\ Version \versionname-\version \hspace{.5cm}(\versiondate) }
\title{\lutin Reference manual\\ Version \versionname-\version (sha:\sha)}
\author{Pascal Raymond\\Erwan Jahier}
\begin{document}
......
......@@ -8,3 +8,4 @@ go:
test: go
make -f Makefile.foo && make clean
......@@ -58,7 +58,7 @@ foo: foo.o call_foo.o call_foo_ext_func.o call_foo_loop.o
################################################################
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
ifeq ($(HOSTTYPE),win32)
......
......@@ -8,8 +8,8 @@ CFLAGS = \
-I../../../include $(DEBUG)
LIBS = -lluc4c_nc -llucky_nc -lgmp -lm -ldl -lstdc++
LUC2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c -seed 42
LUC2CSOCK=../../../$(HOSTTYPE)/bin/lutin --2c-4c-socks 127.0.0.1 -seed 42
LUT2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c -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
LUTIN=../../../$(HOSTTYPE)/bin/lutin -seed 42 -only-outputs -exe
......@@ -28,8 +28,8 @@ ifneq (,$(findstring win32,$(HOSTTYPE)))
LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++ -lole32
LIBSSOCK = -lws2_32 -lole32
LUC2C=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c
LUC2CSOCK=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c-socks 127.0.0.1 -seed 42
LUT2C=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c
LUT2CSOCK=../../../$(HOSTTYPE)/bin/lutin.exe --2c-4c-socks 127.0.0.1 -seed 42
endif
ifeq ($(HOSTTYPE),cygwin)
EXE=.exe
......@@ -39,7 +39,7 @@ ifeq ($(HOSTTYPE),cygwin)
-Winline -Wimplicit-function-declaration
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
......@@ -47,7 +47,7 @@ endif
# Calling lucky from C
foo.c: foo.lut
$(LUC2C) foo.lut
$(LUT2C) foo.lut
foo.o : foo.c
$(CC) -c $(CFLAGS) foo.c
......@@ -65,7 +65,7 @@ call_foo_sock.o: call_foo_sock.c
$(CC) -c $(CFLAGS) call_foo_sock.c
sock:
$(LUC2CSOCK) foo.lut
$(LUT2CSOCK) foo.lut
make foo.o
......
......@@ -12,6 +12,9 @@ int main(){
int i = 0;
foo_ctx* ctx;
#ifdef _DEBUG
fp = fopen("debug.log", "w");
#endif
ctx = foo_new_ctx(NULL);
lucky_set_seed(1);
......
......@@ -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_z(foo_ctx* ctx, _real v) { ctx->_z = v; };
// a little main that calls the foo.lut program
int main(){
int i = 0;
......@@ -18,6 +17,8 @@ int main(){
#endif
ctx = foo_new_ctx(NULL);
lucky_set_seed(1);
printf("#inputs \"a\":int \"b\":bool \"c\":real\n");
printf("#outputs \"x\":int \"y\":bool \"z\":real\n");
......
......@@ -91,7 +91,7 @@ utest2:
utest: utest1 utest2
clean:
rm -rf $(OBJDIR) *.rif *.rif0 *.res
rm -rf $(OBJDIR) *.rif *.rif0 *.res *.gp *.plot *.tex
......@@ -2,23 +2,23 @@
#inputs
#outputs "f1":real "f2":real "i":int
#step 1
#outs 87.36 0.84 9
#outs 87.36 0.84 9
#step 2
#outs 61.26 0.08 4
#outs 61.26 0.08 4
#step 3
#outs 31.94 1.00 8
#outs 31.94 1.00 8
#step 4
#outs 64.31 -0.59 8
#outs 64.31 -0.59 8
#step 5
#outs 96.69 0.99 10
#outs 96.69 0.99 10
#step 6
#outs 66.59 -0.40 2
#outs 66.59 -0.40 2
#step 7
#outs 15.51 0.95 3
#outs 15.51 0.95 3
#step 8
#outs 77.29 -0.72 8
#outs 77.29 -0.72 8
#step 9
#outs 26.98 0.59 3
#outs 26.98 0.59 3
#step 10
#outs 24.66 -0.89 6
#outs 24.66 -0.89 6
#end. Max step number reached.
......@@ -33,7 +33,7 @@ $(MAIN):$(MAIN).ml
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 @@
#inputs
#outputs "a":int "b":int "c":int "d":int "e":int
#step 1
#outs 7830685 -100788248 -180225080 -250991873 197072396
#outs 7830685 -100788248 -180225080 -250991873 197072396
#step 2
#outs -149066158 -180031442 -92668403 -117879803 184839769
#outs -149066158 -180031442 -92668403 -117879803 184839769
#step 3
#outs -77141518 49170124 -177856997 -97639089 -94952018
#outs -77141518 49170124 -177856997 -97639089 -94952018
#step 4
#end. Simulation ended normally.
......@@ -2,203 +2,203 @@
#inputs
#outputs "a":bool
#step 1
#outs t
#outs t
#step 2
#outs t
#outs t
#step 3
#outs t
#outs t
#step 4
#outs t
#outs t
#step 5
#outs t
#outs t
#step 6
#outs t
#outs t
#step 7
#outs t
#outs t
#step 8
#outs t
#outs t
#step 9
#outs t
#outs t
#step 10
#outs f
#outs f
#step 11
#outs f
#outs f
#step 12
#outs f
#outs f
#step 13
#outs f
#outs f
#step 14
#outs f
#outs f
#step 15
#outs f
#outs f
#step 16
#outs f
#outs f
#step 17
#outs f
#outs f
#step 18
#outs f
#outs f
#step 19
#outs f
#outs f
#step 20
#outs f
#outs f
#step 21
#outs f
#outs f
#step 22
#outs f
#outs f
#step 23
#outs f
#outs f
#step 24
#outs f
#outs f
#step 25
#outs f
#outs f
#step 26
#outs f
#outs f
#step 27
#outs f
#outs f
#step 28
#outs f
#outs f
#step 29
#outs f
#outs f
#step 30
#outs f
#outs f
#step 31
#outs f
#outs f
#step 32
#outs f
#outs f
#step 33
#outs f
#outs f
#step 34
#outs f
#outs f
#step 35
#outs f
#outs f
#step 36
#outs f
#outs f
#step 37
#outs f
#outs f
#step 38
#outs f
#outs f
#step 39
#outs f
#outs f
#step 40
#outs f
#outs f
#step 41
#outs f
#outs f
#step 42
#outs f
#outs f
#step 43
#outs f
#outs f
#step 44
#outs f
#outs f
#step 45
#outs f
#outs f
#step 46
#outs f
#outs f
#step 47
#outs f
#outs f
#step 48
#outs f
#outs f
#step 49
#outs f
#outs f
#step 50
#outs f
#outs f
#step 51
#outs f
#outs f
#step 52
#outs f
#outs f
#step 53
#outs f
#outs f
#step 54
#outs f
#outs f
#step 55
#outs f
#outs f
#step 56
#outs f
#outs f
#step 57
#outs f
#outs f
#step 58
#outs f
#outs f
#step 59
#outs f
#outs f
#step 60
#outs f
#outs f
#step 61
#outs f
#outs f
#step 62
#outs f
#outs f
#step 63
#outs f
#outs f
#step 64
#outs f
#outs f
#step 65
#outs f
#outs f
#step 66
#outs f
#outs f
#step 67
#outs f
#outs f
#step 68
#outs f
#outs f
#step 69
#outs f
#outs f
#step 70
#outs f
#outs f
#step 71
#outs f
#outs f
#step 72
#outs f
#outs f
#step 73
#outs f
#outs f
#step 74
#outs f
#outs f
#step 75
#outs f
#outs f
#step 76
#outs f
#outs f
#step 77
#outs f
#outs f
#step 78
#outs f
#outs f
#step 79
#outs f
#outs f
#step 80
#outs f
#outs f
#step 81
#outs f
#outs f
#step 82
#outs f
#outs f
#step 83
#outs f
#outs f
#step 84
#outs f
#outs f
#step 85
#outs f
#outs f
#step 86
#outs f
#outs f
#step 87
#outs f
#outs f
#step 88
#outs f
#outs f
#step 89
#outs f
#outs f
#step 90
#outs f
#outs f
#step 91
#outs f
#outs f
#step 92
#outs f
#outs f
#step 93
#outs f
#outs f
#step 94
#outs f
#outs f
#step 95
#outs f
#outs f
#step 96
#outs f
#outs f
#step 97
#outs f
#outs f
#step 98
#outs f
#outs f
#step 99
#outs f
#outs f
#step 100
#outs f
#outs f
#end. Max step number reached.
......@@ -2,11 +2,11 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool
#step 1
#outs t t f f f
#outs t t f f f
#step 2
#outs t f t t f
#outs t f t t f
#step 3
#outs t f t f t
#outs t f t f t
#step 4
#end. Simulation ended normally.
......@@ -2,11 +2,11 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool
#step 1
#outs t t f t t
#outs t t f t t
#step 2
#outs f t t f t
#outs f t t f t
#step 3
#outs f f f t t
#outs f f f t t
#step 4
#end. Simulation ended normally.
......@@ -2,11 +2,11 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool "f":bool
#step 1
#outs t t t f f f
#outs t t t f f f
#step 2
#outs f f f t t t
#outs f f f t t t
#step 3
#outs f f f f f t
#outs f f f f f t
#step 4
#end. Simulation ended normally.
......@@ -2,11 +2,11 @@
#inputs
#outputs "x":bool "y":bool "z":bool "t":bool
#step 1
#outs t t t t
#outs t t t t
#step 2
#outs t t t t
#outs t t t t
#step 3
#outs f t f t
#outs f t f t
#step 4
#end. Simulation ended normally.
......@@ -2,203 +2,203 @@
#inputs
#outputs "x":bool "y":bool "z":bool "t":bool
#step 1
#outs t t t t
#outs t t t t
#step 2
#outs t t t t
#outs t t t t
#step 3
#outs t f t f
#outs t f t f
#step 4
#outs t f t t
#outs t f t t
#step 5
#outs t t f f
#outs t t f f
#step 6
#outs t f f f
#outs t f f f
#step 7
#outs t f t f
#outs t f t f
#step 8
#outs t f t f
#outs t f t f
#step 9
#outs t f f f
#outs t f f f
#step 10
#outs t f t f
#outs t f t f
#step 11
#outs t f t f
#outs t f t f
#step 12
#outs t f t t
#outs t f t t
#step 13
#outs t f t t
#outs t f t t
#step 14
#outs t t f f
#outs t t f f
#step 15
#outs t f f f
#outs t f f f
#step 16