From 229c1479c80331fd66631be665e41b987247eee7 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr> Date: Tue, 11 May 2021 15:23:33 +0200 Subject: [PATCH] New: rdbgui4sasa now handles salut --- sasa.opam | 2 +- test/alea-coloring-alt/Makefile | 6 +- test/alea-coloring/Makefile | 8 +-- test/async-unison/Makefile | 10 +-- test/bfs-spanning-tree/Makefile | 14 ++--- test/bfs-st-HC92/Makefile | 12 ++-- test/coloring/Makefile | 18 +++--- test/dfs-list/Makefile | 8 +-- test/dfs/Makefile | 8 +-- test/dijkstra-ring/Makefile | 10 +-- test/k-clustering/Makefile | 6 +- test/skeleton/Makefile | 4 +- test/st-CYH91/Makefile | 10 +-- test/st-KK06-algo1/Makefile | 12 ++-- test/st-KK06-algo2/Makefile | 14 ++--- test/toy-example-a5sf/Makefile | 4 +- test/unison/Makefile | 14 ++--- tools/rdbg4sasa/dot4sasa.ml | 104 +++++++++++++++++--------------- tools/rdbg4sasa/gtkgui.ml | 88 ++++++++++++++++++++------- tools/rdbgui4sasa/rdbgui.ml | 14 +++-- 20 files changed, 211 insertions(+), 155 deletions(-) diff --git a/sasa.opam b/sasa.opam index c338defa..2b89ccf4 100644 --- a/sasa.opam +++ b/sasa.opam @@ -23,7 +23,7 @@ depends: [ "dune" { >= "1.11" } "ocamlgraph" "lutils" - "rdbg" { >= "1.191" } + "rdbg" { >= "1.193.1" } ] depopts: [ "lustre-v6" diff --git a/test/alea-coloring-alt/Makefile b/test/alea-coloring-alt/Makefile index 7d6d2da9..fe4879f0 100644 --- a/test/alea-coloring-alt/Makefile +++ b/test/alea-coloring-alt/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/11/2020 (at 16:03) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:38) by Erwan Jahier> test: ring.cmxs @@ -32,9 +32,9 @@ clique10.dot: rdbg321: grid44_331.dot grid44_331.ml - rdbg -sut "sasa $< -lcd" + rdbg --sasa -sut "sasa $< -lcd" rdbg331: grid44_331.dot grid44_331.ml - rdbg -sut "sasa $< -lcd" + rdbg --sasa -sut "sasa $< -lcd" diff --git a/test/alea-coloring/Makefile b/test/alea-coloring/Makefile index 6141ed10..3336bbed 100644 --- a/test/alea-coloring/Makefile +++ b/test/alea-coloring/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 14/04/2020 (at 16:45) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:39) by Erwan Jahier> test: ring.cmxs @@ -18,18 +18,18 @@ gnuplot: ring.rif ################################################################### # Interactive session with lutin rdbg: ring.lut ring.ml - rdbg -o ring.rif \ + rdbg --sasa -o ring.rif \ -env "$(sasa) ring.dot -custd -rif" \ -sut-nd "lutin ring.lut -n distributed" # Interactive session with internal deamons rdbg2: ring.lut ring.ml - rdbg -o ring.rif \ + rdbg --sasa -o ring.rif \ -env "$(sasa) ring.dot -dd --dummy-input" \ -sut-nd "lutin ring.lut -n dummy" rdbg3: ring.ml - rdbg -o ring.rif \ + rdbg --sasa -o ring.rif \ -sut "$(sasa) ring.dot -cd -rif" diff --git a/test/async-unison/Makefile b/test/async-unison/Makefile index 8193d5ed..5f93a278 100644 --- a/test/async-unison/Makefile +++ b/test/async-unison/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/05/2021 (at 11:10) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:40) by Erwan Jahier> test: ring.cmxs ring.lut rdbg_test @@ -26,19 +26,19 @@ lurette: ring.cmxs ring_oracle.lus -oracle "lv6 -2c-exec ring_oracle.lus -n oracle" rdbg_test: ring.ml - printf "\nnr\nsd\nq\n" | rdbg -o ring.rif -l 10000 -env "$(sasa) -vl 1 ring.dot -cd" + printf "\nnr\nsd\nq\n" | rdbg --sasa -o ring.rif -l 10000 -env "$(sasa) -vl 1 ring.dot -cd" rdbg: ring.ml - rdbg -o ring.rif -l 10000 -env "sasa -vl 1 ring.dot -cd" + rdbg --sasa -o ring.rif -l 10000 -env "sasa -vl 1 ring.dot -cd" rdbgui: ring.ml rdbgui4sasa -o ring.rif -l 10000 -env "sasa -vl 1 ring.dot -cd" rdbg4: grid4.ml - rdbg -o ring.rif -l 10000 \ + rdbg --sasa -o ring.rif -l 10000 \ -env "sasa grid4.dot -dd" rdbgl: ring4.cmxs - rdbg -lurette -o lurette-ring.rif \ + rdbg -lurette --sasa -o lurette-ring.rif \ -sut "sasa ring.dot -rif -cd " diff --git a/test/bfs-spanning-tree/Makefile b/test/bfs-spanning-tree/Makefile index 09fa60a0..46e596df 100644 --- a/test/bfs-spanning-tree/Makefile +++ b/test/bfs-spanning-tree/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/05/2021 (at 11:10) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:41) by Erwan Jahier> test: test0 test2 lurette0 @@ -31,19 +31,19 @@ gnuplot2: fig52.rif gnuplot-rif $< lurette0: fig51_noinit.cmxs fig51_noinit.lut - lurette -o lurette.rif \ + lurette --sasa -o lurette.rif \ -env "sasa fig51_noinit.dot -custd -rif" \ -sut "lutin fig51_noinit.lut -n distributed" rdbg-lurette1:rdbg-lurette1.rif rdbg-lurette1.rif: fig51.cmxs fig51.lut fig51_oracle.lus - rdbg -lurette -o rdbg-lurette1.rif \ + rdbg -lurette --sasa -o rdbg-lurette1.rif \ -env "$(sasa) fig51.dot -dd -rif" \ -oracle "lv6 fig51_oracle.lus -n oracle" lurette1:lurette1.rif lurette1.rif: fig51.cmxs fig51.lut fig51_oracle.lus - lurette -o lurette1.rif \ + lurette --sasa -o lurette1.rif \ -env "$(sasa) fig51.dot -dd -rif" \ -oracle "lv6 fig51_oracle.lus -n oracle" @@ -52,18 +52,18 @@ lurette: lurette0 gnuplot-rif lurette.rif rdbg: fig51_noinit.ml fig51_noinit.lut - ledit rdbg -sut "sasa fig51_noinit.dot -dd " + ledit rdbg --sasa -sut "sasa fig51_noinit.dot -dd " rdbgui: fig51_noinit.ml fig51_noinit.lut rdbgui4sasa -sut "sasa fig51_noinit.dot -dd " rdbg2: fig51.ml fig51.lut - rdbg -o lurette.rif \ + rdbg --sasa -o lurette.rif \ -env "$(sasa) fig51.dot -custd -rif" \ -sut-nd "lutin fig51.lut -n distributed" manual: fig51_noinit.cmxs fig51_noinit.lut - lurette -o lurette.rif --sim2chro \ + lurette --sasa -o lurette.rif --sim2chro \ -sut "$(sasa) fig51_noinit.dot -custd -rif -ifi" \ -env "lutin fig51_noinit.lut -n manual" &&\ gnuplot-rif lurette.rif diff --git a/test/bfs-st-HC92/Makefile b/test/bfs-st-HC92/Makefile index fdbf4c3a..9e4f7985 100644 --- a/test/bfs-st-HC92/Makefile +++ b/test/bfs-st-HC92/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 12/03/2020 (at 17:46) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:42) by Erwan Jahier> test: test0 lurette @@ -15,19 +15,19 @@ gnuplot: ring.rif gnuplot-rif $< ocd: grid4.ml grid4.cma - rdbg --ocamldebug -sut "sasa grid4.dot" -l 1000 + rdbg --sasa --ocamldebug -sut "sasa grid4.dot" -l 1000 rdbg: grid4.ml - rdbg -o rdbg.rif -sut "sasa grid4.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa grid4.dot" -l 1000 rdbg10: grid10.ml - rdbg -o rdbg.rif -sut "sasa grid10.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa grid10.dot" -l 1000 lurette: grid4.cmxs - lurette -o rdbg.rif -sut "sasa -rif grid4.dot" -l 1000 + lurette --sasa -o rdbg.rif -sut "sasa -rif grid4.dot" -l 1000 rdbg-ring: ring.ml - rdbg -o rdbg.rif -sut "sasa ring.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa ring.dot" -l 1000 ER-1000.dot: gg ER -n 1000 -o $@ diff --git a/test/coloring/Makefile b/test/coloring/Makefile index 92758405..67735458 100644 --- a/test/coloring/Makefile +++ b/test/coloring/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 06/05/2021 (at 14:39) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:45) by Erwan Jahier> sasa=$(DIR)/bin/sasa -l 100 @@ -32,13 +32,13 @@ gnuplot: coloring.rif lurette: ring.cmxs ring_oracle.lus - lurette -o lurette-ring.rif \ + lurette --sasa -o lurette-ring.rif \ -sut "sasa ring.dot -rif -lcd " \ -oracle "lv6 ring_oracle.lus -n oracle -exec" # do not work with ocaml >3.08 rdbg-lurette: ring.cmxs ring_oracle.lus - rdbg -lurette -o lurette-ring.rif \ + rdbg -lurette --sasa -o lurette-ring.rif \ -sut "sasa ring.dot -rif -lcd " \ -oracle "lv6 ring_oracle.lus -n oracle -exec" @@ -47,7 +47,7 @@ test100: rdbg: grid4.ml echo "" > include.ml - ledit rdbg -sut "sasa grid4.dot --locally-central-daemon" + ledit rdbg --sasa -sut "sasa grid4.dot --locally-central-daemon" rdbgui: grid4.ml echo "" > include.ml rdbgui4sasa -sut "sasa grid4.dot --locally-central-daemon" @@ -58,7 +58,7 @@ rdbgui-demo: grid10.ml rdbg-luciole: grid4.ml echo "" > include.ml - rdbg --luciole -sut "sasa -rif grid4.dot --custom-daemon" + rdbg --sasa --luciole -sut "sasa -rif grid4.dot --custom-daemon" rdbgui-custd: grid4.ml echo "" > include.ml @@ -67,22 +67,22 @@ rdbgui-custd: grid4.ml rdbg3: ring.ml echo "" > include.ml - ledit rdbg -sut "sasa ring.dot -wd" + ledit rdbg --sasa -sut "sasa ring.dot -wd" rdbg1: ring.ml ring_oracle.lus echo "" > include.ml - ledit rdbg -o rdbg-ring.rif \ + ledit rdbg --sasa -o rdbg-ring.rif \ -sut "sasa --replay ring.dot -rif -lcd " \ -oracle "lv6 ring_oracle.lus -n oracle -exec" rdbg2: ring.cmxs ring.lut echo "" > include.ml - ledit rdbg -o ring.rif \ + ledit rdbg --sasa -o ring.rif \ -env "$(sasa) --replay ring.dot -custd -rif" \ -sut-nd "lutin ring.lut -n distributed" rdbg4: ring.ml - ledit rdbg --missing-vars-last -o ring.rif -env "sasa ring.dot -custd " + ledit rdbg --sasa -o ring.rif -env "sasa ring.dot -custd " clean: genclean diff --git a/test/dfs-list/Makefile b/test/dfs-list/Makefile index 964fd5ad..ea5926fa 100644 --- a/test/dfs-list/Makefile +++ b/test/dfs-list/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/11/2020 (at 11:12) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:46) by Erwan Jahier> test: test0 lurette0 @@ -17,7 +17,7 @@ gnuplot: g.rif lurette0: g.cmxs g.lut - lurette -o lurette.rif \ + lurette --sasa -o lurette.rif \ -env "$(sasa) g.dot -custd -rif" \ -sut "lutin g.lut -n distributed" @@ -27,12 +27,12 @@ lurette: lurette0 rdbg: g.ml - rdbg -o lurette.rif -env "sasa g.dot -rif" + rdbg --sasa -o lurette.rif -env "sasa g.dot -rif" rdbgui: g.ml rdbgui4sasa -o lurette.rif -env "sasa g.dot -rif" rdbg2: g.ml g.lut - rdbg -o lurette.rif \ + rdbg --sasa -o lurette.rif \ -env "$(sasa) g.dot -rif" \ -sut-nd "lutin g.lut -n dummy" diff --git a/test/dfs/Makefile b/test/dfs/Makefile index 2b742864..aadbd637 100644 --- a/test/dfs/Makefile +++ b/test/dfs/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/05/2021 (at 11:11) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:46) by Erwan Jahier> test: test0 lurette0 rdbg_test @@ -21,7 +21,7 @@ gnuplot: g.rif gnuplot-rif $< lurette0: g.cmxs g.lut - lurette -o lurette.rif \ + lurette --sasa -o lurette.rif \ -env "$(sasa) g.dot -custd -rif" \ -sut "lutin g.lut -n distributed" @@ -31,11 +31,11 @@ lurette: lurette0 rdbg: g.lut g.ml - rdbg -o lurette.rif \ + rdbg --sasa -o lurette.rif \ -env "$(sasa) g.dot -rif" rdbg2: g.lut g.ml - rdbg -o lurette.rif \ + rdbg --sasa -o lurette.rif \ -env "$(sasa) g.dot -rif" \ -sut-nd "lutin g.lut -n dummy" diff --git a/test/dijkstra-ring/Makefile b/test/dijkstra-ring/Makefile index cb07b2fd..0267bb9f 100644 --- a/test/dijkstra-ring/Makefile +++ b/test/dijkstra-ring/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/05/2021 (at 11:11) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:46) by Erwan Jahier> test: ring.cmxs lurette1 rdbg_test @@ -23,7 +23,7 @@ gnuplot: ring.rif rdbg: ring.ml ring.lut - ledit rdbg -o ring.rif -sut "sasa ring.dot" + ledit rdbg --sasa -o ring.rif -sut "sasa ring.dot" rdbgui: ring.ml ring.lut rdbgui4sasa -o ring.rif -sut "sasa ring.dot" @@ -34,15 +34,15 @@ rdbgui-sd: ring.ml ring.lut rdbgui4sasa -o ring.rif -sut "sasa ring.dot -sd" rdbg2: ring.ml ring.lut - ledit rdbg -o ring.rif \ + ledit rdbg --sasa -o ring.rif \ -env "$(sasa) ring.dot -custd -rif" \ -sut-nd "lutin ring.lut -n distributed"\ rdbg_test: ring.ml - printf "\nnr\nsd\nq\n" | rdbg -o ring.rif -l 10000 -sut "$(sasa) -vl 1 ring.dot -dd" + printf "\nnr\nsd\nq\n" | rdbg --sasa -o ring.rif -l 10000 -sut "$(sasa) -vl 1 ring.dot -dd" lurette1: ring.lut ring_oracle.lus - lurette \ + lurette --sasa \ -env "$(sasa) ring.dot -custd " \ -sut "lutin ring.lut -n distributed" \ -oracle "lv6 ring_oracle.lus -n oracle" diff --git a/test/k-clustering/Makefile b/test/k-clustering/Makefile index cc38fd6c..f97a71c3 100644 --- a/test/k-clustering/Makefile +++ b/test/k-clustering/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 15/10/2020 (at 15:36) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:49) by Erwan Jahier> test: fig52_kcl.cmxs @@ -17,10 +17,10 @@ gnuplot: fig52_kcl.rif gnuplot-rif $< rdbg: fig52_kcl.ml - rdbg -o fig52_kcl.rif -env "sasa fig52_kcl.dot -gcd" + rdbg --sasa -o fig52_kcl.rif -env "sasa fig52_kcl.dot -gcd" rdbgcd: fig52_kcl.ml - rdbg -o fig52_kcl.rif -env "sasa fig52_kcl.dot -cd" + rdbg --sasa -o fig52_kcl.rif -env "sasa fig52_kcl.dot -cd" dtree50: dtree50.cmxs sasa -cd dtree50.dot diff --git a/test/skeleton/Makefile b/test/skeleton/Makefile index 9e8482e6..e6ba899e 100644 --- a/test/skeleton/Makefile +++ b/test/skeleton/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 10/11/2020 (at 11:59) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:47) by Erwan Jahier> @@ -6,7 +6,7 @@ test: grid4.dot grid4.cmxs sasa -l 10 grid4.dot rdbg: grid4.ml - rdbg -sut "sasa grid4.dot" + rdbg --sasa -sut "sasa grid4.dot" clean: genclean rm -f ring.ml grid4.dot rdbg-cmds.ml diff --git a/test/st-CYH91/Makefile b/test/st-CYH91/Makefile index 48005a48..82c0938e 100644 --- a/test/st-CYH91/Makefile +++ b/test/st-CYH91/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 12/03/2020 (at 17:47) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:47) by Erwan Jahier> test: test0 lurette @@ -18,16 +18,16 @@ gnuplot: ring.rif gnuplot-rif $< ocd: grid4.ml grid4.cma - rdbg --ocamldebug -sut "sasa grid4.dot -cd -seed 42" -l 1000 + rdbg --sasa --ocamldebug -sut "sasa grid4.dot -cd -seed 42" -l 1000 rdbg: grid4.ml - rdbg -o rdbg.rif -sut "sasa grid4.dot -cd" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa grid4.dot -cd" -l 1000 lurette: grid4.cmxs - lurette -o rdbg.rif -sut "sasa grid4.dot -cd" -l 1000 + lurette --sasa -o rdbg.rif -sut "sasa grid4.dot -cd" -l 1000 rdbg-ring: ring.ml - rdbg -o rdbg.rif -sut "sasa ring.dot -cd" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa ring.dot -cd" -l 1000 clean: genclean diff --git a/test/st-KK06-algo1/Makefile b/test/st-KK06-algo1/Makefile index ccaaba82..161f2202 100644 --- a/test/st-KK06-algo1/Makefile +++ b/test/st-KK06-algo1/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 12/03/2020 (at 17:46) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:47) by Erwan Jahier> test: test0 lurette lurette-alt @@ -15,23 +15,23 @@ gnuplot: ring.rif gnuplot-rif $< ocd: grid4.ml grid4.cma - rdbg --ocamldebug -sut "sasa grid4.dot" -l 1000 + rdbg --sasa --ocamldebug -sut "sasa grid4.dot" -l 1000 rdbg: grid4.ml - rdbg -o rdbg.rif -sut "sasa grid4.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa grid4.dot" -l 1000 lurette: grid4.cmxs grid4_oracle.lus - lurette -o rdbg.rif -sut "sasa grid4.dot -rif" \ + lurette --sasa -o rdbg.rif -sut "sasa grid4.dot -rif" \ -oracle "lv6 grid4_oracle.lus -n oracle -exec" -l 1000 lurette-alt: grid4.cmxs grid4_oracle.lus - rdbg -lurette -o rdbg.rif -sut "sasa grid4.dot -rif" \ + rdbg -lurette --sasa -o rdbg.rif -sut "sasa grid4.dot -rif" \ -oracle "lv6 grid4_oracle.lus -n oracle -exec" -l 1000 rdbg-ring: ring.ml - rdbg -o rdbg.rif -sut "sasa ring.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa ring.dot" -l 1000 clean: genclean diff --git a/test/st-KK06-algo2/Makefile b/test/st-KK06-algo2/Makefile index ac387c21..28f562f7 100644 --- a/test/st-KK06-algo2/Makefile +++ b/test/st-KK06-algo2/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 12/03/2020 (at 17:46) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:51) by Erwan Jahier> test: test0 lurette lurette-alt @@ -15,26 +15,26 @@ gnuplot: ring.rif gnuplot-rif $< ocd: grid4.ml grid4.cma - rdbg --ocamldebug -sut "sasa grid4.dot" -l 1000 + rdbg --sasa --ocamldebug -sut "sasa grid4.dot" -l 1000 rdbg: grid4.ml - rdbg -o rdbg.rif -sut "sasa grid4.dot" -l 100 + rdbg --sasa -o rdbg.rif -sut "sasa grid4.dot" -l 100 rdbg10: grid10.ml - rdbg -o rdbg.rif -sut "sasa grid10.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa grid10.dot" -l 1000 lurette: grid4.cmxs grid4_oracle.lus - lurette -o rdbg.rif -sut "sasa grid4.dot -rif" \ + lurette --sasa -o rdbg.rif -sut "sasa grid4.dot -rif" \ -oracle "lv6 grid4_oracle.lus -n oracle -exec" -l 1000 lurette-alt: grid4.cmxs grid4_oracle.lus - rdbg -lurette -o rdbg.rif -sut "sasa grid4.dot -rif" \ + rdbg -lurette --sasa -o rdbg.rif -sut "sasa grid4.dot -rif" \ -oracle "lv6 grid4_oracle.lus -n oracle -exec" -l 1000 rdbg-ring: ring.ml - rdbg -o rdbg.rif -sut "sasa ring.dot" -l 1000 + rdbg --sasa -o rdbg.rif -sut "sasa ring.dot" -l 1000 clean: genclean diff --git a/test/toy-example-a5sf/Makefile b/test/toy-example-a5sf/Makefile index 3299d6ec..5903193d 100644 --- a/test/toy-example-a5sf/Makefile +++ b/test/toy-example-a5sf/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/05/2021 (at 11:11) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:48) by Erwan Jahier> test: test1 test2 @@ -25,7 +25,7 @@ gnuplot: te.rif gnuplot-rif $< rdbg: te.ml - rdbg -o te.rif -env "$(sasa) te.dot -gcd" + rdbg --sasa -o te.rif -env "$(sasa) te.dot -gcd" clean: genclean rm -f te.ml diff --git a/test/unison/Makefile b/test/unison/Makefile index 6473f001..aee26397 100644 --- a/test/unison/Makefile +++ b/test/unison/Makefile @@ -1,4 +1,4 @@ -# Time-stamp: <modified the 04/11/2020 (at 11:08) by Erwan Jahier> +# Time-stamp: <modified the 11/05/2021 (at 16:49) by Erwan Jahier> test: test1 test2 lurette0 lurette1 rdbg_test test3 @@ -32,33 +32,33 @@ luciole: ring.cmxs lurette0: ring_oracle.lus - lurette -o lurette.rif \ + lurette --sasa -o lurette.rif \ -sut "$(sasa) ring.dot -sd -rif" \ -oracle "lv6 ring_oracle.lus -n oracle" # Idem with custom daemon lurette1: ring.lut ring_oracle.lus - lurette -o lurette.rif \ + lurette --sasa -o lurette.rif \ -env "$(sasa) ring.dot -custd -rif" \ -sut "lutin ring.lut -n synchronous" \ -oracle "lv6 ring_oracle.lus -n oracle" # rdbg_daemon: ring.cmxs - rdbg --missing-vars-last -sut "sasa ring.dot -custd -rif" + rdbg --sasa -sut "sasa ring.dot -custd -rif" lurette: lurette0 s g rdbg: ring.ml - rdbg -o unison.rif -sut "$(sasa) ring.dot -sd -rif" + rdbg --sasa -o unison.rif -sut "$(sasa) ring.dot -sd -rif" rdbgui: ring.ml rdbgui4sasa -o unison.rif -sut "$(sasa) ring.dot -sd -rif" rdbg2: ring.ml - rdbg -o unison.rif -sut "sasa ring.dot -custd -rif" + rdbg --sasa -o unison.rif -sut "sasa ring.dot -custd -rif" rdbg_test: ring.ml - printf "\nn\ns\nsi 4\nn\nni 3\nq\n" | rdbg -o unison.rif \ + printf "\nn\ns\nsi 4\nn\nni 3\nq\n" | rdbg --sasa -o unison.rif \ -sut "$(sasa) ring.dot -sd -rif" \ -include ../Makefile.inc diff --git a/tools/rdbg4sasa/dot4sasa.ml b/tools/rdbg4sasa/dot4sasa.ml index 74d3bc20..148d29e2 100644 --- a/tools/rdbg4sasa/dot4sasa.ml +++ b/tools/rdbg4sasa/dot4sasa.ml @@ -24,55 +24,65 @@ let (is_parent: string -> string -> int -> RdbgEvent.t -> bool) = | Some (I j) -> j > -1 && i = j | _ -> false - let (get_processes : RdbgEvent.t -> process list) = fun e -> -(* if e.kind <> Ltop then ( - print_string "dot should be called from Ltop event\n"; - failwith "exit dot" - );*) - let l = List.map (fun (x,v) -> Str.split (Str.regexp "_") x, v) e.data in - let rec sortv (enab, other) (x,v) = - match x with - | "Enab"::pid::tail -> (pid, String.concat "_" tail,v)::enab, other - | pid::tail -> enab, (pid,(String.concat "_" tail),v)::other - | [] -> assert false - in - let enab, other = List.fold_left sortv ([],[]) l in - let rec (build_pidl: process list -> (string * string * Data.v) list -> - (string * string * Data.v) list -> process list) = - fun pidl enab other -> - match enab with - | [] -> pidl - | (pid, _, _)::_ -> - let enab_pid_list, enab = - List.partition (fun (pid0,_,_) -> pid=pid0) enab - in - let other_pid, other = - List.partition (fun (pid0,_,_) -> pid=pid0) other - in - let acti_pid, vars_pid = - List.partition - (fun (_,n,_) -> List.exists (fun (_,n2,_) -> n2=n) enab_pid_list) - other_pid - in - let get_actions (_, n, enabv) = - match List.find_opt (fun (_,n0, _) -> n=n0) acti_pid with - | Some (_,_,activ) -> - (n, enabv = Data.B true, activ = B true) - | None -> - (n, enabv = Data.B true, false) - in - let pid = { - name = pid; - actions = List.map get_actions enab_pid_list; - vars = List.map (fun (_,n,v) -> n,v) vars_pid; - } - in - build_pidl (pid::pidl) enab other - in - let pidl = build_pidl [] enab other in - List.rev pidl + (* if e.kind <> Ltop then ( + print_string "dot should be called from Ltop event\n"; + failwith "exit dot" + );*) + let l = List.map (fun (x,v) -> Str.split (Str.regexp "_") x, v) e.data in + let rec sortv (enab, other) (x,v) = + match args.salut_mode,x with + | false,"Enab"::pid::tail -> (pid, String.concat "_" tail,v)::enab, other + | false,pid::tail -> enab, (pid,(String.concat "_" tail),v)::other + | _,[] -> assert false + | true, ([_] | [_; _]) -> enab, other + | true, "Enab"::p::id::tail -> (p^id, String.concat "_" tail,v)::enab, other + | true, p::id::id2::tail -> + try + let _i = int_of_string id in + enab, (p^id,(String.concat "_" (id2::tail)),v)::other + with _ -> + try + let _i = int_of_string id2 in + enab, (p^id2,(String.concat "_" (id::tail)),v)::other + with _ -> assert false + in + let enab, other = List.fold_left sortv ([],[]) l in + let rec (build_pidl: process list -> (string * string * Data.v) list -> + (string * string * Data.v) list -> process list) = + fun pidl enab other -> + match enab with + | [] -> pidl + | (pid, _, _)::_ -> + let enab_pid_list, enab = + List.partition (fun (pid0,_,_) -> pid=pid0) enab + in + let other_pid, other = + List.partition (fun (pid0,_,_) -> pid=pid0) other + in + let acti_pid, vars_pid = + List.partition + (fun (_,n,_) -> List.exists (fun (_,n2,_) -> n2=n) enab_pid_list) + other_pid + in + let get_actions (_, n, enabv) = + match List.find_opt (fun (_,n0, _) -> n=n0) acti_pid with + | Some (_,_,activ) -> + (n, enabv = Data.B true, activ = B true) + | None -> + (n, enabv = Data.B true, false) + in + let pid = { + name = pid; + actions = List.map get_actions enab_pid_list; + vars = List.map (fun (_,n,v) -> n,v) vars_pid; + } + in + build_pidl (pid::pidl) enab other + in + let pidl = build_pidl [] enab other in + List.rev pidl (* If nodes have a var that is of type neighbor, we suppose that it is used to compute a spanning tree, a draws edges accordingly in the diff --git a/tools/rdbg4sasa/gtkgui.ml b/tools/rdbg4sasa/gtkgui.ml index 5fa70052..4e0b61c2 100644 --- a/tools/rdbg4sasa/gtkgui.ml +++ b/tools/rdbg4sasa/gtkgui.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 09/05/2021 (at 11:22) by Erwan Jahier> *) +(* Time-stamp: <modified the 11/05/2021 (at 18:19) by Erwan Jahier> *) #thread #require "lablgtk3" @@ -8,6 +8,7 @@ open GdkKeysyms open RdbgEvent open Data + (** Extrait le nom et l'état des noeuds @return liste de tuples (nom, etat, activable) *) @@ -20,8 +21,10 @@ let rdbg_nodes_info e: (string * string * bool) list = let v = match value with B v -> v | _ -> assert false in let p, label = match String.split_on_char '_' str with - | [] | _::[] | _::_::[] -> assert false - | _::x::y::_ -> x, y + | [] | [_] | [_;_] -> assert false + | [_; x; y] -> x, y + | [_; x; y; z] -> x^y,z + | _ -> assert false in p, label,v in @@ -36,7 +39,7 @@ let rdbg_nodes_info e: (string * string * bool) list = ! (alors que ca n'arrive jamais) *) let rdbg_nodes_enabled e = match rdbg_nodes_info e with - | [] -> assert false + | [] -> [] | (node, _action, enab)::l -> let last, res = List.fold_left @@ -62,25 +65,57 @@ let refresh () = (** Met en place le hook *) let daemongui_activate = Hashtbl.create 1 + + +let (fake_val_of_type : Data.t -> Data.v) = function + | Bool -> B false + | Int -> I 0 + | Real -> F 0.0 + | Extern _ + | Enum _ + | Struct _ + | Array _ + | Alpha _ + | Alias _ + | String _ -> assert false + let init_rdbg_hook () = let guidaemon sl = - let sl = List.filter (fun (n,v) -> String.length n > 5 && String.sub n 0 5 = "Enab_") sl in - let res = List.map (fun (n,enabled) -> - (* n est de la forme Enab_node_state, enabled est un Data.v *) - let str = String.sub n 5 ((String.length n)-5) in - let node_name = List.hd (String.split_on_char '_' str) in - let to_activate = match Hashtbl.find_opt daemongui_activate node_name with - | None -> false - | Some x -> x - in - let activate = match enabled with - | B true -> B to_activate - | _ -> B false - in - (str, activate) - ) sl - in - Some res + if sl = [] then + (* when called first (salut), its activation output will be + ignored, so we can give fake values for Enab ans state values *) + let res = List.map (fun (n,t) -> n, fake_val_of_type t) (snd !rdbg_mv) in + Some res + else + let sl = List.filter (fun (n,v) -> String.length n > 5 && String.sub n 0 5 = "Enab_") sl in + let res = List.map (fun (n,enabled) -> + (* n est de la forme Enab_node_state, enabled est un Data.v *) + let str = String.sub n 5 ((String.length n)-5) in + let node_name = match args.salut_mode, String.split_on_char '_' str with + | false, x::_ -> x + | true, x::y::_ -> x^y + | _, ([] | [_]) -> assert false + in + let to_activate = match Hashtbl.find_opt daemongui_activate node_name with + | None -> false + | Some x -> x + in + let activate = match enabled with + | B true -> B to_activate + | _ -> B false + in + (str, activate) + ) sl + in + let fake_init_val = (* unsed, but must be provided!*) + List.map (fun (n,t) -> n, fake_val_of_type t) (snd !rdbg_mv) + in + let ok_var = fst (List.split res) in + let res = List.fold_left + (fun acc (n,v) -> if List.mem n ok_var then acc else (n,v)::acc) + res fake_init_val + in + Some res in rdbg_mv_hook := Some guidaemon @@ -89,7 +124,7 @@ let set_tooltip b = b#misc#set_tooltip_text let custom_daemon p gtext vbox step_button round_button = (* création du rdbg_mv_hook et de tout ce qu'il faut autour *) init_rdbg_hook (); - + let daemon_box = GPack.hbox ~packing:vbox#add () ~homogeneous:true ~height:15 in let dk_dd = GButton.radio_button ~active:(!daemon_kind=Distributed) ~label:"Distributed" ~packing:daemon_box#add () @@ -109,6 +144,9 @@ let custom_daemon p gtext vbox step_button round_button = set_tooltip dk_manual (Printf.sprintf "Set the manual mode"); set_tooltip dk_manual_central (Printf.sprintf "Set the manual central mode"); + (* Necessary for pour salut *) + if args.salut_mode then e:= next_cond !e (fun e -> e.kind = Ltop); + (* if !e.kind <> Exit then e := next_cond !e (fun e -> e.kind = Exit && e.depth = 2); *) let nodes_enabled = rdbg_nodes_enabled !e in (** Met à jour le hook pour node quand le bouton ou une checkbox correspondant est activé *) @@ -509,7 +547,11 @@ let main () = ); let _ = make_button `UNDO "_Undo" "Undo the last move" (button_cb (fun ()->u();d())) in let _ = make_button `REFRESH "Restar_t" "Restart from the beginning" - (button_cb (fun ()-> r();d())) + (button_cb + (fun ()-> + r(); + if args.salut_mode then e:= next_cond !e (fun e -> e.kind = Ltop); + d())) in let _ = make_button `MEDIA_PLAY "_Sim2chro" "Launch sim2chro on the generated data (so far)" (button_cb (fun ()->sim2chro ())) diff --git a/tools/rdbgui4sasa/rdbgui.ml b/tools/rdbgui4sasa/rdbgui.ml index e068a4eb..6168a570 100644 --- a/tools/rdbgui4sasa/rdbgui.ml +++ b/tools/rdbgui4sasa/rdbgui.ml @@ -1,11 +1,15 @@ let quote str = if String.contains str ' ' then ("\""^str^"\"") else str -let gui = - Printf.sprintf " --ocaml-cmd \"#use \\\"gtkgui.ml\\\";;\"" - let rdbg_cmd = - String.concat " " ("rdbg"::(List.tl (List.map quote (Array.to_list Sys.argv)))) ^ gui + let cmd = List.tl (List.map quote (Array.to_list Sys.argv)) in + let str = String.concat " " cmd in + let salut_mode = not (Str.string_match (Str.regexp ".*sasa .*\\.dot") str 0) in + let sasa_opt = if salut_mode then "--salut" else "--sasa" in + String.concat " " ("rdbg"::sasa_opt::cmd) + +let gui = + Printf.sprintf " --ocaml-cmd \"#use \\\"gtkgui.ml\\\";;\"" let welcome () = @@ -20,4 +24,4 @@ let _ = let n = Array.length Sys.argv in welcome (); if n = 1 && Mypervasives.ls "rdbg-session" "ml" = [] then exit 0; - Sys.command rdbg_cmd + Sys.command (rdbg_cmd ^ gui) -- GitLab