You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
The rewrite rule below will not fire unless the ... between select ... selBranch is the same between both of the goRoutine cells.
In other words, the ... with the comment FIRST needed to match ... with the comment THIRD, and the ... with the comment SECOND needed to match ... with the comment FOURTH.
The work-around was to change the rewrite rule to the rule below, where the <select> ... ... </select> was removed from the receive's goroutine as follows:
git clone https://github.com/dfava/mmgo.git
cd mmgo
git checkout 8e518b71f89b4b2f8f152c56da99a4d17fb31e27
cd src/k/mmgo-dw
kompile mmgo.k
krun ../../mmgo/tests/sel_sel_sync.mmgo
krun ../../mmgo/tests/sel_sel_sync_bizarre.mmgo
The krun ../../mmgo/tests/sel_sel_sync.mmgo shows the bug, and the command krun ../../mmgo/tests/sel_sel_sync_bizarre.mmgo shows how the bug does not manifest if the contents of ... are made to match between the goroutines.
The configuration is in ./mmgo/src/k/mmgo/mmgo-common.k and the rewrite rule in question is the last rewrite rule in the file ./mmgo/src/k/mmgo/mmgo-select.k.
It reproduces on https://github.com/kframework/k.git on the top of the tree; which, at the time of filing the bug corresponds to commit 41dd07936bd92c2b9982e82653aaa23d79f8164c.
Background
In case it is helpful, here is some background about the rewrite rules:
I'm implementing a guarded command language with message passing.
select {
{ let G1 in T1 }
...
{ let Gn in Tn }
{ default }
}
The guards Gi try to send or receive a message on/from a channel.
If no guard Gi can fire (perhaps it tries to send on a channel that is full, or receive on a channel that is empty), then the default branch is taken.
I create a selBranch cell inside a select cell for each branch { let Gi in Ti } in the select statement.
The rule I'm implementing is synchronous communication between two threads. The rule reduces by combining 1) a branch of a select statement in one thread and 2) a branch of a select statement in a different thread.
The text was updated successfully, but these errors were encountered:
The rewrite rule below will not fire unless the
...
betweenselect ... selBranch
is the same between both of the goRoutine cells.In other words, the
...
with the comment FIRST needed to match...
with the comment THIRD, and the...
with the comment SECOND needed to match...
with the comment FOURTH.The work-around was to change the rewrite rule to the rule below, where the
<select> ... ... </select>
was removed from the receive's goroutine as follows:To reproduce:
The
krun ../../mmgo/tests/sel_sel_sync.mmgo
shows the bug, and the commandkrun ../../mmgo/tests/sel_sel_sync_bizarre.mmgo
shows how the bug does not manifest if the contents of...
are made to match between the goroutines.The configuration is in
./mmgo/src/k/mmgo/mmgo-common.k
and the rewrite rule in question is the last rewrite rule in the file./mmgo/src/k/mmgo/mmgo-select.k
.It reproduces on
https://github.com/kframework/k.git
on the top of the tree; which, at the time of filing the bug corresponds to commit41dd07936bd92c2b9982e82653aaa23d79f8164c
.Background
In case it is helpful, here is some background about the rewrite rules:
I'm implementing a guarded command language with message passing.
The guards
Gi
try to send or receive a message on/from a channel.If no guard
Gi
can fire (perhaps it tries to send on a channel that is full, or receive on a channel that is empty), then the default branch is taken.I create a
selBranch
cell inside aselect
cell for each branch{ let Gi in Ti }
in the select statement.The rule I'm implementing is synchronous communication between two threads. The rule reduces by combining 1) a branch of a select statement in one thread and 2) a branch of a select statement in a different thread.
The text was updated successfully, but these errors were encountered: