Files
mgmt/lang/interpret_test/TestAstFunc3/sendrecv-autogroup.txtar
James Shubin 9dd5dfdde2 engine: graph: autogroup: Improve the autogrouping algorithm
This improves the autogrouping algorithm to support hierarchical
autogrouping. It's not guaranteed to work if we replace the reachability
grouper with something more efficient, but it's good enough for now.
2024-01-22 20:37:53 -05:00

50 lines
1.3 KiB
Plaintext

-- main.mcl --
# send/recv of value1.any into print1.msg works!
value "value1" {
any => "i am value1",
}
print "print1" {
msg => "i am print1",
Meta:autogroup => false,
}
Value["value1"].any -> Print["print1"].msg
# One of these will be autogrouped into the other! The inner one can receive!
# send/recv from value2.any into print2.msg works
# send/recv from value3.any into (the usually autogrouped) print3 works too!
value "value2" {
any => "i am value2",
}
value "value3" {
any => "i am value3",
}
print "print2" {
msg => "i am print2",
Meta:autogroup => true,
}
print "print3" {
msg => "i am print3",
Meta:autogroup => true,
}
Value["value2"].any -> Print["print2"].msg
Value["value3"].any -> Print["print3"].msg
-- OUTPUT --
Edge: value[value1] -> print[print1] # value[value1] -> print[print1]
Edge: value[value2] -> print[print3] # value[value2] -> print[print2]
Edge: value[value3] -> print[print3] # value[value3] -> print[print3]
Field: print[print1].Msg = "i am value1"
Field: print[print3].Msg = "i am value3"
Field: value[value1].Any = "i am value1"
Field: value[value2].Any = "i am value2"
Field: value[value3].Any = "i am value3"
Group: print[print3]: Field: print[print2].Msg = "i am value2"
Group: print[print3]: Vertex: print[print2]
Vertex: print[print1]
Vertex: print[print3]
Vertex: value[value1]
Vertex: value[value2]
Vertex: value[value3]