From 1041bec537026eefde2866ede2a30f681eaf125e Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Mon, 3 Jun 2013 11:02:58 +0200
Subject: [PATCH] Fix a bug in the implementation of diese (#).

Actually, it was a misunderstanding of mine (R1) ; the behavior was consistent
with the lv6 doc, but not with the v4 behavior...

Indeed, # means "at most 1 among n", not "exactly one among n" as I tought...
---
 lv6-ref-man/Makefile            | 11 +++++------
 lv6-ref-man/lv6-ref-man.tex     |  2 +-
 src/l2lExpandMetaOp.ml          |  6 +++---
 src/socPredef.ml                |  4 ++--
 test/lus2lic.sum                | 18 +++++++++++-------
 test/lus2lic.time               |  4 ++--
 test/should_work/test_diese.lus |  6 ++++++
 todo.org                        | 12 +++++-------
 8 files changed, 35 insertions(+), 28 deletions(-)
 create mode 100644 test/should_work/test_diese.lus

diff --git a/lv6-ref-man/Makefile b/lv6-ref-man/Makefile
index fd2fc3af..6ab90006 100644
--- a/lv6-ref-man/Makefile
+++ b/lv6-ref-man/Makefile
@@ -56,8 +56,7 @@ SUMMARY=$(OBJPDF)/syntax_summary.tex
 
 
 # target: mly 2 latex
-PARSER=$(OBJPDF)/parser.tex
-
+PARSER=$(OBJPDF)/lv6parser.tex
 
 all: $(OBJPDF) $(MAIN).pdf
 
@@ -108,12 +107,12 @@ clean:
 #------------------------------
 # Special : mly 2 latex
 #------------------------------
-$(PARSER): ../src/parser.mly lustokens
-	mly2bnf ../src/parser.mly  -t lustokens | grep -v XXX > $@
+$(PARSER): ../src/lv6parser.mly lustokens
+	mly2bnf ../src/lv6parser.mly  -t lustokens | grep -v XXX > $@
 
 rere:
-	touch ../src/parser.mly
-	make parser
+	touch ../src/lv6parser.mly
+	make lv6parser
 	make re 
 re:
 	touch touch.tex
diff --git a/lv6-ref-man/lv6-ref-man.tex b/lv6-ref-man/lv6-ref-man.tex
index 0e2f5ab4..bb88f143 100644
--- a/lv6-ref-man/lv6-ref-man.tex
+++ b/lv6-ref-man/lv6-ref-man.tex
@@ -1532,7 +1532,7 @@ diese and the nor operators :
 
 \begin{example}[boolred]
  \begin{program}
-#(a1, ..., an) \evalto boolred(1,1,n)[a1, ..., an] \\
+#(a1, ..., an) \evalto boolred(0,1,n)[a1, ..., an] \\
 
 nor(a1, ..., an) \evalto boolred(0,0,n)[a1, ..., an]
  \end{program}
diff --git a/src/l2lExpandMetaOp.ml b/src/l2lExpandMetaOp.ml
index 53d75b46..78c87ce4 100644
--- a/src/l2lExpandMetaOp.ml
+++ b/src/l2lExpandMetaOp.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 11/04/2013 (at 17:33) by Erwan Jahier> *)
+(** Time-stamp: <modified the 03/06/2013 (at 10:50) by Erwan Jahier> *)
 
 open Lxm
 open Lic
@@ -392,10 +392,10 @@ let rec (create_meta_op_body:  local_ctx -> Lic.node_key -> Lic.node_body * var_
       )
       | "Lustre", "diese" -> (
         (* a diese is a particular kind of boolred:
-           #(A,...,an) = boolred(1,1,n)([a1,...,an])
+           #(A,...,an) = boolred(0,1,n)([a1,...,an])
         *)
         let n = List.length lctx.node.Lic.inlist_eff in
-        create_boolred_body lctx 1 1 n 
+        create_boolred_body lctx 0 1 n 
       )
       | "Lustre", "nor" -> (
         (* a nor is a particular kind of boolred too:
diff --git a/src/socPredef.ml b/src/socPredef.ml
index ff5b28b4..1db21156 100644
--- a/src/socPredef.ml
+++ b/src/socPredef.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 28/05/2013 (at 10:48) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/06/2013 (at 10:51) by Erwan Jahier> *)
 
 (** Synchronous Object Code for Predefined operators. *)
 
@@ -270,7 +270,7 @@ let of_soc_key : Soc.key -> Soc.t =
               lxm      = Lxm.dummy "diese soc";
               idx_ins  = [0];
               idx_outs = [0];
-              impl     = Boolred(1,1, size);
+              impl     = Boolred(0,1, size);
             }
           ];
           Soc.have_mem    = None;
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index fdbac860..30ca3075 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,4 +1,4 @@
-Test Run By jahier on Mon Jun  3 10:16:04 2013
+Test Run By jahier on Mon Jun  3 10:54:00 2013
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -318,7 +318,7 @@ PASS: ../utils/test_lus2lic_no_node should_work/xx.lus
 PASS: ./lus2lic {-o /tmp/call07.lic should_work/call07.lus}
 PASS: ./lus2lic {-ec -o /tmp/call07.ec should_work/call07.lus}
 PASS: ./myec2c {-o /tmp/call07.c /tmp/call07.ec}
-FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/call07.lus
+PASS: ../utils/test_lus2lic_no_node should_work/call07.lus
 PASS: ./lus2lic {-o /tmp/shift_ludic.lic should_work/shift_ludic.lus}
 PASS: ./lus2lic {-ec -o /tmp/shift_ludic.ec should_work/shift_ludic.lus}
 PASS: ./myec2c {-o /tmp/shift_ludic.c /tmp/shift_ludic.ec}
@@ -351,6 +351,10 @@ PASS: ./lus2lic {-o /tmp/bred.lic should_work/bred.lus}
 PASS: ./lus2lic {-ec -o /tmp/bred.ec should_work/bred.lus}
 PASS: ./myec2c {-o /tmp/bred.c /tmp/bred.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/bred.lus
+PASS: ./lus2lic {-o /tmp/test_diese.lic should_work/test_diese.lus}
+PASS: ./lus2lic {-ec -o /tmp/test_diese.ec should_work/test_diese.lus}
+PASS: ./myec2c {-o /tmp/test_diese.c /tmp/test_diese.ec}
+PASS: ../utils/test_lus2lic_no_node should_work/test_diese.lus
 PASS: ./lus2lic {-o /tmp/tri.lic should_work/tri.lus}
 PASS: ./lus2lic {-ec -o /tmp/tri.ec should_work/tri.lus}
 PASS: ./myec2c {-o /tmp/tri.c /tmp/tri.ec}
@@ -589,7 +593,7 @@ PASS: ../utils/test_lus2lic_no_node should_work/impl_priority.lus
 PASS: ./lus2lic {-o /tmp/exclusion.lic should_work/exclusion.lus}
 PASS: ./lus2lic {-ec -o /tmp/exclusion.ec should_work/exclusion.lus}
 PASS: ./myec2c {-o /tmp/exclusion.c /tmp/exclusion.ec}
-FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/exclusion.lus
+PASS: ../utils/test_lus2lic_no_node should_work/exclusion.lus
 PASS: ./lus2lic {-o /tmp/ply01.lic should_work/ply01.lus}
 PASS: ./lus2lic {-ec -o /tmp/ply01.ec should_work/ply01.lus}
 PASS: ./myec2c {-o /tmp/ply01.c /tmp/ply01.ec}
@@ -1016,9 +1020,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
 
 		=== lus2lic Summary ===
 
-# of expected passes		859
-# of unexpected failures	87
+# of expected passes		865
+# of unexpected failures	85
 # of unexpected successes	21
 # of expected failures		37
-testcase ./lus2lic.tests/non-reg.exp completed in 201 seconds
-testcase ./lus2lic.tests/progression.exp completed in 1 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 177 seconds
+testcase ./lus2lic.tests/progression.exp completed in 0 seconds
diff --git a/test/lus2lic.time b/test/lus2lic.time
index 61519a79..de461d9f 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,2 +1,2 @@
-testcase ./lus2lic.tests/non-reg.exp completed in 201 seconds
-testcase ./lus2lic.tests/progression.exp completed in 1 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 177 seconds
+testcase ./lus2lic.tests/progression.exp completed in 0 seconds
diff --git a/test/should_work/test_diese.lus b/test/should_work/test_diese.lus
new file mode 100644
index 00000000..65e2750a
--- /dev/null
+++ b/test/should_work/test_diese.lus
@@ -0,0 +1,6 @@
+-- Test de l'operateur diese
+
+node test_diese(a:bool; b:bool) returns ( res: bool);
+let
+	res =  #(a,b);
+tel
diff --git a/todo.org b/todo.org
index a5e89aea..9934566f 100644
--- a/todo.org
+++ b/todo.org
@@ -17,14 +17,12 @@ oops: lus2lic internal error
 	File "objlinux/socExec.ml", line 202, column 22
  when compiling lustre program should_work/simple.lus
 
-** TODO il reste des pbs de portée de nom
-   - State "TODO"       from ""           [2013-06-03 Mon 09:56]
- ./lus2lic should_work/myplus.lus -n plus -ec 
-../utils/test_lus2lic_no_node should_work/minus.lus
-
-** TODO Lurette trouve un mismatch sur ce prog au step 0
+** DONE Lurette trouve un mismatch sur ce prog au step 0
+   - State "DONE"       from "WAITING"    [2013-06-03 Mon 10:55]
+   - State "WAITING"    from "STARTED"    [2013-06-03 Mon 10:55]
+   - State "STARTED"    from "TODO"       [2013-06-03 Mon 10:55]
    - State "TODO"       from ""           [2013-05-10 Fri 17:08]
-../utils/test_lus2lic_no_node should_work/exclusion.lus
+
 ../utils/test_lus2lic_no_node should_work/mapdeRed.lus
 ../utils/test_lus2lic_no_node should_work/matrice.lus
 ../utils/test_lus2lic_no_node should_work/over2.lus
-- 
GitLab