Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit cbed4829 authored by erwan's avatar erwan
Browse files

git add or git ignore untracked files.

parent 0f939d61
......@@ -36,6 +36,7 @@ src/lexer.mli
xx
xxx
bin
#*
*.output
*.lnk
camlidl-*
......@@ -204,6 +205,7 @@ examples/lutin/catherine
examples/lutin/simplice
examples/lutin/chaouki
*.annot
*.seed
*.out
VALORISATION
examples/*/*/*.*.*/
......@@ -245,3 +247,26 @@ sh/
Makefile.common.source
TODO
user-rules
GBDDML
RUN_ME
README-*
LIMITATIONS.portage_scade
TODO.SCADEGUI
doc/lutin-tuto/mes_styles.css
doc/lutin-tuto/my-rdbg-tuning.ml
doc/lutin-tuto/theme-bigblow.setup
doc/lutin-tuto/worg-classic.css
doc/lutin-tuto/worg-r1.css
doc/lutin-tuto/worg-zenburn.css
examples/lutin/xlurette/call-luciole/my-rdbg-tuning.ml
install/
lnsw
lnsw-clean
lutin.native
polka/C/
polka/caml/
source/
src/
#######################################################################################
# Workflow:
# C=git commit ; A=git amend ; U=update_version ; OP=opam pack
# to make sure the sha and the version are good, one should never
# do U and then A.
# to avoid such problems, legal trace are defined by this automata:
# C=git commit ; A=git amend ; U=update_version ; P=opam pack
# - to make sure the sha and the version are good, one should never
# do U and then A.
# - to make sure gtit is not confused, one should never do A and the P
#
# thereforeto avoid such problems, legal trace are defined by this automata:
# 0 -C-> 1
# 1 -OP-> 1
# 1 -A-> 1
# 1 -P-> 2
# 2 -U-> 0
# 1 -U-> 0
# to implement such a workflow, C puts a lock (state 1) and U removes it (state 0)
# To enforce its use, one has to use git via "make uv/ci/cia/amend"
###############################
# a few git shortcuts
......@@ -34,10 +37,13 @@ ci:
echo "*** I won't commit!\n*** until you 'make update_version'!" \
|| (git commit -F log && touch committed)
push:
git push && make uv
amend:
test -f committed && git commit -a -F log --amend
dif:
git --no-pager diff --color-words
diff:dodiff
......
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>A Lutin Tutorial</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="title" content="A Lutin Tutorial"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2017-04-13 11:53:23 CEST"/>
<meta name="author" content="Erwan Jahier"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right {margin-left:auto; margin-right:0px; text-align:right;}
.left {margin-left:0px; margin-right:auto; text-align:left;}
.center {margin-left:auto; margin-right:auto; text-align:center;}
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
th.right { text-align:center; }
th.left { text-align:center; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<style type="text/css">pre{background-color: #232323; color: #E6E1DC;}</style>
<style type="text/css">blockquote{border: 1px solid #CCC; background-color: #E6E1DC; color: #232323;}</style>
<link rel="stylesheet" type="text/css" href="worg-zenburn.css" />
<script type="text/javascript" src="http://orgmode.org/org-info.js"></script>
<script type="text/javascript" >
<!--/*--><![CDATA[/*><!--*/
org_html_manager.set("TOC_DEPTH", "2");
org_html_manager.set("LINK_HOME", "http://www-verimag.imag.fr/Lutin.html");
org_html_manager.set("LINK_UP", "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/doc/lutin-tuto/lutin-tuto-html.html");
org_html_manager.set("LOCAL_TOC", "1");
org_html_manager.set("VIEW_BUTTONS", "1");
org_html_manager.set("MOUSE_HINT", "underline");
org_html_manager.set("FIXED_TOC", "0");
org_html_manager.set("TOC", "2");
org_html_manager.set("VIEW", "info");
org_html_manager.setup(); // activate after the parameters are set
/*]]>*///-->
</script>
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
<script type="text/javascript" src="http://orgmode.org/mathjax/MathJax.js">
<!--/*--><![CDATA[/*><!--*/
MathJax.Hub.Config({
// Only one of the two following lines, depending on user settings
// First allows browser-native MathML display, second forces HTML/CSS
// config: ["MMLorHTML.js"], jax: ["input/TeX"],
jax: ["input/TeX", "output/HTML-CSS"],
extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js",
"TeX/noUndefined.js"],
tex2jax: {
inlineMath: [ ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"], ["\\begin{displaymath}","\\end{displaymath}"] ],
skipTags: ["script","noscript","style","textarea","pre","code"],
ignoreClass: "tex2jax_ignore",
processEscapes: false,
processEnvironments: true,
preview: "TeX"
},
showProcessingMessages: true,
displayAlign: "center",
displayIndent: "2em",
"HTML-CSS": {
scale: 100,
availableFonts: ["STIX","TeX"],
preferredFont: "TeX",
webFont: "TeX",
imageFont: "TeX",
showMathMenu: true,
},
MMLorHTML: {
prefer: {
MSIE: "MML",
Firefox: "MML",
Opera: "HTML",
other: "HTML"
}
}
});
/*]]>*///-->
</script>
</head>
<body>
<div id="org-div-home-and-up" style="text-align:right;font-size:70%;white-space:nowrap;">
<a accesskey="h" href="http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/doc/lutin-tuto/lutin-tuto-html.html"> UP </a>
|
<a accesskey="H" href="http://www-verimag.imag.fr/Lutin.html"> HOME </a>
</div>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">A Lutin Tutorial</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Forewords</a>
<ul>
<li><a href="#sec-1-1">1.1 Motivations: testing reactive programs</a></li>
<li><a href="#sec-1-2">1.2 Lutin in one slide</a></li>
<li><a href="#sec-1-3">1.3 In order to run this tutorial</a></li>
<li><a href="#sec-1-4">1.4 In order to run the demo from the pdf slides</a></li>
</ul>
</li>
<li><a href="#sec-2">2 Execute Lutin programs</a>
<ul>
<li><a href="#sec-2-1">2.1 Stimulate Lutin programs</a>
<ul>
<li><a href="#sec-2-1-1">2.1.1 A program that increments its input</a></li>
<li><a href="#sec-2-1-2">2.1.2 A program with no input</a></li>
<li><a href="#sec-2-1-3">2.1.3 Be quiet</a></li>
</ul>
</li>
<li><a href="#sec-2-2">2.2 Stimulate Lutin programs graphically with <code>luciole</code></a></li>
<li><a href="#sec-2-3">2.3 Store and Display the produced data: <code>sim2chro</code> and <code>gnuplot-rif</code></a>
<ul>
<li><a href="#sec-2-3-1">2.3.1 Generate a RIF file</a></li>
<li><a href="#sec-2-3-2">2.3.2 Visualize a RIF file</a></li>
<li><a href="#sec-2-3-3">2.3.3 Visualize a RIF file (bis)</a></li>
<li><a href="#sec-2-3-4">2.3.4 Visualize a RIF file (ter)</a></li>
</ul>
</li>
<li><a href="#sec-2-4">2.4 Automatic stimulation of Lutin programs</a></li>
</ul>
</li>
<li><a href="#sec-3">3 The Lutin Language</a>
<ul>
<li><a href="#sec-3-1">3.1 Back to programs of Section 1</a>
<ul>
<li><a href="#sec-3-1-1">3.1.1 We said said that the first one, incr.lut increments its input by one. Let's explain why.</a></li>
</ul>
</li>
<li><a href="#sec-3-2">3.2 Non deterministic programs</a>
<ul>
<li><a href="#sec-3-2-1">3.2.1 A First non-deterministic program</a></li>
<li><a href="#sec-3-2-2">3.2.2 It is possible to set the variable range at declaration time,</a></li>
</ul>
</li>
<li><a href="#sec-3-3">3.3 Non deterministic programs (cont)</a></li>
<li><a href="#sec-3-4">3.4 Non deterministic programs (cont)</a></li>
<li><a href="#sec-3-5">3.5 Non deterministic programs (cont)</a></li>
<li><a href="#sec-3-6">3.6 Controlled non-determinism: the choice operator</a></li>
<li><a href="#sec-3-7">3.7 Controlled non-determinism: the choice operator</a></li>
<li><a href="#sec-3-8">3.8 Combinators</a>
<ul>
<li><a href="#sec-3-8-1">3.8.1 A simple combinator</a></li>
</ul>
</li>
<li><a href="#sec-3-9">3.9 A parametric combinator</a></li>
<li><a href="#sec-3-10">3.10 Combinators (cont)</a>
<ul>
<li><a href="#sec-3-10-1">3.10.1 A combinator that needs memory (<code>ref</code>)</a></li>
</ul>
</li>
<li><a href="#sec-3-11">3.11 Local variables</a></li>
<li><a href="#sec-3-12">3.12 Local variables again</a></li>
<li><a href="#sec-3-13">3.13 Distribute a constraint into a scope: <code>assert</code></a></li>
<li><a href="#sec-3-14">3.14 External code</a></li>
<li><a href="#sec-3-15">3.15 Exceptions</a>
<ul>
<li><a href="#sec-3-15-1">3.15.1 Global exceptions can be declared outside the main node:</a></li>
<li><a href="#sec-3-15-2">3.15.2 or locally within a trace statement:</a></li>
<li><a href="#sec-3-15-3">3.15.3 An existing exception ident can be raised with the statement:</a></li>
<li><a href="#sec-3-15-4">3.15.4 An exception can be caught with the statement:</a></li>
</ul>
</li>
<li><a href="#sec-3-16">3.16 Exceptions (cont)</a></li>
<li><a href="#sec-3-17">3.17 Exceptions (cont)</a></li>
<li><a href="#sec-3-18">3.18 Combinators (again)</a>
<ul>
<li><a href="#sec-3-18-1">3.18.1 Trace Combinators</a></li>
</ul>
</li>
<li><a href="#sec-3-19">3.19 Parallelism: <code>&amp;&gt;</code></a></li>
</ul>
</li>
<li><a href="#sec-4">4 The <code>run</code> operator</a>
<ul>
<li><a href="#sec-4-1">4.1 Cheap parallelism: Calling Lutin nodes <code>run/in</code></a></li>
<li><a href="#sec-4-2">4.2 Cheap parallelism: Calling Lutin nodes <code>run/in</code></a></li>
<li><a href="#sec-4-3">4.3 Why does the <code>run/in</code> statement is important?</a></li>
</ul>
</li>
<li><a href="#sec-5">5 Advanced examples</a>
<ul>
<li><a href="#sec-5-1">5.1 Wearing sensors</a></li>
<li><a href="#sec-5-2">5.2 Waiting for the stability of a signal</a>
<ul>
<li><a href="#sec-5-2-1">5.2.1 The Lutin version</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Forewords</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> Motivations: testing reactive programs</h3>
<div class="outline-text-3" id="text-1-1">
<p>
<img src="./demarche-it-en.png" alt="./demarche-it-en.png" />
</p>
<p>
Lutin aims at facilitating the writing of SUT environments, seen as
non-deterministic reactive machines.
</p>
</div>
</div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2"><span class="section-number-3">1.2</span> Lutin in one slide</h3>
<div class="outline-text-3" id="text-1-2">
<ul>
<li>Lustre-like: Dataflow, parallelism, modular, logic time, <code>pre</code>.
</li>
<li>But not exactly Lustre though
<ul>
<li>Plus
<ul>
<li><b>Control structure</b> operators (regular expressions)
</li>
<li><b>Stochastic</b> (controlled and pseudo-Aleatory)
</li>
</ul>
</li>
<li>Minus
<ul>
<li>No implicit top-level loop
</li>
<li>No topological sort of equations
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1-3" class="outline-3">
<h3 id="sec-1-3"><span class="section-number-3">1.3</span> In order to run this tutorial</h3>
<div class="outline-text-3" id="text-1-3">
<p>
You first need to install opam. For instance, on debian-like boxes do
</p>
<pre class="src src-sh">sudo apt-get install opam
opam init ; opam switch 4.04.0 ; <span style="color: #DCDCCC; font-weight: bold;">eval</span> <span style="color: #CC9393;">`opam config env`</span>
</pre>
<p>
and then do:
</p>
<pre class="src src-sh">sudo apt-get install gnuplot tcl
opam repo add verimag-sync-repo <span style="color: #CC9393;">"http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository"</span>
opam update
opam install lutin
</pre>
<p>
and also the Lustre V4 distribution (for luciole and sim2chro)
<a href="http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/index.html">http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/index.html</a>
</p>
<p>
Basically, to get all the tools necessary to run this tutorial accessible
from ypour path, you should have something like that in your <code>.bashrc</code> :
</p>
<pre class="src src-sh"><span style="color: #5F7F5F;"># </span><span style="color: #7F9F7F;">for lutin, gnuplot-rif, luciole-rif</span>
. ~/.opam/opam-init/init.sh &gt; /dev/null 2&gt; /dev/null || <span style="color: #DCDCCC; font-weight: bold;">true</span>
<span style="color: #5F7F5F;"># </span><span style="color: #7F9F7F;">for simec (luciole), sim2chrogtk </span>
<span style="color: #DCDCCC; font-weight: bold;">export</span> <span style="color: #DFAF8F;">LUSTRE_INSTALL</span>=~/lustre-v4-xxx
<span style="color: #DCDCCC; font-weight: bold;">source</span> $<span style="color: #DFAF8F;">LUSTRE_INSTALL</span>/setenv.sh
</pre>
</div>
</div>
<div id="outline-container-1-4" class="outline-3">
<h3 id="sec-1-4"><span class="section-number-3">1.4</span> In order to run the demo from the pdf slides</h3>
<div class="outline-text-3" id="text-1-4">
<p>
You can edit (on linux boxes) your <code>~/.xpdfrc</code> resource
file modify the <code>urlCommand</code> rule:
</p>
<pre class="src src-sh">urlCommand <span style="color: #CC9393;">"browserhook.sh '%s'"</span>
</pre>
<ul>
<li>Download the bash script <a href="http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/sh/browserhook.sh">browserhook.sh (link to the script)</a>
</li>
<li>Make it executable and available from your path
</li>
<li>Then the green link should launch the corresponding shell command,
<ul>
<li>A <a href="http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/doc/lutin-tuto/lutin-tuto-handout.pdf">pdf version of this tutorial</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Execute Lutin programs</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Stimulate Lutin programs</h3>
<div class="outline-text-3" id="text-2-1">
<p>
Before learning the <a href="http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/doc/lutin-man.pdf">language</a>, let's have a look at a
couple of tools that will allow us to play with our Lutin programs.
</p>
<p>
The Lutin program command-line interpreter is a stand-alone
executable named <code>lutin</code>. This program ougth to be
accessible from your path if you have followed the instr
</p>
</div>
<div id="outline-container-2-1-1" class="outline-4">
<h4 id="sec-2-1-1"><span class="section-number-4">2.1.1</span> A program that increments its input</h4>
<div class="outline-text-4" id="text-2-1-1">
<p>
Let's consider the following Lutin program named <a href="./incr.lut">incr.lut</a>.
</p>
<pre class="src src-lutin"><span style="color: #F0DFAF; font-weight: bold;">node</span> incr(x:<span style="color: #7CB8BB;">int</span>) <span style="color: #F0DFAF; font-weight: bold;">returns</span> (y:<span style="color: #7CB8BB;">int</span>) =
<span style="color: #DCDCCC; font-weight: bold;">loop</span> [10] y = x+1
</pre>
<pre class="src src-sh">&lt;prompt&gt; lutin incr.lut
</pre>
<pre class="example"># This is lutin Version 1.54 (9e783b6)
# The random engine was initialized with the seed 817281206
#inputs "x":int
#outputs "y":int
#step 1
</pre>
<p>
This is a <a href="#reactive-program">reactive program</a> that returns its input, incremented by 1,
forever. We'll explain why later. For the moment, let's simply
execute it using <code>lutin</code> from a shell:
</p>
<p>
At this stage, <code>lutin</code> waits for an integer input to continue. If we
feed it with a <code>1</code> (type <code>1&lt;enter&gt;</code>), it returns 2. If we enter 41,
it returns 42. To quit this infinite loop gently, just enter the
character <code>q</code>.
</p>
<pre class="src src-rif">&lt;promt&gt; lutin incr.lut
$ 1
1 <span style="color: #93E0E3;">#</span><span style="color: #CC9393;">outs</span> 2
<span style="color: #93E0E3;">#</span><span style="color: #CC9393;">step</span> 2
$ 41
41 <span style="color: #93E0E3;">#</span><span style="color: #CC9393;">outs</span> 42
<span style="color: #93E0E3;">#</span><span style="color: #CC9393;">step</span> 3
$ q
q<span style="color: #93E0E3;">#</span> bye!
<span style="color: #93E0E3;">#</span>end.
</pre>
</div>