Commit 6e28a5d6 authored by erwan's avatar erwan
Browse files

Fix: #8

close #8
parent 7d9d6c38
(** Time-stamp: <modified the 29/08/2019 (at 15:44) by Erwan Jahier> *)
(** Time-stamp: <modified the 04/09/2019 (at 14:48) by Erwan Jahier> *)
(* Replace structures and arrays by as many variables as necessary.
Since structures can be nested, it migth be a lot of new variables...
......@@ -417,7 +417,7 @@ and (break_tuple : Lxm.t -> left list -> val_exp -> Lic.eq_info srcflagged list)
(String.concat ", " (List.map (LicDump.string_of_val_exp_eff false) vel))
in
let msg = Printf.sprintf
"error: expression \n %s\n cannot be broken \n %s (%d)
"error: expression \n %s\n cannot be broken \n %s (%d)
should have the same arity as\n%s(%d)"
(LicDump.string_of_val_exp_eff false ve)
(vel2str ve1l) l1 (vel2str ve2l) l2
......@@ -426,10 +426,11 @@ and (break_tuple : Lxm.t -> left list -> val_exp -> Lic.eq_info srcflagged list)
else
List.map2
(fun ve1 ve2 ->
{ ve with ve_core =
CallByPosLic ({it= PREDEF_CALL({src=if_lxm ;
it = ("Lustre","if"),[]}); src=lxm},
[cond;ve1;ve2])}
{ ve with
ve_core =
CallByPosLic ({it= PREDEF_CALL({src=if_lxm ;
it = ("Lustre","if"),[]}); src=lxm},
[cond;ve1;ve2])}
)
ve1l
ve2l
......@@ -478,7 +479,12 @@ and (build_and_eq: Lic.node_key srcflagged -> val_exp list -> val_exp list -> va
fun op vel1 vel2 ->
(* transform "[(x1;x2] = [y1;y2]" into "x1=y1 and x2=y2" *)
assert (op.it = (("Lustre","eq"),[]) || op.it = (("Lustre","neq"),[]));
let and_op = {src = op.src; it=(("Lustre","and"),[]) } in
let conj_op = if op.it = (("Lustre","eq"),[]) then
{src = op.src; it=(("Lustre","and"),[]) }
else
(* t<>t1 iff t[0]<>t'[0] OR t[1]<>t'[2] OR ... *)
{src = op.src; it=(("Lustre","or"),[]) }
in
let make_eq ve1 ve2 =
let lxm = op.src in
{ve_core = CallByPosLic({src=lxm;it=PREDEF_CALL(op)},[ve1;ve2]);
......@@ -489,7 +495,7 @@ and (build_and_eq: Lic.node_key srcflagged -> val_exp list -> val_exp list -> va
let make_and acc ve1 ve2 =
let eq = make_eq ve1 ve2 in
let lxm = op.src in
{ve_core = CallByPosLic({src=lxm;it=PREDEF_CALL(and_op)},[acc;eq]);
{ve_core = CallByPosLic({src=lxm;it=PREDEF_CALL(conj_op)},[acc;eq]);
ve_typ = [Bool_type_eff];
ve_clk = ve1.ve_clk;
ve_src = lxm}
......
==> lus2lic0.sum <==
Test run by jahier on Mon Sep 2 09:20:18
Test run by jahier on Wed Sep 4 15:05:25
Native configuration is x86_64-pc-linux-gnu
=== lus2lic0 tests ===
......@@ -66,7 +66,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
Test run by jahier on Mon Sep 2 09:20:19
Test run by jahier on Wed Sep 4 15:05:26
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
......@@ -409,7 +409,7 @@ PASS: sh multipar.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
==> lus2lic2.sum <==
Test run by jahier on Mon Sep 2 09:20:43
Test run by jahier on Wed Sep 4 15:05:55
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
......@@ -749,7 +749,7 @@ PASS: sh zzz2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <==
Test run by jahier on Mon Sep 2 09:21:12
Test run by jahier on Wed Sep 4 15:06:25
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
......@@ -1259,7 +1259,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on Mon Sep 2 09:21:54
Test run by jahier on Wed Sep 4 15:07:07
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
......@@ -1776,14 +1776,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
# of unexpected failures 18
===============================
# Total number of failures: 69
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 24 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 29 seconds
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 29 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 30 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 42 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 17 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 18 seconds
* Ref time:
59.94user 23.36system 1:53.07elapsed 73%CPU (0avgtext+0avgdata 283492maxresident)k
0inputs+139360outputs (0major+15352444minor)pagefaults 0swaps
63.26user 25.22system 1:59.59elapsed 73%CPU (0avgtext+0avgdata 283472maxresident)k
0inputs+139504outputs (0major+15354836minor)pagefaults 0swaps
* Quick time (-j 4):
68.51user 26.31system 1:09.99elapsed 135%CPU (0avgtext+0avgdata 283412maxresident)k
0inputs+136864outputs (0major+15153120minor)pagefaults 0swaps
70.81user 26.56system 1:11.65elapsed 135%CPU (0avgtext+0avgdata 283476maxresident)k
0inputs+138528outputs (0major+15273199minor)pagefaults 0swaps
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment