Skip to content

Commit

Permalink
update hof and some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielegenovese committed Mar 22, 2024
1 parent f6c9754 commit ec6e7f8
Show file tree
Hide file tree
Showing 45 changed files with 299 additions and 285 deletions.
2 changes: 1 addition & 1 deletion examples/high-order-fun/anonfun_10_local_view.dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ digraph anonfun_10 {
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="2"];

n_1 -> n_2 [id="[$e|0]", label="receive hello"];
n_1 -> n_2 [id="[$e|0]", label="receive _"];
}
2 changes: 1 addition & 1 deletion examples/high-order-fun/anonfun_15_local_view.dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ digraph anonfun_15 {
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="2"];

n_1 -> n_2 [id="[$e|0]", label="receive hello"];
n_1 -> n_2 [id="[$e|0]", label="receive _"];
}
30 changes: 15 additions & 15 deletions examples/high-order-fun/greet_0_global_view.dot
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ digraph global {
n_17 [id="3", shape=circle, label="3"];
n_18 [id="16", shape=circle, label="16"];

n_1 -> n_12 [id="[$e|7]", label="greet/0.0→greet/0.0:hello"];
n_8 -> n_4 [id="[$e|9]", label="greet/0.0→greet/0.0:hello"];
n_17 -> n_1 [id="[$e|3]", label="greet/0.0→anonfun_15.0:hello"];
n_10 -> n_18 [id="[$e|14]", label="greet/0.0→greet/0.0:hello"];
n_15 -> n_14 [id="[$e|6]", label="greet/0.0→anonfun_10.0:hello"];
n_14 -> n_7 [id="[$e|12]", label="greet/0.0→anonfun_15.0:hello"];
n_1 -> n_10 [id="[$e|8]", label="greet/0.0→anonfun_10.0:hello"];
n_4 -> n_5 [id="[$e|15]", label="greet/0.0→anonfun_15.0:hello"];
n_12 -> n_2 [id="[$e|13]", label="greet/0.0→anonfun_10.0:hello"];
n_8 -> n_3 [id="[$e|10]", label="greet/0.0→anonfun_15.0:hello"];
n_15 -> n_16 [id="[$e|5]", label="greet/0.0→anonfun_15.0:hello"];
n_16 -> n_9 [id="[$e|11]", label="greet/0.0→anonfun_10.0:hello"];
n_1 -> n_12 [id="[$e|7]", label="greet/0.0→greet/0.0:hello2"];
n_8 -> n_4 [id="[$e|9]", label="greet/0.0→greet/0.0:hello2"];
n_17 -> n_1 [id="[$e|3]", label="greet/0.0→anonfun_15.0:hello1"];
n_10 -> n_18 [id="[$e|14]", label="greet/0.0→greet/0.0:hello2"];
n_15 -> n_14 [id="[$e|6]", label="greet/0.0→anonfun_10.0:hello3"];
n_14 -> n_7 [id="[$e|12]", label="greet/0.0→anonfun_15.0:hello1"];
n_1 -> n_10 [id="[$e|8]", label="greet/0.0→anonfun_10.0:hello3"];
n_4 -> n_5 [id="[$e|15]", label="greet/0.0→anonfun_15.0:hello1"];
n_12 -> n_2 [id="[$e|13]", label="greet/0.0→anonfun_10.0:hello3"];
n_8 -> n_3 [id="[$e|10]", label="greet/0.0→anonfun_15.0:hello1"];
n_15 -> n_16 [id="[$e|5]", label="greet/0.0→anonfun_15.0:hello1"];
n_16 -> n_9 [id="[$e|11]", label="greet/0.0→anonfun_10.0:hello3"];
n_11 -> n_13 [id="[$e|0]", label="greet/0.0Δanonfun_15.0"];
n_13 -> n_17 [id="[$e|1]", label="greet/0.0Δanonfun_10.0"];
n_3 -> n_6 [id="[$e|16]", label="greet/0.0→greet/0.0:hello"];
n_17 -> n_8 [id="[$e|4]", label="greet/0.0→anonfun_10.0:hello"];
n_17 -> n_15 [id="[$e|2]", label="greet/0.0→greet/0.0:hello"];
n_3 -> n_6 [id="[$e|16]", label="greet/0.0→greet/0.0:hello2"];
n_17 -> n_8 [id="[$e|4]", label="greet/0.0→anonfun_10.0:hello3"];
n_17 -> n_15 [id="[$e|2]", label="greet/0.0→greet/0.0:hello2"];
}
10 changes: 5 additions & 5 deletions examples/high-order-fun/greet_0_local_view.dot
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ digraph greet_0 {
n_6 [id="7", shape=circle, label="5"];
n_7 [id="3", shape=circle, label="2"];

n_6 -> n_5 [id="[$e|7]", label="send hello to anonfun_10.0"];
n_7 -> n_4 [id="[$e|3]", label="send hello to anonfun_15.0"];
n_6 -> n_5 [id="[$e|7]", label="send hello3 to anonfun_10.0"];
n_1 -> n_6 [id="[$e|6]", label="spawn anonfun_10.0"];
n_5 -> n_3 [id="[$e|5]", label="receive hello"];
n_2 -> n_7 [id="[$e|1]", label="spawn anonfun_15.0"];
n_4 -> n_1 [id="[$e|4]", label="send hello to pid_self"];
n_4 -> n_1 [id="[$e|0]", label="send hello2 to pid_self"];
n_5 -> n_3 [id="[$e|1]", label="receive _"];
n_7 -> n_4 [id="[$e|4]", label="send hello1 to anonfun_15.0"];
n_2 -> n_7 [id="[$e|2]", label="spawn anonfun_15.0"];
}
10 changes: 5 additions & 5 deletions examples/high-order-fun/hof.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

recv() ->
receive
hello -> done
_ -> done
end.

greet() ->
Fun = fun() ->
receive
hello -> done
_ -> done
end
end,
A = spawn(fun() -> recv() end),
A ! hello,
self() ! hello,
A ! hello1,
self() ! hello2,
B = spawn(Fun),
B ! hello,
B ! hello3,
recv(),
Fun().
4 changes: 2 additions & 2 deletions examples/serverclient/server_0_local_view.dot
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ digraph server_0 {
n_4 [id="4", shape=circle, label="3"];
n_5 [id="3", shape=doublecircle, label="4"];

n_2 -> n_3 [id="[$e|0]", label="receive {req,P}"];
n_3 -> n_1 [id="[$e|3]", label="spawn handle_req/1.0"];
n_4 -> n_5 [id="[$e|6]", label="spawn handle_req/1.1"];
n_2 -> n_4 [id="[$e|2]", label="receive ciao"];
n_1 -> n_2 [id="[$e|7]", label="send {res,handle_req/1.0} to P"];
n_2 -> n_4 [id="[$e|2]", label="receive ciao"];
n_2 -> n_3 [id="[$e|0]", label="receive {req,P}"];
}
19 changes: 0 additions & 19 deletions examples/test/barber/test0_local_view.dot

This file was deleted.

19 changes: 19 additions & 0 deletions examples/test/barber/test_0_local_view.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
digraph test_0 {
rankdir="LR";
n_0 [label="test_0", shape="plaintext"];
n_1 [id="5", shape=circle, label="5"];
n_2 [id="6", shape=circle, label="6"];
n_3 [id="1", shape=circle, label="1"];
n_0 -> n_3 [arrowhead=none];
n_4 [id="2", shape=circle, label="2"];
n_5 [id="4", shape=doublecircle, label="7"];
n_6 [id="7", shape=circle, label="3"];
n_7 [id="3", shape=circle, label="4"];

n_7 -> n_1 [id="[$e|4]", label="receive {Name1,State1}"];
n_3 -> n_4 [id="[$e|1]", label="spawn open_barber_shop/0.0"];
n_4 -> n_6 [id="[$e|0]", label="spawn customer/3.0"];
n_1 -> n_2 [id="[$e|5]", label="receive {Name2,State2}"];
n_6 -> n_7 [id="[$e|3]", label="spawn customer/3.1"];
n_2 -> n_5 [id="[$e|2]", label="send stop to open_barber_shop/0.0"];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph b0 {
digraph b_0 {
rankdir="LR";
n_0 [label="b0", shape="plaintext"];
n_0 [label="b_0", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="2"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
digraph c1 {
digraph c_1 {
rankdir="LR";
n_0 [label="c1", shape="plaintext"];
n_0 [label="c_1", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=circle, label="2"];
n_3 [id="3", shape=doublecircle, label="3"];

n_2 -> n_3 [id="[$e|1]", label="send X to B"];
n_1 -> n_2 [id="[$e|0]", label="receive X"];
n_2 -> n_3 [id="[$e|1]", label="send X to B"];
}
18 changes: 0 additions & 18 deletions examples/test/foo1/test0_global_view.dot

This file was deleted.

15 changes: 0 additions & 15 deletions examples/test/foo1/test0_local_view.dot

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ digraph global {
n_6 [id="7", shape=circle, label="7"];
n_7 [id="3", shape=circle, label="3"];

n_5 -> n_1 [id="[$e|3]", label="test0/0Δclient1/0"];
n_4 -> n_5 [id="[$e|2]", label="test0/0Δclient1/1"];
n_2 -> n_6 [id="[$e|5]", label="test0/0Δclient1/0"];
n_4 -> n_7 [id="[$e|1]", label="test0/0Δclient1/0"];
n_5 -> n_2 [id="[$e|4]", label="test0/0Δclient1/1"];
n_3 -> n_4 [id="[$e|0]", label="test0/0Δserver0/0"];
n_7 -> n_1 [id="[$e|3]", label="test/0.0→c/1.0:dos"];
n_1 -> n_6 [id="[$e|5]", label="test/0.0→b/0.0:uno"];
n_3 -> n_4 [id="[$e|0]", label="test/0.0Δb/0.0"];
n_4 -> n_7 [id="[$e|1]", label="test/0.0Δc/1.0"];
n_5 -> n_2 [id="[$e|4]", label="test/0.0→c/1.0:dos"];
n_7 -> n_5 [id="[$e|2]", label="test/0.0→b/0.0:uno"];
}
15 changes: 15 additions & 0 deletions examples/test/foo1/test_0_local_view.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
digraph test_0 {
rankdir="LR";
n_0 [label="test_0", shape="plaintext"];
n_1 [id="5", shape=circle, label="3"];
n_2 [id="1", shape=circle, label="1"];
n_0 -> n_2 [arrowhead=none];
n_3 [id="2", shape=circle, label="2"];
n_4 [id="4", shape=doublecircle, label="5"];
n_5 [id="3", shape=circle, label="4"];

n_5 -> n_4 [id="[$e|3]", label="send dos to c/1.0"];
n_1 -> n_5 [id="[$e|0]", label="send uno to b/0.0"];
n_2 -> n_3 [id="[$e|1]", label="spawn b/0.0"];
n_3 -> n_1 [id="[$e|2]", label="spawn c/1.0"];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph a1 {
digraph a_1 {
rankdir="LR";
n_0 [label="a1", shape="plaintext"];
n_0 [label="a_1", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="2"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph b0 {
digraph b_0 {
rankdir="LR";
n_0 [label="b0", shape="plaintext"];
n_0 [label="b_0", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="3"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph c0 {
digraph c_0 {
rankdir="LR";
n_0 [label="c0", shape="plaintext"];
n_0 [label="c_0", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=circle, label="2"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ digraph global {
n_2 [id="2", shape=circle, label="2"];
n_3 [id="3", shape=circle, label="3"];

n_2 -> n_3 [id="[$e|0]", label="test0/0Δa1/0"];
n_1 -> n_2 [id="[$e|1]", label="test0/0Δc0/0"];
n_1 -> n_2 [id="[$e|0]", label="test/0.0Δc/0.0"];
n_2 -> n_3 [id="[$e|1]", label="test/0.0Δa/1.0"];
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
digraph test0 {
digraph test_0 {
rankdir="LR";
n_0 [label="test0", shape="plaintext"];
n_0 [label="test_0", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=circle, label="2"];
n_3 [id="3", shape=doublecircle, label="3"];

n_2 -> n_3 [id="[$e|0]", label="spawn a1/0"];
n_1 -> n_2 [id="[$e|1]", label="spawn c0/0"];
n_2 -> n_3 [id="[$e|0]", label="spawn a/1.0"];
n_1 -> n_2 [id="[$e|1]", label="spawn c/0.0"];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph a1 {
digraph a_1 {
rankdir="LR";
n_0 [label="a1", shape="plaintext"];
n_0 [label="a_1", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=circle, label="2"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph b1 {
digraph b_1 {
rankdir="LR";
n_0 [label="b1", shape="plaintext"];
n_0 [label="b_1", shape="plaintext"];
n_1 [id="1", shape=circle, label="1"];
n_0 -> n_1 [arrowhead=none];
n_2 [id="2", shape=doublecircle, label="2"];
Expand Down
36 changes: 0 additions & 36 deletions examples/test/foo3/test0_global_view.dot

This file was deleted.

41 changes: 41 additions & 0 deletions examples/test/foo3/test_0_global_view.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
digraph global {
rankdir="LR";
n_0 [label="global", shape="plaintext"];
n_1 [id="5", shape=circle, label="5"];
n_2 [id="15", shape=circle, label="15"];
n_3 [id="12", shape=circle, label="12"];
n_4 [id="11", shape=circle, label="11"];
n_5 [id="17", shape=circle, label="17"];
n_6 [id="18", shape=circle, label="18"];
n_7 [id="14", shape=circle, label="14"];
n_8 [id="6", shape=circle, label="6"];
n_9 [id="13", shape=circle, label="13"];
n_10 [id="10", shape=circle, label="10"];
n_11 [id="1", shape=circle, label="1"];
n_0 -> n_11 [arrowhead=none];
n_12 [id="9", shape=circle, label="9"];
n_13 [id="2", shape=circle, label="2"];
n_14 [id="8", shape=circle, label="8"];
n_15 [id="4", shape=circle, label="4"];
n_16 [id="7", shape=circle, label="7"];
n_17 [id="3", shape=circle, label="3"];
n_18 [id="16", shape=circle, label="16"];

n_17 -> n_1 [id="[$e|3]", label="a/1.0→test/0.0:3"];
n_16 -> n_9 [id="[$e|11]", label="b/1.0→test/0.0:2"];
n_10 -> n_18 [id="[$e|14]", label="a/1.0→test/0.0:1"];
n_17 -> n_8 [id="[$e|4]", label="b/1.0→test/0.0:2"];
n_4 -> n_5 [id="[$e|15]", label="a/1.0→test/0.0:3"];
n_12 -> n_2 [id="[$e|13]", label="b/1.0→test/0.0:2"];
n_11 -> n_13 [id="[$e|0]", label="test/0.0Δa/1.0"];
n_15 -> n_14 [id="[$e|6]", label="b/1.0→test/0.0:2"];
n_3 -> n_6 [id="[$e|16]", label="a/1.0→test/0.0:1"];
n_15 -> n_16 [id="[$e|5]", label="a/1.0→test/0.0:3"];
n_8 -> n_4 [id="[$e|9]", label="a/1.0→test/0.0:1"];
n_14 -> n_7 [id="[$e|12]", label="a/1.0→test/0.0:3"];
n_17 -> n_15 [id="[$e|2]", label="a/1.0→test/0.0:1"];
n_13 -> n_17 [id="[$e|1]", label="test/0.0Δb/1.0"];
n_8 -> n_3 [id="[$e|10]", label="a/1.0→test/0.0:3"];
n_1 -> n_12 [id="[$e|7]", label="a/1.0→test/0.0:1"];
n_1 -> n_10 [id="[$e|8]", label="b/1.0→test/0.0:2"];
}
Loading

0 comments on commit ec6e7f8

Please sign in to comment.