diff --git a/examples/bench_04/main.c b/examples/bench_04/main.c index f898b13596e4483661f33688b6f0a93e76946f65..dd190a5dd95562ae804bb87fdf357c953acccdd0 100644 --- a/examples/bench_04/main.c +++ b/examples/bench_04/main.c @@ -8,7 +8,7 @@ int main(int argc, char** argv) { const unsigned char pdl[] = "primitive trivial_loop() { " - " while(true) synchronous{}" + " while(true) sync {}" "} " ; Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); diff --git a/examples/bench_05/main.c b/examples/bench_05/main.c index 874d24951072635f31556b18cd1d753afc1ed124..6cd96626e8afd969756b6e5fa69e4c4ca67373dc 100644 --- a/examples/bench_05/main.c +++ b/examples/bench_05/main.c @@ -9,7 +9,7 @@ int main(int argc, char** argv) { const unsigned char pdl[] = "primitive trivial_loop() { " - " while(true) synchronous{}" + " while(true) sync {}" "} " ; Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); diff --git a/examples/bench_09/main.c b/examples/bench_09/main.c index 4cd3fcf4db542cdd67f9ca4f7bcd03e6fc4bc40b..dcf524313be93c129c46dea4e3213a94a7f2af41 100644 --- a/examples/bench_09/main.c +++ b/examples/bench_09/main.c @@ -12,7 +12,7 @@ int main(int argc, char** argv) { " while(true) { " " i = 0; " " while(i < 2) i++; " - " synchronous {} " + " sync {} " " } " "} " ; diff --git a/examples/bench_11/main.c b/examples/bench_11/main.c index 3f6b4f055cd8392119ee7b947106affb0646d374..3c4002029ee8af18799f7f532da75632eee6bdd9 100644 --- a/examples/bench_11/main.c +++ b/examples/bench_11/main.c @@ -9,7 +9,7 @@ int main(int argc, char** argv) { forwards, num_options); unsigned char pdl[] = "primitive recv_zero(in a) { " - " while(true) synchronous {" + " while(true) sync {" " msg m = get(a); " " assert(m[0] == 0); " " } " diff --git a/examples/bench_23/main.c b/examples/bench_23/main.c index 0e02672f40a12dc197bee343f23f56f4cbe300c2..b27273f1b5bf4e100d76777f425c82e6ad8ae545 100644 --- a/examples/bench_23/main.c +++ b/examples/bench_23/main.c @@ -6,7 +6,7 @@ int main(int argc, char** argv) { // unsigned char pdl[] = "\ // primitive xrouter(in a, out b, out c) {\ - // while(true) synchronous {\ + // while(true) sync {\ // if(fires(a)) {\ // if(fires(b)) put(b, get(a));\ // else put(c, get(a));\ @@ -16,7 +16,7 @@ int main(int argc, char** argv) { // ; unsigned char pdl[] = "\ primitive lossy(in a, out b) {\ - while(true) synchronous {\ + while(true) sync {\ if(fires(a)) {\ msg m = get(a);\ if(fires(b)) put(b, m);\ @@ -24,7 +24,7 @@ int main(int argc, char** argv) { }\ }\ primitive sync_drain(in a, in b) {\ - while(true) synchronous {\ + while(true) sync {\ if(fires(a)) {\ get(a);\ get(b);\ diff --git a/examples/bench_24/main.c b/examples/bench_24/main.c index a8558558a022b50f9918999e806a7b1350cd6d93..1cfde7b7270f7e2ef4da425b28b33d7720ee83a9 100644 --- a/examples/bench_24/main.c +++ b/examples/bench_24/main.c @@ -6,7 +6,7 @@ int main(int argc, char** argv) { unsigned char pdl[] = "\ primitive fifo1_init(msg m, in a, out b) {\ - while(true) synchronous {\ + while(true) sync {\ if(m != null && fires(b)) {\ put(b, m);\ m = null;\ @@ -39,7 +39,7 @@ int main(int argc, char** argv) { // unsigned char pdl[] = "\ // primitive sequencer3(out a, out b, out c) {\ // int i = 0;\ - // while(true) synchronous {\ + // while(true) sync {\ // out to = a;\ // if (i==1) to = b;\ // else if(i==2) to = c;\ diff --git a/examples/bench_27/main.c b/examples/bench_27/main.c index 8471d124fc401559b6fef1281c42e21292a2ca7e..7aa6fa92931fdc1d68dabfa1ef6386c0c7353824 100644 --- a/examples/bench_27/main.c +++ b/examples/bench_27/main.c @@ -9,7 +9,7 @@ int main(int argc, char** argv) { unsigned char pdl[] = "\ primitive xrouter(in a, out b, out c) {\ - while(true) synchronous {\ + while(true) sync {\ if(fires(a)) {\ if(fires(b)) put(b, get(a));\ else put(c, get(a));\ diff --git a/examples/eg_protocols.pdl b/examples/eg_protocols.pdl index 4de6b59a35c1d45e788bee6a58ec0f1a5e9f8c8b..72c7a48f83e16e5d745fb6b4fa5ebcb02f8b091f 100644 --- a/examples/eg_protocols.pdl +++ b/examples/eg_protocols.pdl @@ -1,10 +1,10 @@ primitive pres_2(in i, out o) { - synchronous { + sync { put(o, get(i)); } } primitive together(in ia, in ib, out oa, out ob){ - while(true) synchronous { + while(true) sync { if(fires(ia)) { put(oa, get(ia)); put(ob, get(ib)); @@ -14,7 +14,7 @@ primitive together(in ia, in ib, out oa, out ob){ primitive alt_round_merger(in a, in b, out c){ while(true) { - synchronous{ put(c, get(a)); } - synchronous{ put(c, get(b)); } + sync { put(c, get(a)); } + sync { put(c, get(b)); } } } diff --git a/src/protocol/parser/token_parsing.rs b/src/protocol/parser/token_parsing.rs index c1fe33866a320f12cb0a6aab04db481579eddae1..08cc187fafa331fcfc13633e7d50e3a3700f67e2 100644 --- a/src/protocol/parser/token_parsing.rs +++ b/src/protocol/parser/token_parsing.rs @@ -45,7 +45,7 @@ pub(crate) const KW_STMT_BREAK: &'static [u8] = b"break"; pub(crate) const KW_STMT_CONTINUE: &'static [u8] = b"continue"; pub(crate) const KW_STMT_GOTO: &'static [u8] = b"goto"; pub(crate) const KW_STMT_RETURN: &'static [u8] = b"return"; -pub(crate) const KW_STMT_SYNC: &'static [u8] = b"synchronous"; +pub(crate) const KW_STMT_SYNC: &'static [u8] = b"sync"; pub(crate) const KW_STMT_NEW: &'static [u8] = b"new"; // Keywords - types diff --git a/src/runtime/tests.rs b/src/runtime/tests.rs index 17a6aac7bc715623c08fbdf995688b6dfc39c7e2..b9cf20cd3d9a847e5d489335d4b310605476d26c 100644 --- a/src/runtime/tests.rs +++ b/src/runtime/tests.rs @@ -37,9 +37,9 @@ fn file_logged_configured_connector( Connector::new(file_logger, pd, connector_id) } static MINIMAL_PDL: &'static [u8] = b" -primitive sync(in a, out b) { +primitive sync_component(in a, out b) { while (true) { - synchronous { + sync { if (fires(a) && fires(b)) { msg x = get(a); put(b, x); @@ -51,7 +51,7 @@ primitive sync(in a, out b) { } primitive together(in ia, in ib, out oa, out ob){ - while(true) synchronous { + while(true) sync { if(fires(ia)) { put(oa, get(ia)); put(ob, get(ib)); @@ -102,7 +102,7 @@ fn new_sync() { let test_log_path = Path::new("./logs/new_sync"); let mut c = file_logged_connector(0, test_log_path); let [o, i] = c.new_port_pair(); - c.add_component(b"", b"sync", &[i, o]).unwrap(); + c.add_component(b"", b"sync_component", &[i, o]).unwrap(); } #[test] @@ -353,7 +353,7 @@ fn cannot_use_moved_ports() { let test_log_path = Path::new("./logs/cannot_use_moved_ports"); let mut c = file_logged_connector(0, test_log_path); let [p, g] = c.new_port_pair(); - c.add_component(b"", b"sync", &[g, p]).unwrap(); + c.add_component(b"", b"sync_component", &[g, p]).unwrap(); c.connect(SEC1).unwrap(); c.put(p, TEST_MSG.clone()).unwrap_err(); c.get(g).unwrap_err(); @@ -369,7 +369,7 @@ fn sync_sync() { let mut c = file_logged_connector(0, test_log_path); let [p0, g0] = c.new_port_pair(); let [p1, g1] = c.new_port_pair(); - c.add_component(b"", b"sync", &[g0, p1]).unwrap(); + c.add_component(b"", b"sync_component", &[g0, p1]).unwrap(); c.connect(SEC1).unwrap(); c.put(p0, TEST_MSG.clone()).unwrap(); c.get(g1).unwrap(); @@ -421,7 +421,7 @@ fn distributed_msg_bounce() { c.new_net_port(Putter, sock_addrs[0], Active).unwrap(), c.new_net_port(Getter, sock_addrs[1], Active).unwrap(), ]; - c.add_component(b"", b"sync", &[g, p]).unwrap(); + c.add_component(b"", b"sync_component", &[g, p]).unwrap(); c.connect(SEC1).unwrap(); c.sync(SEC1).unwrap(); }); @@ -882,7 +882,7 @@ fn ac_not_b() { let pdl = b" primitive ac_not_b(in a, in b, out c){ // forward A to C but keep B silent - synchronous{ put(c, get(a)); } + sync { put(c, get(a)); } }"; let pd = Arc::new(reowolf::ProtocolDescription::parse(pdl).unwrap()); let mut c = file_logged_configured_connector(1, test_log_path, pd); @@ -946,7 +946,7 @@ fn many_rounds_mem() { fn pdl_reo_lossy() { let pdl = b" primitive lossy(in a, out b) { - while(true) synchronous { + while(true) sync { msg m = null; if(fires(a)) { m = get(a); @@ -965,7 +965,7 @@ fn pdl_reo_fifo1() { let pdl = b" primitive fifo1(in a, out b) { msg m = null; - while(true) synchronous { + while(true) sync { if(m == null) { if(fires(a)) m=get(a); } else { @@ -985,7 +985,7 @@ fn pdl_reo_fifo1full() { primitive fifo1full(in a, out b) { bool is_set = true; msg m = create(0); - while(true) synchronous { + while(true) sync { if(!is_set) { if(fires(a)) m=get(a); is_set = false; @@ -1012,7 +1012,7 @@ fn pdl_msg_consensus() { let test_log_path = Path::new("./logs/pdl_msg_consensus"); let pdl = b" primitive msgconsensus(in a, in b) { - while(true) synchronous { + while(true) sync { msg x = get(a); msg y = get(b); assert(x == y); @@ -1040,7 +1040,7 @@ fn sequencer3_prim() { let pdl = b" primitive sequencer3(out a, out b, out c) { u32 i = 0; - while(true) synchronous { + while(true) sync { out to = a; if (i==1) to = b; else if(i==2) to = c; @@ -1087,7 +1087,7 @@ fn sequencer3_comp() { let pdl = b" primitive replicator(in a, out b, out c) { while (true) { - synchronous { + sync { if (fires(a) && fires(b) && fires(c)) { msg x = get(a); put(b, x); @@ -1099,7 +1099,7 @@ fn sequencer3_comp() { } } primitive fifo1_init(bool has_value, T m, in a, out b) { - while(true) synchronous { + while(true) sync { if(has_value && fires(b)) { put(b, m); has_value = false; @@ -1181,7 +1181,7 @@ fn xrouter_prim() { let test_log_path = Path::new("./logs/xrouter_prim"); let pdl = b" primitive xrouter(in a, out b, out c) { - while(true) synchronous { + while(true) sync { if(fires(a)) { if(fires(b)) put(b, get(a)); else put(c, get(a)); @@ -1222,7 +1222,7 @@ fn xrouter_comp() { let pdl = b" primitive replicator(in a, out b, out c) { while (true) { - synchronous { + sync { if (fires(a) && fires(b) && fires(c)) { msg x = get(a); put(b, x); @@ -1236,7 +1236,7 @@ fn xrouter_comp() { primitive merger(in a, in b, out c) { while (true) { - synchronous { + sync { if (fires(a) && !fires(b) && fires(c)) { put(c, get(a)); } else if (!fires(a) && fires(b) && fires(c)) { @@ -1249,7 +1249,7 @@ fn xrouter_comp() { } primitive lossy(in a, out b) { - while(true) synchronous { + while(true) sync { if(fires(a)) { auto m = get(a); if(fires(b)) put(b, m); @@ -1257,7 +1257,7 @@ fn xrouter_comp() { } } primitive sync_drain(in a, in b) { - while(true) synchronous { + while(true) sync { if(fires(a)) { msg drop_it = get(a); msg on_the_floor = get(b); @@ -1320,7 +1320,7 @@ fn count_stream() { primitive count_stream(out o) { msg m = create(1); m[0] = 0; - while(true) synchronous { + while(true) sync { put(o, m); m[0] += 1; } @@ -1351,7 +1351,7 @@ fn for_msg_byte() { while(i<8) { msg m = create(1); m[idx] = i; - synchronous put(o, m); + sync put(o, m); i += 1; } } @@ -1379,7 +1379,7 @@ fn eq_causality() { primitive eq(in a, in b, out c) { msg ma = create(0); msg mb = create(0); - while(true) synchronous { + while(true) sync { if(fires(a)) { // b and c also fire! // left first! @@ -1435,7 +1435,7 @@ fn eq_no_causality() { primitive eqinner(in a, in b, out c, out leftfirsto, in leftfirsti) { msg ma = create(0); msg mb = create(0); - while(true) synchronous { + while(true) sync { if(fires(a)) { // b and c also fire! if(fires(leftfirsti)) { diff --git a/src/runtime2/tests/api_component.rs b/src/runtime2/tests/api_component.rs index 1e8055b09758b6f63091deb8f3cc8f6ba5f1cd40..28f7101520dec6d0d1c9075645339ecec5f161a5 100644 --- a/src/runtime2/tests/api_component.rs +++ b/src/runtime2/tests/api_component.rs @@ -11,7 +11,7 @@ fn test_put_and_get() { primitive handler(in request, out response, u32 loops) { u32 index = 0; while (index < loops) { - synchronous { + sync { auto value = get(request); put(response, value * 2); } @@ -54,7 +54,7 @@ fn test_getting_from_component() { const CODE: &'static str =" primitive loop_sender(out numbers, u32 cur, u32 last) { while (cur < last) { - synchronous { + sync { put(numbers, cur); cur += 1; } @@ -93,7 +93,7 @@ fn test_putting_to_component() { const CODE: &'static str = " primitive loop_receiver(in numbers, u32 cur, u32 last) { while (cur < last) { - synchronous { + sync { auto number = get(numbers); assert(number == cur); cur += 1; diff --git a/src/runtime2/tests/network_shapes.rs b/src/runtime2/tests/network_shapes.rs index cdaa5991cbb3f3952a93b0582bca7be8880c12f6..723d039e25fc7675c63ab5e8419ccd10a172f6e1 100644 --- a/src/runtime2/tests/network_shapes.rs +++ b/src/runtime2/tests/network_shapes.rs @@ -8,7 +8,7 @@ fn test_put_and_get() { primitive putter(out sender, u32 loops) { u32 index = 0; while (index < loops) { - synchronous { + sync { put(sender, true); } index += 1; @@ -18,7 +18,7 @@ fn test_put_and_get() { primitive getter(in receiver, u32 loops) { u32 index = 0; while (index < loops) { - synchronous { + sync { auto result = get(receiver); assert(result); } @@ -49,7 +49,7 @@ fn test_star_shaped_request() { primitive edge(in input, out output, u32 loops) { u32 index = 0; while (index < loops) { - synchronous { + sync { auto req = get(input); put(output, req * 2); } @@ -63,7 +63,7 @@ fn test_star_shaped_request() { while (loop_index < loops) { // print(\"starting loop\"); - synchronous { + sync { u32 edge_index = 0; u32 sum = 0; while (edge_index < num_edges) { @@ -115,7 +115,7 @@ fn test_conga_line_request() { u32 loop_index = 0; u32 initial_value = 1337; while (loop_index < num_loops) { - synchronous { + sync { put(req, initial_value); auto result = get(resp); assert(result == initial_value + num_nodes * 2); @@ -131,7 +131,7 @@ fn test_conga_line_request() { ) { u32 loop_index = 0; while (loop_index < num_loops) { - synchronous { + sync { auto req = get(req_in); put(req_forward, req + 1); auto resp = get(resp_in); @@ -144,7 +144,7 @@ fn test_conga_line_request() { primitive end(in req_in, out resp_out, u32 num_loops) { u32 loop_index = 0; while (loop_index < num_loops) { - synchronous { + sync { auto req = get(req_in); put(resp_out, req); } diff --git a/testdata/parser/negative/1.pdl b/testdata/parser/negative/1.pdl index 4f0fafc1f9d3ade96980f3dd09e93b65e97225e7..22648169831112ea824afff2a7d564c8169f3c4f 100644 --- a/testdata/parser/negative/1.pdl +++ b/testdata/parser/negative/1.pdl @@ -3,8 +3,8 @@ // sync block nested twice in primitive primitive main(in a, out b) { while (true) { - synchronous { - synchronous {} + sync { + sync {} } } } diff --git a/testdata/parser/negative/1.txt b/testdata/parser/negative/1.txt index c058a7760693fbb6d6d4dc63b4f34c4b8de76e8c..784143a9e09e5acfb1c00417753d1a3d510bf961 100644 --- a/testdata/parser/negative/1.txt +++ b/testdata/parser/negative/1.txt @@ -1,3 +1,3 @@ Parse error at 1.pdl:7:4: Illegal nested synchronous statement - synchronous {} + sync {} ^ diff --git a/testdata/parser/negative/10.pdl b/testdata/parser/negative/10.pdl index 60a8f81d01887a82d29e983b883efae781be3da4..5aad08d66854192cd6250258dee63a4fbdb61249 100644 --- a/testdata/parser/negative/10.pdl +++ b/testdata/parser/negative/10.pdl @@ -3,9 +3,9 @@ // sync block nested in sync block primitive main(in a, out b) { while (true) { - synchronous { + sync { if (false || true) { - synchronous { + sync { skip; } } diff --git a/testdata/parser/negative/10.txt b/testdata/parser/negative/10.txt index 439a71d657dd786f5f5f8f14e75563f06360d437..5d5e749c38785814f5ba186420ab90b45fddafa3 100644 --- a/testdata/parser/negative/10.txt +++ b/testdata/parser/negative/10.txt @@ -1,3 +1,3 @@ Parse error at 10.pdl:8:5: Illegal nested synchronous statement - synchronous { + sync { ^ diff --git a/testdata/parser/negative/12.pdl b/testdata/parser/negative/12.pdl index 049b2b4539efcd49d3a04651aa5be79336571e3d..fc8d136b2c35e1ce36ab1b85a5814f64b57c1a8b 100644 --- a/testdata/parser/negative/12.pdl +++ b/testdata/parser/negative/12.pdl @@ -4,6 +4,6 @@ primitive main(in a, out b) { while (true) { channel x -> y; - synchronous {} + sync {} } } diff --git a/testdata/parser/negative/19.pdl b/testdata/parser/negative/19.pdl index 66a30eed35ce366e127cde061aefad4d89bc8336..583cf1896967b4845e438b8672005c2839d73fa4 100644 --- a/testdata/parser/negative/19.pdl +++ b/testdata/parser/negative/19.pdl @@ -2,7 +2,7 @@ primitive main(in a) { while (true) { - synchronous { + sync { if (fires(a)) { return 5; } else { diff --git a/testdata/parser/negative/24.pdl b/testdata/parser/negative/24.pdl index aa44bdda2068eb610250dd1932822fa70c0b8afa..8e7ee6e0b969b1fc5a99a9729cb3f6c5b9383fee 100644 --- a/testdata/parser/negative/24.pdl +++ b/testdata/parser/negative/24.pdl @@ -7,7 +7,7 @@ primitive main(in a, out b) { y %= x -= 3; x *= x * x *= 5; while (true) { - synchronous { + sync { assert fires(a) == fires(b); } } diff --git a/testdata/parser/negative/3.pdl b/testdata/parser/negative/3.pdl index 67caa9d0a862f387cb25a7d1c04c81df7eead3c3..b62869969dc222da490e6fed9dd101206864d5d3 100644 --- a/testdata/parser/negative/3.pdl +++ b/testdata/parser/negative/3.pdl @@ -4,7 +4,7 @@ composite main(in a, out b) { channel x -> y; while (true) { - synchronous { + sync { skip; } } diff --git a/testdata/parser/negative/3.txt b/testdata/parser/negative/3.txt index 010dcbaa770c39d19aa5ad9b8d20902b4ba12a62..d989513aa104beadaff14a695470bbbc13f7c063 100644 --- a/testdata/parser/negative/3.txt +++ b/testdata/parser/negative/3.txt @@ -1,3 +1,3 @@ Parse error at 3.pdl:7:3: Illegal nested synchronous statement - synchronous { + sync { ^ diff --git a/testdata/parser/negative/31.pdl b/testdata/parser/negative/31.pdl index d4aa9911681b1145e612483995e90856766bca56..c2415a04268b2000055f88105679cc60b04a9275 100644 --- a/testdata/parser/negative/31.pdl +++ b/testdata/parser/negative/31.pdl @@ -2,7 +2,7 @@ primitive main(int a) { while (true) { - synchronous { + sync { break; // not allowed } } diff --git a/testdata/parser/negative/32.pdl b/testdata/parser/negative/32.pdl index 0d9cecc51e6e4f4019b88889b6714e6cc64a7c30..6d7446d6580cc08e873c367ccde51b9697a63667 100644 --- a/testdata/parser/negative/32.pdl +++ b/testdata/parser/negative/32.pdl @@ -2,7 +2,7 @@ primitive main(int a) { loop: { - synchronous { + sync { goto loop; // not allowed } } diff --git a/testdata/parser/negative/4.pdl b/testdata/parser/negative/4.pdl index bf323606bd952b1d97999d4a9f14d35e1e4bfadc..9d34caa72fdaefd46c77bfc59cf8d91b89b38fa8 100644 --- a/testdata/parser/negative/4.pdl +++ b/testdata/parser/negative/4.pdl @@ -6,7 +6,7 @@ primitive main(in a, out b) { msg y = create(0); // legal while (x < 10) { y = get(a); // illegal - synchronous { + sync { y = get(a); // legal } } diff --git a/testdata/parser/negative/6.pdl b/testdata/parser/negative/6.pdl index 7f523a40d6a8bf1b7912888956be1a8da25803c6..e14397e74e2eb9a777d743bb0ab71782c3b8cfaa 100644 --- a/testdata/parser/negative/6.pdl +++ b/testdata/parser/negative/6.pdl @@ -4,5 +4,5 @@ import std.reo; // duplicate formal parameters composite main(in a, out a) { - new sync(a, a); + new sync_component(a, a); } diff --git a/testdata/parser/negative/7.pdl b/testdata/parser/negative/7.pdl index b37b28604db2ba82798625f4cbcb04ca35b8f69f..6dc6bee31260777ad45fad4e26eef61e3d43224b 100644 --- a/testdata/parser/negative/7.pdl +++ b/testdata/parser/negative/7.pdl @@ -5,5 +5,5 @@ import std.reo; // shadowing formal parameter composite main(in a, out b) { channel c -> a; - new sync(a, b); + new sync_component(a, b); } diff --git a/testdata/parser/negative/8.pdl b/testdata/parser/negative/8.pdl index af9f36c5b48055bad30484961575675acaa8a77c..7adf05b4d5063b151a358fb367edf3ab2ef78961 100644 --- a/testdata/parser/negative/8.pdl +++ b/testdata/parser/negative/8.pdl @@ -10,7 +10,7 @@ composite main(in a, out b) { // shadowing import primitive syncdrain(in a, in b) { while (true) { - synchronous { + sync { if (!fires(a) || !fires(b)) { block(a); block(b); diff --git a/testdata/parser/positive/1.pdl b/testdata/parser/positive/1.pdl index 9e88a779636f927945eae0fd3a4ed04379deac03..725f98df28b34b207f823d46141a845dc0e75cac 100644 --- a/testdata/parser/positive/1.pdl +++ b/testdata/parser/positive/1.pdl @@ -11,7 +11,7 @@ composite main(in asend, out arecv, in bsend, out brecv) { primitive replicator(in a, out b, out c) { while (true) { - synchronous { + sync { if (fires(a) && fires(b) && fires(c)) { msg x = get(a); put(b, x); @@ -40,7 +40,7 @@ composite sequencer(in x, in y) { primitive syncdrain(in a, in b) { while (true) { - synchronous { + sync { if (fires(a) && fires(b)) { get(a); get(b); @@ -54,7 +54,7 @@ primitive syncdrain(in a, in b) { primitive fifo(in a, out b, msg init) { msg c = init; while (true) { - synchronous { + sync { if (c != null) { assert !fires(a); if (fires(b)) { @@ -75,7 +75,7 @@ primitive sequencer2(in x, in y) { while (true) { boolean b = false; while (!b) { - synchronous { + sync { assert !fires(y); if (fires(x)) b = true; @@ -83,7 +83,7 @@ primitive sequencer2(in x, in y) { } b = false; while (!b) { - synchronous { + sync { assert !fires(x); if (fires(y)) b = true; diff --git a/testdata/parser/positive/10.pdl b/testdata/parser/positive/10.pdl index 0c5d30773f0a2016c9910948ff7b9de81e2c4cb2..90775a2e3eebce117a5dd01995229ae5d903480b 100644 --- a/testdata/parser/positive/10.pdl +++ b/testdata/parser/positive/10.pdl @@ -4,7 +4,7 @@ composite main() {} primitive example(in a, out[] b) { while (true) { - synchronous { + sync { if (fires(a)) { int i = 0; while (i < b.length) { diff --git a/testdata/parser/positive/11.pdl b/testdata/parser/positive/11.pdl index 43fea6c6c4c47556c13694ea8a084d31ce21be93..13f7f57bc2d5afdf5853057957afeab1fc91788a 100644 --- a/testdata/parser/positive/11.pdl +++ b/testdata/parser/positive/11.pdl @@ -3,13 +3,13 @@ primitive main(in a, out b) { msg x = null; while (x == null) { - synchronous { + sync { if (fires(a)) x = get(a); } } while (true) { - synchronous { + sync { if (fires(b)) put(b, x); } diff --git a/testdata/parser/positive/12.pdl b/testdata/parser/positive/12.pdl index 1ac91cd80217398a5d0b89f821a4a03c521ff563..8647d44b9249e4d85a23309ec6aa540047e2f247 100644 --- a/testdata/parser/positive/12.pdl +++ b/testdata/parser/positive/12.pdl @@ -7,7 +7,7 @@ primitive main(in a, out b) { y %= x -= 3; x *= x * (x *= 5); while (true) { - synchronous { + sync { assert fires(a) == fires(b); } } diff --git a/testdata/parser/positive/13.pdl b/testdata/parser/positive/13.pdl index a146785267d8b5ad9a95990187756968d6c969b4..910fb084be3046388f25b474fd5497dcc6460da0 100644 --- a/testdata/parser/positive/13.pdl +++ b/testdata/parser/positive/13.pdl @@ -14,7 +14,7 @@ composite example(in[] a, in[] b, out x) { primitive resolve(in[] a, in[] b, out x) { while (true) { - synchronous { + sync { int i = 0; while (i < a.length && i < b.length) { if (fires(a[i]) && fires(b[i])) { @@ -31,7 +31,7 @@ primitive resolve(in[] a, in[] b, out x) { primitive async(in[] a) { while (true) { - synchronous { + sync { int i = 0; while (i < a.length) if (fires(a[i++])) break; diff --git a/testdata/parser/positive/14.pdl b/testdata/parser/positive/14.pdl index 622e756f27a3218031b0ed0e475eb22f95d6aac3..4ac063f5521d7f24c3f260fcc067f10783792209 100644 --- a/testdata/parser/positive/14.pdl +++ b/testdata/parser/positive/14.pdl @@ -3,13 +3,13 @@ composite main(out c) { channel ao -> ai; channel bo -> bi; - new sync(ai, bo); + new sync_component(ai, bo); new binary_replicator(bi, ao, c); } primitive sync(in a, out b) { while (true) { - synchronous { + sync { if (fires(a) && fires(b)) { msg x = get(a); put(b, x); @@ -22,7 +22,7 @@ primitive sync(in a, out b) { primitive binary_replicator(in b, out a, out c) { while (true) { - synchronous { + sync { if (fires(b) && fires(a) && fires(c)) { msg x = get(b); put(a, x); diff --git a/testdata/parser/positive/15.pdl b/testdata/parser/positive/15.pdl index 8c4ceabd007701e0e5089e763fbaa866d7b56e7d..b01b83017d78daa2452998ad67b8ea4408244bec 100644 --- a/testdata/parser/positive/15.pdl +++ b/testdata/parser/positive/15.pdl @@ -7,7 +7,7 @@ composite main(out c) { channel bo -> bi; channel axo -> axi; channel zo -> zi; - new sync(ai, bo); + new sync_component(ai, bo); new replicator(bi, {axo, c}); new consensus({axi, zi}, ao); new generator(zo); diff --git a/testdata/parser/positive/16.pdl b/testdata/parser/positive/16.pdl index 604bdf0bd56c3344fc9ff34aa8e2919924f348b5..06d6a4ef972caee119206004cf47bb3cdcab5d7d 100644 --- a/testdata/parser/positive/16.pdl +++ b/testdata/parser/positive/16.pdl @@ -7,7 +7,7 @@ composite main() { } primitive a(in x) { - synchronous { + sync { msg m = get(x); assert m.length == 5; assert m[0] == 'h'; @@ -25,7 +25,7 @@ primitive b(out x) { } // or primitive c(out x) { - synchronous { + sync { msg m = create(5); m[0] = 'h'; m[1] = 'e'; diff --git a/testdata/parser/positive/17.pdl b/testdata/parser/positive/17.pdl index 6b3934d0a050516cac284b7a5684f1918c27d421..36f68933457d82badaa6e40018f542f3f756a062 100644 --- a/testdata/parser/positive/17.pdl +++ b/testdata/parser/positive/17.pdl @@ -8,7 +8,7 @@ primitive prophet(in b, out a) { msg c = null; while (true) { if (c != null) { - synchronous { + sync { assert !fires(a); if (fires(b)) { assert get(b) == c; @@ -31,7 +31,7 @@ primitive fifo(in a, out b, msg init) { msg c = init; while (true) { if (c != null) { - synchronous { + sync { assert !fires(a); if (fires(b)) { put(b, c); @@ -39,7 +39,7 @@ primitive fifo(in a, out b, msg init) { } } } else { - synchronous { + sync { assert !fires(b); if (fires(a)) { c = get(a); diff --git a/testdata/parser/positive/18.pdl b/testdata/parser/positive/18.pdl index 5482cb85c351f86974ce4d87eb7b4936c98719d0..1427b45e186abd5cfb8437eb09e37c4402695a75 100644 --- a/testdata/parser/positive/18.pdl +++ b/testdata/parser/positive/18.pdl @@ -12,7 +12,7 @@ primitive main1(in a, out c) { x = 1; y = 1; while (true) { - synchronous { + sync { if (x > 0 && fires(a)) { z = get(a); x--; @@ -23,7 +23,7 @@ primitive main1(in a, out c) { y++; } } - synchronous { + sync { assert !fires(a) && !fires(c); if (z != null && y > 0) { w = z; diff --git a/testdata/parser/positive/19.pdl b/testdata/parser/positive/19.pdl index 4084ce9e3962ab5893ccff2dbbd566060e0160f3..5eb964bf010b2f0c98471cac62e44d0c81d1160d 100644 --- a/testdata/parser/positive/19.pdl +++ b/testdata/parser/positive/19.pdl @@ -3,7 +3,7 @@ composite main() {} primitive example(int a) { - synchronous { + sync { loop: { goto loop; // allowed } diff --git a/testdata/parser/positive/2.pdl b/testdata/parser/positive/2.pdl index dedfb7e3075677fafdf54038b47287aec80f28cf..08c6424301a45f808a1d76f042f2c32144387dd6 100644 --- a/testdata/parser/positive/2.pdl +++ b/testdata/parser/positive/2.pdl @@ -16,7 +16,7 @@ composite main(in asend, out arecv, in bsend, out brecv, in csend, out crecv) { primitive mymerger(in a, in b, out c) { while (true) { - synchronous { + sync { if (fires(a) && !fires(b) && fires(c)) { put(c, get(a)); } else if (!fires(a) && fires(b) && fires(c)) { diff --git a/testdata/parser/positive/3.pdl b/testdata/parser/positive/3.pdl index 11fb1a52fb3b3a1f5b7b6efa41abb16b1c47291a..f458ce5c398c5ff7a416c4e4a3577b41fcfbcf0a 100644 --- a/testdata/parser/positive/3.pdl +++ b/testdata/parser/positive/3.pdl @@ -30,7 +30,7 @@ composite main(in ai, out ao, in bi, out bo, in ci, out co, in di, out do) { primitive computeMax(in a, in b, in c, in d, out x) { while (true) { - synchronous { + sync { if (fires(a) && fires(b) && fires(c) && fires(d) && fires(x)) { msg aa = get(a); msg bb = get(b); diff --git a/testdata/parser/positive/5.pdl b/testdata/parser/positive/5.pdl index 4f3d6a9663bbe4901a06f0c31688497c94603e4a..3804782f9308b5b139d3e24069ba8ba88f7acf20 100644 --- a/testdata/parser/positive/5.pdl +++ b/testdata/parser/positive/5.pdl @@ -5,7 +5,7 @@ import std.buf; primitive main(in a, out b) { while (true) { - synchronous { + sync { if (fires(a) && fires(b)) { msg x = get(a); short y = readShort(x, 0); diff --git a/testdata/parser/positive/6.pdl b/testdata/parser/positive/6.pdl index 77e1fc1425fa1f815789da3388fb394cdfe017a2..a9bdfc9f55bac1624572a645d06796ea3adc37fb 100644 --- a/testdata/parser/positive/6.pdl +++ b/testdata/parser/positive/6.pdl @@ -14,7 +14,7 @@ composite replicator(in a, out[] b) { if (b.length == 0) { new blocking(a); } else if (b.length == 1) { - new sync(a, b[0]); + new sync_component(a, b[0]); } else { channel xo -> xi; new binary_replicator(a, b[0], xo); @@ -23,7 +23,7 @@ composite replicator(in a, out[] b) { } primitive binary_replicator(in a, out b, out c) { while (true) { - synchronous { + sync { if (fires(a) && fires(b) && fires(c)) { msg x = get(a); put(b, x); @@ -35,7 +35,7 @@ primitive binary_replicator(in a, out b, out c) { } } primitive blocking(in a) { - while (true) synchronous { + while (true) sync { assert !fires(a); } } @@ -52,12 +52,12 @@ composite merger(in[] a, out b) { prev = yi; i++; } - new sync(prev, b); + new sync_component(prev, b); } } primitive binary_merger(in a, in b, out c) { while (true) { - synchronous { + sync { if (fires(a) && fires(c)) { assert !fires(b); put(c, get(a)); @@ -71,14 +71,14 @@ primitive binary_merger(in a, in b, out c) { } } primitive silent(out a) { - while (true) synchronous { + while (true) sync { assert !fires(a); } } primitive sync(in a, out b) { while (true) { - synchronous { + sync { if (fires(a) && fires(b)) { put(b, get(a)); } else { diff --git a/testdata/parser/positive/7.pdl b/testdata/parser/positive/7.pdl index ffa6bbf17b4a7a656efeaee75ed0d48491c049ae..8287e88afd2e3b4ca72fec7eb7eb7815b78d8709 100644 --- a/testdata/parser/positive/7.pdl +++ b/testdata/parser/positive/7.pdl @@ -50,7 +50,7 @@ composite puzzle(in[] a, in[] b, out x) { primitive resolve(in[] a, in[] b, out x) { while (true) { - synchronous { + sync { int i = 0; while (i < a.length && i < b.length) { if (fires(a[i]) && fires(b[i])) { @@ -67,7 +67,7 @@ primitive resolve(in[] a, in[] b, out x) { primitive async(in[] a) { while (true) { - synchronous { + sync { int i = 0; int j = 0; while (i < a.length) { diff --git a/testdata/parser/positive/8.pdl b/testdata/parser/positive/8.pdl index d7b37e7c5089fe3b04637d38e03992b9b77e9c10..12028358391187f031051c78f9f5e6267ce07a0e 100644 --- a/testdata/parser/positive/8.pdl +++ b/testdata/parser/positive/8.pdl @@ -31,7 +31,7 @@ composite main(out x) { primitive evil_or_odious(in x, out y) { while (true) { - synchronous { + sync { if (fires(x) && fires(y)) { msg a = get(x); msg result = create(1); @@ -53,7 +53,7 @@ primitive evil_or_odious(in x, out y) { primitive recorder(out h, in a) { msg c = create(0); while (true) { - synchronous { + sync { if (fires(h) && fires(a)) { put(h, c); { diff --git a/testdata/parser/positive/tarry.pdl b/testdata/parser/positive/tarry.pdl index 78582acc437fe5cfff483421127fae22f21786ff..e1ef90cfdaada7279a8a1047037979ebb1033006 100644 --- a/testdata/parser/positive/tarry.pdl +++ b/testdata/parser/positive/tarry.pdl @@ -43,7 +43,7 @@ primitive initiator(in start, out end, in[] peeri, out[] peero) { while (true) { // Step 1. Initiator waits for token while (token == null) { - synchronous { + sync { if (fires(start)) { token = get(start); } @@ -59,7 +59,7 @@ primitive initiator(in start, out end, in[] peeri, out[] peero) { int idx = 0; // Select first channel that accepts our token while (token != null) { - synchronous { + sync { int i = 0; while (i < neighboro.length) { if (fires(neighboro[i])) { @@ -78,7 +78,7 @@ primitive initiator(in start, out end, in[] peeri, out[] peero) { neighboro = neighboro[0:idx] @ neighboro[idx:neighboro.length]; // Step 3. Await return of token while (token == null) { - synchronous { + sync { int i = 0; while (i < peeri.length + neighbori.length) { if (fires(peeri@neighbori[i])) { @@ -91,7 +91,7 @@ primitive initiator(in start, out end, in[] peeri, out[] peero) { } // Step 4. Token is back and all neighbors visited while (token != null) { - synchronous { + sync { if (fires(end)) { put(end, token); token = null; @@ -111,7 +111,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { int idx = 0; // Step 1. Await token for first time while (token == null) { - synchronous { + sync { int i = 0; while (i < peeri.length) { if (fires(peeri[i])) { @@ -131,7 +131,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { peero = {}; // Step 2. Non-initiator signals while (token != null) { - synchronous { + sync { if (fires(end)) { put(end, token); token = null; @@ -139,7 +139,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { } } while (token == null) { - synchronous { + sync { if (fires(start)) { token = get(start); } @@ -150,7 +150,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { idx = 0; // Select first channel that accepts our token while (token != null) { - synchronous { + sync { int i = 0; while (i < neighboro.length) { if (fires(neighboro[i])) { @@ -169,7 +169,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { neighboro = neighboro[0:idx] @ neighboro[idx:neighboro.length]; // Step 4. Await return of token while (token == null) { - synchronous { + sync { int i = 0; while (i < peeri.length + neighbori.length) { if (fires(peeri@neighbori[i])) { @@ -182,7 +182,7 @@ primitive noninitiator(out start, in end, in[] peeri, out[] peero) { } // Step 5. Token is back, pass to parent while (token != null) { - synchronous { + sync { if (fires(parento[0])) { put(parento[0], token); token = null;