A fully working version of the scheduling language with added examples

This commit is contained in:
robbe 2025-06-27 12:21:41 +02:00
parent ec42f74960
commit ebfd85a666
126 changed files with 7235 additions and 981 deletions

View file

@ -0,0 +1,489 @@
import io
import os
import sys
import unittest
sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
)
from icecream import ic
from api.od import ODAPI
from bootstrap.scd import bootstrap_scd
from examples.schedule import rule_schedular
from examples.schedule.rule_schedular import ScheduleActionGenerator
from state.devstate import DevState
from transformation.ramify import ramify
from util import loader
class Test_Meta_Model(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.dir = os.path.dirname(__file__)
state = DevState()
scd_mmm = bootstrap_scd(state)
with open(f"{cls.dir}/models/mm_petrinet.od") as file:
mm_s = file.read()
with open(f"{cls.dir}/models/m_petrinet.od") as file:
m_s = file.read()
mm = loader.parse_and_check(state, mm_s, scd_mmm, "mm")
m = loader.parse_and_check(state, m_s, mm, "m")
mm_rt_ramified = ramify(state, mm)
cls.model_param = (state, m, mm)
cls.generator_param = (state, mm, mm_rt_ramified)
def setUp(self):
self.model = ODAPI(*self.model_param)
self.out = io.StringIO()
self.generator = ScheduleActionGenerator(
*self.generator_param,
directory=self.dir + "/models",
verbose=True,
outstream=self.out,
)
def _test_conformance(
self, file: str, expected_substr_err: dict[tuple[str, str], list[list[str]]]
) -> None:
try:
self.generator.load_schedule(f"schedule/{file}")
errors = self.out.getvalue().split("\u25b8")[1:]
ic(errors)
if len(errors) != len(expected_substr_err.keys()):
ic("len total errors")
assert len(errors) == len(expected_substr_err.keys())
for err in errors:
error_lines = err.strip().split("\n")
line = error_lines[0]
for key_pattern in expected_substr_err.keys():
if (key_pattern[0] in line) and (key_pattern[1] in line):
key = key_pattern
break
else:
ic("no matching key")
ic(line)
assert False
expected = expected_substr_err[key]
if (len(error_lines) - 1) != len(expected):
ic("len substr errors")
ic(line)
assert (len(error_lines) - 1) == len(expected)
it = error_lines.__iter__()
it.__next__()
for err_line in it:
if not any(
all(exp in err_line for exp in line_exp)
for line_exp in expected
):
ic("wrong substr error")
ic(line)
ic(error_lines)
assert False
expected_substr_err.pop(key)
except AssertionError:
raise
except Exception as e:
ic(e)
assert False
def test_no_start(self):
self._test_conformance("no_start.od", {("Start", "Cardinality"): []})
def test_no_end(self):
self._test_conformance("no_end.od", {("End", "Cardinality"): []})
def test_multiple_start(self):
self._test_conformance("multiple_start.od", {("Start", "Cardinality"): []})
def test_multiple_end(self):
self._test_conformance("multiple_end.od", {("End", "Cardinality"): []})
def test_connections_start(self):
self._test_conformance(
"connections_start.od",
{
("Start", "start"): [
["input exec", "foo_in", "exist"],
["output exec", "out", "multiple"],
["output exec", "foo_out", "exist"],
["input data", "in", "exist"],
]
},
)
def test_connections_end(self):
self._test_conformance(
"connections_end.od",
{
("End", "end"): [
["input exec", "foo_in", "exist"],
["output exec", "foo_out", "exist"],
["input data", "in", "multiple"],
["input data", "out2", "exist"],
["output data", "out", "exist"],
]
},
)
def test_connections_match(self):
self._test_conformance(
"connections_match.od",
{
("Match", "m_foo"): [
["input exec", "foo_in", "exist"],
["output exec", "foo", "exist"],
["output exec", "fail", "multiple"],
["input data", "foo_in", "exist"],
["input data", "in", "multiple"],
["output data", "foo_out", "exist"],
]
},
)
def test_connections_rewrite(self):
self._test_conformance(
"connections_rewrite.od",
{
("Rewrite", "r_foo1"): [
["input exec", "foo_in", "exist"],
["output exec", "foo", "exist"],
],
("Rewrite", "r_foo2"): [
["output exec", "out", "multiple"],
["input data", "foo_in", "exist"],
["input data", "in", "multiple"],
["output data", "foo_out", "exist"],
],
},
)
def test_connections_action(self):
self._test_conformance(
"connections_action.od",
{
("Action", "a_foo1"): [
["input exec", "foo_in", "exist"],
["output exec", "out", "multiple"],
["output exec", "foo", "exist"],
["input data", "in1", "multiple"],
],
("Action", "a_foo2"): [
["input exec", "in", "exist"],
["output exec", "out3", "multiple"],
["output exec", "out", "exist"],
["input data", "in", "exist"],
["output data", "out", "exist"],
],
},
)
def test_connections_modify(self):
self._test_conformance(
"connections_modify.od",
{
("Modify", "m_foo"): [
["input exec", "in", "exist"],
["input exec", "in", "exist"],
["output exec", "out", "exist"],
["input data", "foo_in", "exist"],
["output data", "foo_out", "exist"],
["input data", "in", "multiple"],
]
},
)
def test_connections_merge(self):
self._test_conformance(
"connections_merge.od",
{
("Merge", "m_foo"): [
["input exec", "in", "exist"],
["input exec", "in", "exist"],
["output exec", "out", "exist"],
["input data", "foo_in", "exist"],
["output data", "foo_out", "exist"],
["input data", "in2", "multiple"],
]
},
)
def test_connections_store(self):
self._test_conformance(
"connections_store.od",
{
("Store", "s_foo"): [
["input exec", "foo", "exist"],
["output exec", "out", "multiple"],
["output exec", "foo", "exist"],
["input data", "foo_in", "exist"],
["output data", "foo_out", "exist"],
["input data", "2", "multiple"],
],
},
)
def test_connections_schedule(self):
self._test_conformance(
"connections_schedule.od",
{
("Schedule", "s_foo"): [
["output exec", "out", "multiple"],
["input data", "in2", "multiple"],
]
},
)
def test_connections_loop(self):
self._test_conformance(
"connections_loop.od",
{
("Loop", "l_foo"): [
["input exec", "foo_in", "exist"],
["output exec", "out", "multiple"],
["output exec", "foo", "exist"],
["input data", "foo_in", "exist"],
["output data", "foo_out", "exist"],
["input data", "in", "multiple"],
]
},
)
def test_connections_print(self):
self._test_conformance(
"connections_print.od",
{
("Print", "p_foo"): [
["input exec", "foo_in", "exist"],
["output exec", "out", "multiple"],
["output exec", "foo", "exist"],
["input data", "foo_in", "exist"],
["output data", "out", "exist"],
["input data", "in", "multiple"],
]
},
)
def test_fields_start(self):
self._test_conformance(
"fields_start.od",
{
("Start", "Cardinality"): [],
("Start", "string"): [
["Unexpected type", "ports_exec_out", "str"],
["Unexpected type", "ports_data_out", "str"],
],
("Start", '"int"'): [
["Unexpected type", "ports_exec_out", "int"],
["Unexpected type", "ports_data_out", "int"],
],
("Start", "tuple"): [
["Unexpected type", "ports_exec_out", "tuple"],
["Unexpected type", "ports_data_out", "tuple"],
],
("Start", "dict"): [
["Unexpected type", "ports_exec_out", "dict"],
["Unexpected type", "ports_data_out", "dict"],
],
("Start", "none"): [
["Unexpected type", "ports_exec_out", "NoneType"],
["Unexpected type", "ports_data_out", "NoneType"],
],
("Start", "invalid"): [
["Invalid python", "ports_exec_out"],
["Invalid python", "ports_data_out"],
],
("Start", "subtype"): [
["Unexpected type", "ports_exec_out", "list"],
["Unexpected type", "ports_data_out", "list"],
],
("Start", "code"): [
["Unexpected type", "ports_exec_out"],
["Unexpected type", "ports_data_out"],
],
},
)
def test_fields_end(self):
self._test_conformance(
"fields_end.od",
{
("End", "Cardinality"): [],
("End", "string"): [
["Unexpected type", "ports_exec_in", "str"],
["Unexpected type", "ports_data_in", "str"],
],
("End", '"int"'): [
["Unexpected type", "ports_exec_in", "int"],
["Unexpected type", "ports_data_in", "int"],
],
("End", "tuple"): [
["Unexpected type", "ports_exec_in", "tuple"],
["Unexpected type", "ports_data_in", "tuple"],
],
("End", "dict"): [
["Unexpected type", "ports_exec_in", "dict"],
["Unexpected type", "ports_data_in", "dict"],
],
("End", "none"): [
["Unexpected type", "ports_exec_in", "NoneType"],
["Unexpected type", "ports_data_in", "NoneType"],
],
("End", "invalid"): [
["Invalid python", "ports_exec_in"],
["Invalid python", "ports_data_in"],
],
("End", "subtype"): [
["Unexpected type", "ports_exec_in", "list"],
["Unexpected type", "ports_data_in", "list"],
],
("End", "code"): [
["Unexpected type", "ports_exec_in"],
["Unexpected type", "ports_data_in"],
],
},
)
def test_fields_action(self):
self._test_conformance(
"fields_action.od",
{
("cardinality", "Action_action"): [],
("Action", "string"): [
["Unexpected type", "ports_exec_out", "str"],
["Unexpected type", "ports_exec_in", "str"],
["Unexpected type", "ports_data_out", "str"],
["Unexpected type", "ports_data_in", "str"],
],
("Action", '"int"'): [
["Unexpected type", "ports_exec_out", "int"],
["Unexpected type", "ports_exec_in", "int"],
["Unexpected type", "ports_data_out", "int"],
["Unexpected type", "ports_data_in", "int"],
],
("Action", "tuple"): [
["Unexpected type", "ports_exec_out", "tuple"],
["Unexpected type", "ports_exec_in", "tuple"],
["Unexpected type", "ports_data_out", "tuple"],
["Unexpected type", "ports_data_in", "tuple"],
],
("Action", "dict"): [
["Unexpected type", "ports_exec_out", "dict"],
["Unexpected type", "ports_exec_in", "dict"],
["Unexpected type", "ports_data_out", "dict"],
["Unexpected type", "ports_data_in", "dict"],
],
("Action", "none"): [
["Unexpected type", "ports_exec_out", "NoneType"],
["Unexpected type", "ports_exec_in", "NoneType"],
["Unexpected type", "ports_data_out", "NoneType"],
["Unexpected type", "ports_data_in", "NoneType"],
],
("Action", '"invalid"'): [
["Invalid python", "ports_exec_out"],
["Invalid python", "ports_exec_in"],
["Invalid python", "ports_data_out"],
["Invalid python", "ports_data_in"],
],
("Action_action", "invalid_action"): [],
("Action", "subtype"): [
["Unexpected type", "ports_exec_out", "list"],
["Unexpected type", "ports_exec_in", "list"],
["Unexpected type", "ports_data_out", "list"],
["Unexpected type", "ports_data_in", "list"],
],
("Action", "code"): [
["Unexpected type", "ports_exec_out"],
["Unexpected type", "ports_exec_in"],
["Unexpected type", "ports_data_out"],
["Unexpected type", "ports_data_in"],
],
},
)
def test_fields_modify(self):
self._test_conformance(
"fields_modify.od",
{
("Modify", "string"): [
["Unexpected type", "rename", "str"],
["Unexpected type", "delete", "str"],
],
("Modify", "list"): [["Unexpected type", "rename", "list"]],
("Modify", "set"): [["Unexpected type", "rename", "set"]],
("Modify", "tuple"): [
["Unexpected type", "rename", "tuple"],
["Unexpected type", "delete", "tuple"],
],
("Modify", "dict"): [["Unexpected type", "delete", "dict"]],
("Modify", "none"): [
["Unexpected type", "rename", "NoneType"],
["Unexpected type", "delete", "NoneType"],
],
("Modify", "invalid"): [
["Invalid python", "rename"],
["Invalid python", "delete"],
],
("Modify", "subtype"): [
["Unexpected type", "rename", "dict"],
["Unexpected type", "delete", "list"],
],
("Modify", "code"): [
["Unexpected type", "rename"],
["Unexpected type", "delete"],
],
("Modify", "joined"): [["rename", "delete", "disjoint"]],
},
)
def test_fields_merge(self):
self._test_conformance(
"fields_merge.od",
{
("cardinality", "Merge_ports_data_in"): [],
("Merge", "string"): [["Unexpected type", "ports_data_in", "str"]],
("Merge", "tuple"): [["Unexpected type", "ports_data_in", "tuple"]],
("Merge", "dict"): [["Unexpected type", "ports_data_in", "dict"]],
("Merge", "none"): [["Unexpected type", "ports_data_in", "NoneType"]],
("Merge", "invalid"): [["Invalid python", "ports_data_in"]],
("Merge", "subtype"): [["Unexpected type", "ports_data_in", "list"]],
("Merge", "code"): [["Unexpected type", "ports_data_in"]],
("Merge", "no"): [["Missing", "slot", "ports_data_in"]],
},
)
def test_fields_store(self):
self._test_conformance(
"fields_store.od",
{
("cardinality", "Store_ports"): [],
("Store", "string"): [["Unexpected type", "ports", "str"]],
("Store", "tuple"): [["Unexpected type", "ports", "tuple"]],
("Store", "dict"): [["Unexpected type", "ports", "dict"]],
("Store", "none"): [["Unexpected type", "ports", "NoneType"]],
("Store", "invalid"): [["Invalid python", "ports"]],
("Store", "subtype"): [["Unexpected type", "ports", "list"]],
("Store", "code"): [["Unexpected type", "ports"]],
("Store", "no"): [["Missing", "slot", "ports"]],
},
)
def test_fields_print(self):
self._test_conformance(
"fields_print.od",
{
("Print_custom", "list_custom"): [["Unexpected type", "custom", "list"]],
("Print_custom", "set_custom"): [["Unexpected type", "custom", "set"]],
("Print_custom", "tuple_custom"): [["Unexpected type", "custom", "tuple"]],
("Print_custom", "dict_custom"): [["Unexpected type", "custom", "dict"]],
("Print_custom", "none_custom"): [["Unexpected type", "custom", "NoneType"]],
("Print_custom", "invalid_custom"): [["Invalid python", "custom"]],
("Print_custom", "subtype_custom"): [["Unexpected type", "custom", "list"]],
("Print_custom", "code_custom"): [["Unexpected type", "custom"]],
},
)
if __name__ == "__main__":
unittest.main()

View file

@ -0,0 +1,45 @@
import io
import os
import unittest
from transformation.schedule import rule_scheduler
from transformation.schedule.rule_scheduler import RuleSchedular
from state.devstate import DevState
class MyTestCase(unittest.TestCase):
def setUp(self):
state = DevState()
self.generator = RuleSchedular(state, "", "")
def test_empty(self):
try:
self.generator.generate_schedule(
f"{os.path.dirname(__file__)}/drawio/Empty.drawio"
)
# buffer = io.BytesIO()
# self.generator.generate_dot(buffer)
except Exception as e:
assert False
def test_simple(self):
try:
self.generator.generate_schedule(
f"{os.path.dirname(__file__)}/drawio/StartToEnd.drawio"
)
# buffer = io.BytesIO()
# self.generator.generate_dot(buffer)
except Exception as e:
assert False
# def test_unsupported(self):
# try:
# self.generator.generate_schedule("Tests/drawio/Unsupported.drawio")
# # buffer = io.BytesIO()
# # self.generator.generate_dot(buffer)
# except Exception as e:
# assert(False)
if __name__ == "__main__":
unittest.main()

View file

@ -0,0 +1 @@
<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>

View file

@ -0,0 +1,24 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0" version="26.2.14">
<diagram id="EvjeMC12HsgBk4t1Z8cF" name="Page-1">
<mxGraphModel dx="949" dy="540" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="ym0EkMZWyknAE99nMXu0-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="ym0EkMZWyknAE99nMXu0-7" target="ym0EkMZWyknAE99nMXu0-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ym0EkMZWyknAE99nMXu0-10" value="out -&amp;gt; in" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="ym0EkMZWyknAE99nMXu0-9">
<mxGeometry x="0.1167" y="1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="ym0EkMZWyknAE99nMXu0-7" value="Start" style="html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="330" y="310" width="110" height="50" as="geometry" />
</mxCell>
<mxCell id="ym0EkMZWyknAE99nMXu0-8" value="End" style="html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="560" y="310" width="110" height="50" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View file

@ -0,0 +1,75 @@
<mxfile>
<diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1">
<mxGraphModel dx="1223" dy="645" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="dNxyNK7c78bLwvsdeMH5-19" value="Pool" style="swimlane;html=1;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;horizontal=0;startSize=20;horizontalStack=0;" parent="1" vertex="1">
<mxGeometry x="120" y="120" width="450" height="360" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-27" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=none;endFill=0;" parent="dNxyNK7c78bLwvsdeMH5-19" source="dNxyNK7c78bLwvsdeMH5-24" target="dNxyNK7c78bLwvsdeMH5-26" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-19" source="dNxyNK7c78bLwvsdeMH5-28" target="dNxyNK7c78bLwvsdeMH5-30" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-19" source="dNxyNK7c78bLwvsdeMH5-28" target="dNxyNK7c78bLwvsdeMH5-34" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-19" source="dNxyNK7c78bLwvsdeMH5-26" target="dNxyNK7c78bLwvsdeMH5-36" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="180" y="340" />
<mxPoint x="400" y="340" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-20" value="Lane 1" style="swimlane;html=1;startSize=20;horizontal=0;" parent="dNxyNK7c78bLwvsdeMH5-19" vertex="1">
<mxGeometry x="20" width="430" height="120" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-25" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="dNxyNK7c78bLwvsdeMH5-20" source="dNxyNK7c78bLwvsdeMH5-23" target="dNxyNK7c78bLwvsdeMH5-24" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-23" value="" style="ellipse;whiteSpace=wrap;html=1;" parent="dNxyNK7c78bLwvsdeMH5-20" vertex="1">
<mxGeometry x="40" y="40" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-24" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-20" vertex="1">
<mxGeometry x="120" y="30" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-33" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-20" source="dNxyNK7c78bLwvsdeMH5-30" target="dNxyNK7c78bLwvsdeMH5-32" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-30" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-20" vertex="1">
<mxGeometry x="240" y="30" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-32" value="" style="ellipse;whiteSpace=wrap;html=1;" parent="dNxyNK7c78bLwvsdeMH5-20" vertex="1">
<mxGeometry x="360" y="40" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-21" value="Lane 2" style="swimlane;html=1;startSize=20;horizontal=0;" parent="dNxyNK7c78bLwvsdeMH5-19" vertex="1">
<mxGeometry x="20" y="120" width="430" height="120" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-29" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-21" source="dNxyNK7c78bLwvsdeMH5-26" target="dNxyNK7c78bLwvsdeMH5-28" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-26" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-21" vertex="1">
<mxGeometry x="120" y="30" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-28" value="" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-21" vertex="1">
<mxGeometry x="260" y="40" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-22" value="Lane 3" style="swimlane;html=1;startSize=20;horizontal=0;" parent="dNxyNK7c78bLwvsdeMH5-19" vertex="1">
<mxGeometry x="20" y="240" width="430" height="120" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-37" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="dNxyNK7c78bLwvsdeMH5-22" source="dNxyNK7c78bLwvsdeMH5-34" target="dNxyNK7c78bLwvsdeMH5-36" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-34" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-22" vertex="1">
<mxGeometry x="240" y="20" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="dNxyNK7c78bLwvsdeMH5-36" value="" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=#000000;align=center;" parent="dNxyNK7c78bLwvsdeMH5-22" vertex="1">
<mxGeometry x="360" y="30" width="40" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View file

@ -0,0 +1,22 @@
p0:PNPlace
p1:PNPlace
t0:PNTransition
:arc (p0 -> t0)
:arc (t0 -> p1)
t1:PNTransition
:arc (p1 -> t1)
:arc (t1 -> p0)
p0s:PNPlaceState {
numTokens = 1;
}
:pn_of (p0s -> p0)
p1s:PNPlaceState {
numTokens = 0;
}
:pn_of (p1s -> p1)

View file

@ -0,0 +1,31 @@
# Places, transitions, arcs (and only one kind of arc)
PNConnectable:Class { abstract = True; }
arc:Association (PNConnectable -> PNConnectable)
PNPlace:Class
PNTransition:Class
# inhibitor arc
inh_arc:Association (PNPlace -> PNTransition)
:Inheritance (PNPlace -> PNConnectable)
:Inheritance (PNTransition -> PNConnectable)
# A place has a number of tokens, and that's it.
PNPlaceState:Class
PNPlaceState_numTokens:AttributeLink (PNPlaceState -> Integer) {
name = "numTokens";
optional = False;
constraint = `"numTokens cannot be negative" if get_value(get_target(this)) < 0 else None`;
}
pn_of:Association (PNPlaceState -> PNPlace) {
# one-to-one
source_lower_cardinality = 1;
source_upper_cardinality = 1;
target_lower_cardinality = 1;
target_upper_cardinality = 1;
}

View file

@ -0,0 +1,13 @@
# A place with no tokens:
p:RAM_PNPlace
ps:RAM_PNPlaceState {
RAM_numTokens = `True`;
}
:RAM_pn_of (ps -> p)
# An incoming arc from that place to our transition:
t:RAM_PNTransition
:RAM_arc (p -> t)

View file

@ -0,0 +1,62 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
a_void:Action{
ports_data_in = `["in1", "in2"]`;
ports_data_out = `["out1", "out2"]`;
action=`print("hello foo1")`;
}
a_foo1:Action{
ports_data_in = `["in1", "in2"]`;
ports_data_out = `["out1", "out2"]`;
action=`print("hello foo1")`;
}
a_foo2:Action{
ports_exec_in = `["in2"]`;
ports_exec_out = `["out2", "out3"]`;
action=`print("hello foo2")`;
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> a_foo1) {from="success";to="in";}
:Conn_exec (m2 -> a_foo1) {from="fail";to="in";}
:Conn_exec (m3 -> a_foo1) {from="success";to="foo_in";}
:Conn_exec (m3 -> a_foo2) {from="fail";to="in2";}
:Conn_exec (a_foo1 -> a_foo2) {from="out";to="in";}
:Conn_exec (a_foo1 -> a_foo2) {from="out";to="in2";}
:Conn_exec (a_foo1 -> a_foo2) {from="foo";to="in2";}
:Conn_exec (a_foo2 -> end) {from="out";to="in";}
:Conn_exec (a_foo2 -> end) {from="out2";to="in";}
:Conn_exec (a_foo2 -> end) {from="out3";to="in";}
:Conn_exec (a_foo2 -> end) {from="out3";to="in";}
:Conn_data (start -> a_foo2) {from="1";to="in";}
:Conn_data (a_foo2-> m2) {from="out";to="in";}
:Conn_data (start -> a_foo1) {from="1";to="in1";}
:Conn_data (start -> a_foo1) {from="2";to="in1";}
:Conn_data (start -> a_foo1) {from="3";to="in2";}
:Conn_data (a_foo1 -> end) {from="out1";to="1";}
:Conn_data (a_foo1 -> end) {from="out1";to="2";}
:Conn_data (a_foo1 -> end) {from="out2";to="3";}

View file

@ -0,0 +1,31 @@
start:Start
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
end:End {
ports_exec_in = `["out", "in"]`;
ports_data_in = `["out", "in"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> end) {from="success";to="in";}
:Conn_exec (m2 -> end) {from="fail";to="out";}
:Conn_exec (m3 -> end) {from="success";to="out";}
:Conn_exec (m3 -> end) {from="fail";to="foo_in";}
:Conn_exec (end -> m) {from="foo_out";to="in";}
:Conn_data (m -> end) {from="out";to="in";}
:Conn_data (m2 -> end) {from="out";to="in";}
:Conn_data (m3 -> end) {from="out";to="out";}
:Conn_data (m3 -> end) {from="out";to="out2";}
:Conn_data (end -> m) {from="out";to="in";}

View file

@ -0,0 +1,44 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
l:Loop
l_foo:Loop
l_void:Loop
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> l_foo) {from="success";to="in";}
:Conn_exec (m2 -> l_foo) {from="fail";to="in";}
:Conn_exec (m3 -> l_foo) {from="success";to="foo_in";}
:Conn_exec (l_foo -> l_foo) {from="out";to="in";}
:Conn_exec (l_foo -> end) {from="out";to="in";}
:Conn_exec (l_foo -> end) {from="it";to="in";}
:Conn_exec (l_foo -> end) {from="foo";to="in";}
:Conn_data (start -> l) {from="1";to="in";}
:Conn_data (l -> m2) {from="out";to="in";}
:Conn_data (start -> l_foo) {from="1";to="in";}
:Conn_data (start -> l_foo) {from="2";to="in";}
:Conn_data (start -> l_foo) {from="3";to="foo_in";}
:Conn_data (l_foo -> end) {from="out";to="1";}
:Conn_data (l_foo -> end) {from="out";to="2";}
:Conn_data (l_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,49 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
m_foo:Match{
file="rules/transition.od";
}
m_void:Match{
file="rules/transition.od";
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="fail";to="in";}
:Conn_exec (m3 -> m_foo) {from="success";to="foo_in";}
:Conn_exec (m3 -> m_foo) {from="fail";to="in";}
:Conn_exec (m_foo -> end) {from="fail";to="in";}
:Conn_exec (m_foo -> end) {from="success";to="in";}
:Conn_exec (m_foo -> end) {from="fail";to="in";}
:Conn_exec (m_foo -> end) {from="foo";to="in";}
:Conn_data (start -> m) {from="1";to="in";}
:Conn_data (m -> m2) {from="out";to="in";}
:Conn_data (start -> m_foo) {from="1";to="in";}
:Conn_data (start -> m_foo) {from="2";to="in";}
:Conn_data (start -> m_foo) {from="3";to="foo_in";}
:Conn_data (m_foo -> end) {from="out";to="1";}
:Conn_data (m_foo -> end) {from="out";to="2";}
:Conn_data (m_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,42 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
m_foo:Merge {
ports_data_in = `["in1", "in2"]`;
}
m_void:Merge {
ports_data_in = `["in1", "in2"]`;
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="fail";to="in";}
:Conn_exec (m_foo -> end) {from="out";to="in";}
:Conn_data (start -> m_foo) {from="1";to="in1";}
:Conn_data (start -> m_foo) {from="1";to="in2";}
:Conn_data (start -> m_foo) {from="2";to="in2";}
:Conn_data (start -> m_foo) {from="3";to="foo_in";}
:Conn_data (m_foo -> end) {from="out";to="1";}
:Conn_data (m_foo -> end) {from="out";to="2";}
:Conn_data (m_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,41 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
m_foo:Modify
m_void:Modify
mo:Modify
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="success";to="in";}
:Conn_exec (m2 -> m_foo) {from="fail";to="in";}
:Conn_exec (m_foo -> end) {from="out";to="in";}
:Conn_data (start -> mo) {from="1";to="in";}
:Conn_data (mo -> m2) {from="out";to="in";}
:Conn_data (start -> m_foo) {from="1";to="in";}
:Conn_data (start -> m_foo) {from="2";to="in";}
:Conn_data (start -> m_foo) {from="3";to="foo_in";}
:Conn_data (m_foo -> end) {from="out";to="1";}
:Conn_data (m_foo -> end) {from="out";to="2";}
:Conn_data (m_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,41 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
p_foo:Print
p_void:Print
p:Print
end:End
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> p_foo) {from="success";to="in";}
:Conn_exec (m2 -> p_foo) {from="fail";to="in";}
:Conn_exec (m3 -> p_foo) {from="success";to="foo_in";}
:Conn_exec (m3 -> p) {from="fail";to="in";}
:Conn_exec (p -> end) {from="out";to="in";}
:Conn_exec (p_foo -> p_foo) {from="out";to="in";}
:Conn_exec (p_foo -> end) {from="out";to="in";}
:Conn_exec (p_foo -> end) {from="foo";to="in";}
:Conn_data (start -> p) {from="1";to="in";}
:Conn_data (start -> p_foo) {from="1";to="in";}
:Conn_data (start -> p_foo) {from="2";to="in";}
:Conn_data (start -> p_foo) {from="3";to="foo_in";}
:Conn_data (p_foo -> m2) {from="out";to="in";}

View file

@ -0,0 +1,52 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
r_foo1:Rewrite{
file="rules/transition.od";
}
r_foo2:Rewrite{
file="rules/transition.od";
}
r_void:Rewrite{
file="rules/transition.od";
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> r_foo1) {from="success";to="in";}
:Conn_exec (m2 -> r_foo1) {from="fail";to="in";}
:Conn_exec (m3 -> r_foo1) {from="success";to="foo_in";}
:Conn_exec (m3 -> r_foo1) {from="fail";to="in";}
:Conn_exec (r_foo1 -> r_foo2) {from="out";to="in";}
:Conn_exec (r_foo1 -> end) {from="foo";to="in";}
:Conn_exec (r_foo2 -> end) {from="out";to="in";}
:Conn_exec (r_foo2 -> end) {from="out";to="in";}
:Conn_data (start -> r_foo1) {from="1";to="in";}
:Conn_data (r_foo1-> m2) {from="out";to="in";}
:Conn_data (start -> r_foo2) {from="1";to="in";}
:Conn_data (start -> r_foo2) {from="2";to="in";}
:Conn_data (start -> r_foo2) {from="3";to="foo_in";}
:Conn_data (r_foo2 -> end) {from="out";to="1";}
:Conn_data (r_foo2 -> end) {from="out";to="2";}
:Conn_data (r_foo2 -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,50 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
s_foo:Schedule{
file="hello.od";
}
s_void:Schedule{
file="hello.od";
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> s_foo) {from="success";to="in";}
:Conn_exec (m2 -> s_foo) {from="fail";to="in";}
:Conn_exec (m3 -> s_foo) {from="success";to="foo";}
:Conn_exec (m3 -> s_foo) {from="fail";to="foo2";}
:Conn_exec (s_foo -> s_foo) {from="out";to="in";}
:Conn_exec (s_foo -> s_foo) {from="out";to="in2";}
:Conn_exec (s_foo -> s_foo) {from="foo";to="foo3";}
:Conn_exec (s_foo -> end) {from="out4";to="in";}
:Conn_exec (s_foo -> end) {from="out2";to="in";}
:Conn_exec (s_foo -> end) {from="out5";to="in";}
:Conn_exec (s_foo -> end) {from="out3";to="in";}
:Conn_data (start -> s_foo) {from="1";to="in1";}
:Conn_data (start -> s_foo) {from="1";to="in2";}
:Conn_data (start -> s_foo) {from="2";to="in2";}
:Conn_data (start -> s_foo) {from="3";to="foo_in";}
:Conn_data (s_foo -> end) {from="out";to="1";}
:Conn_data (s_foo -> end) {from="out";to="2";}
:Conn_data (s_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,27 @@
start:Start {
ports_exec_out = `["out", "in"]`;
ports_data_out = `["out", "in"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
end:End
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (start -> m) {from="in";to="in";}
:Conn_exec (start -> m) {from="foo_out";to="in";}
:Conn_exec (m -> start) {from="fail";to="foo_in";}
:Conn_exec (m -> end) {from="success";to="in";}
:Conn_data (start -> m) {from="out";to="in";}
:Conn_data (start -> m2) {from="out";to="in";}
:Conn_data (start -> m3) {from="in";to="in";}
:Conn_data (m -> start) {from="out";to="in";}

View file

@ -0,0 +1,47 @@
start:Start {
ports_data_out = `["1", "2", "3"]`;
}
m:Match{
file="rules/transition.od";
}
m2:Match{
file="rules/transition.od";
}
m3:Match{
file="rules/transition.od";
}
s_foo:Store {
ports = `["1", "2", "3"]`;
}
s_void:Store {
ports = `["1", "2", "3"]`;
}
end:End {
ports_data_in = `["1", "2", "3"]`;
}
:Conn_exec (start -> m) {from="out";to="in";}
:Conn_exec (m -> m2) {from="fail";to="in";}
:Conn_exec (m -> m3) {from="success";to="in";}
:Conn_exec (m2 -> s_foo) {from="success";to="in";}
:Conn_exec (m2 -> s_foo) {from="fail";to="in";}
:Conn_exec (m3 -> s_foo) {from="success";to="1";}
:Conn_exec (m3 -> s_foo) {from="fail";to="foo";}
:Conn_exec (s_foo -> end) {from="out";to="in";}
:Conn_exec (s_foo -> s_foo) {from="1";to="2";}
:Conn_exec (s_foo -> end) {from="out";to="in";}
:Conn_exec (s_foo -> s_foo) {from="foo";to="2";}
:Conn_data (start -> s_foo) {from="1";to="1";}
:Conn_data (start -> s_foo) {from="1";to="2";}
:Conn_data (start -> s_foo) {from="2";to="2";}
:Conn_data (start -> s_foo) {from="3";to="foo_in";}
:Conn_data (s_foo -> end) {from="out";to="1";}
:Conn_data (s_foo -> end) {from="out";to="2";}
:Conn_data (s_foo -> end) {from="foo_out";to="3";}

View file

@ -0,0 +1,83 @@
string:Action {
ports_exec_in = `'["out", "in"]'`;
ports_exec_out = `'["out", "in"]'`;
ports_data_in = `'["out", "in"]'`;
ports_data_out = `'["out", "in"]'`;
action = `'["out", "in"]'`;
}
int:Action {
ports_exec_in = `123`;
ports_exec_out = `123`;
ports_data_in = `123`;
ports_data_out = `123`;
action = `123`;
}
list:Action {
ports_exec_out = `["out", "in"]`;
ports_exec_in = `["out", "in"]`;
ports_data_out = `["out", "in"]`;
ports_data_in = `["out", "in"]`;
action = `["out", "in"]`;
}
set:Action {
ports_exec_in = `{"out", "in"}`;
ports_exec_out = `{"out", "in"}`;
ports_data_in = `{"out", "in"}`;
ports_data_out = `{"out", "in"}`;
action = `{"out", "in"}`;
}
tuple:Action {
ports_exec_in = `("out", "in")`;
ports_exec_out = `("out", "in")`;
ports_data_in = `("out", "in")`;
ports_data_out = `("out", "in")`;
action = `("out", "in")`;
}
dict:Action {
ports_exec_in = `{"out": "in"}`;
ports_exec_out = `{"out": "in"}`;
ports_data_in = `{"out": "in"}`;
ports_data_out = `{"out": "in"}`;
action = `{"out": "in"}`;
}
none:Action {
ports_exec_in = `None`;
ports_exec_out = `None`;
ports_data_in = `None`;
ports_data_out = `None`;
action = `None`;
}
invalid:Action {
ports_exec_in = `[{a(0)['qkja("fyvka`;
ports_exec_out = `[{a(0)['qkja("fyvka`;
ports_data_in = `["", [{]]`;
ports_data_out = `["", [{]]`;
action = `hu(ja&{]8}]`;
}
subtype:Action {
ports_exec_in = `[1, 2]`;
ports_exec_out = `[1, 2]`;
ports_data_in = `[1, 2]`;
ports_data_out = `[1, 2]`;
action = `[1, 2]`;
}
code:Action {
ports_exec_in = `print("hello world")`;
ports_exec_out = `print("hello world")`;
ports_data_in = `print("hello world")`;
ports_data_out = `print("hello world")`;
action = `print("hello world")`;
}
no:Action
start:Start
end:End

View file

@ -0,0 +1,52 @@
start:Start
string:End {
ports_exec_in = `'["out", "in"]'`;
ports_data_in = `'["out", "in"]'`;
}
int:End {
ports_exec_in = `123`;
ports_data_in = `123`;
}
list:End {
ports_exec_in = `["out", "in"]`;
ports_data_in = `["out", "in"]`;
}
set:End {
ports_exec_in = `{"out", "in"}`;
ports_data_in = `{"out", "in"}`;
}
tuple:End {
ports_exec_in = `("out", "in")`;
ports_data_in = `("out", "in")`;
}
dict:End {
ports_exec_in = `{"out": "in"}`;
ports_data_in = `{"out": "in"}`;
}
none:End {
ports_exec_in = `None`;
ports_data_in = `None`;
}
invalid:End {
ports_exec_in = `[{a(0)['qkja("fyvka`;
ports_data_in = `["", [{]]`;
}
subtype:End {
ports_exec_in = `[1, 2]`;
ports_data_in = `[1, 2]`;
}
code:End {
ports_exec_in = `print("hello world")`;
ports_data_in = `print("hello world")`;
}
no:End

View file

@ -0,0 +1,39 @@
string:Merge {
ports_data_in = `'["out", "in"]'`;
}
list:Merge {
ports_data_in = `["out", "in"]`;
}
set:Merge {
ports_data_in = `{"out", "in"}`;
}
tuple:Merge {
ports_data_in = `("out", "in")`;
}
dict:Merge {
ports_data_in = `{"out": "in"}`;
}
none:Merge {
ports_data_in = `None`;
}
invalid:Merge {
ports_data_in = `["", [{]]`;
}
subtype:Merge {
ports_data_in = `[1, 2]`;
}
code:Merge {
ports_data_in = `print("hello world")`;
}
no:Merge
start:Start
end:End

View file

@ -0,0 +1,51 @@
string:Modify {
rename = `'["out", "in"]'`;
delete = `'["out", "in"]'`;
}
list:Modify {
rename = `["out", "in"]`;
delete = `["out", "in"]`;
}
set:Modify {
rename = `{"out", "in"}`;
delete = `{"out", "in"}`;
}
tuple:Modify {
rename = `("out", "in")`;
delete = `("out", "in")`;
}
dict:Modify {
rename = `{"out": "in"}`;
delete = `{"out": "in"}`;
}
none:Modify {
rename = `None`;
delete = `None`;
}
invalid:Modify {
rename = `[{a(0)['qkja("fyvka`;
delete = `["", [{]]`;
}
subtype:Modify {
rename = `{1: 2}`;
delete = `[1, 2]`;
}
code:Modify {
rename = `print("hello world")`;
delete = `print("hello world")`;
}
joined:Modify {
rename = `{"a":"1", "b":"2", "c":"3"}`;
delete = `{"a", "d"}`;
}
start:Start
end:End

View file

@ -0,0 +1,39 @@
string:Print {
custom = `'["port_out", "port_in"]'`;
}
list:Print {
custom = `["port_out", "port_in"]`;
}
set:Print {
custom = `{"port_out", "port_in"}`;
}
tuple:Print {
custom = `("port_out", "port_in")`;
}
dict:Print {
custom = `{"port_out": "port_in"}`;
}
none:Print {
custom = `None`;
}
invalid:Print {
custom = `["", [{]]`;
}
subtype:Print {
custom = `[1, 2]`;
}
code:Print {
custom = `print("hello world")`;
}
no:Print
start:Start
end:End

View file

@ -0,0 +1,52 @@
string:Start {
ports_exec_out = `'["out", "in"]'`;
ports_data_out = `'["out", "in"]'`;
}
int:Start {
ports_exec_out = `123`;
ports_data_out = `123`;
}
list:Start {
ports_exec_out = `["out", "in"]`;
ports_data_out = `["out", "in"]`;
}
set:Start {
ports_exec_out = `{"out", "in"}`;
ports_data_out = `{"out", "in"}`;
}
tuple:Start {
ports_exec_out = `("out", "in")`;
ports_data_out = `("out", "in")`;
}
dict:Start {
ports_exec_out = `{"out": "in"}`;
ports_data_out = `{"out": "in"}`;
}
none:Start {
ports_exec_out = `None`;
ports_data_out = `None`;
}
invalid:Start {
ports_exec_out = `[{a(0)['qkja("fyvka`;
ports_data_out = `["", [{]]`;
}
subtype:Start {
ports_exec_out = `[1, 2]`;
ports_data_out = `[1, 2]`;
}
code:Start {
ports_exec_out = `print("hello world")`;
ports_data_out = `print("hello world")`;
}
no:Start
end:End

View file

@ -0,0 +1,39 @@
string:Store {
ports = `'["port_out", "port_in"]'`;
}
list:Store {
ports = `["port_out", "port_in"]`;
}
set:Store {
ports = `{"port_out", "port_in"}`;
}
tuple:Store {
ports = `("port_out", "port_in")`;
}
dict:Store {
ports = `{"port_out": "port_in"}`;
}
none:Store {
ports = `None`;
}
invalid:Store {
ports = `["", [{]]`;
}
subtype:Store {
ports = `[1, 2]`;
}
code:Store {
ports = `print("hello world")`;
}
no:Store
start:Start
end:End

View file

@ -0,0 +1,5 @@
start:Start
end:End
end2:End
:Conn_exec (start -> end) {from="out";to="in";}

View file

@ -0,0 +1,5 @@
start:Start
start2:Start
end:End
:Conn_exec (start -> end) {from="out";to="in";}

View file

@ -0,0 +1 @@
start:Start

View file

@ -0,0 +1 @@
end:End

View file

@ -0,0 +1,3 @@
start:Start
end:End
:Conn_exec (start -> end) {from="out";to="in";}