Init/Term necessary in replacement? #76
Replies: 2 comments 1 reply
-
For CFGs - the entry node is really just the target of a hidden entry edge from the outside (from the CFG-node, recalling an earlier+discarded idea of nested graphs using their container node for input/output). Either you are replacing the entry node, or you are inserting extra graph before the old entry node (and you must be adding CFG edges from your inserted sub-CFG to the old entry-node, or else the latter would become unreachable). For DDGs, I'm less clear how this happens. Not only would you have to be replacing the old entry node, you'd also have to be changing the type (inputs/outputs) to the old container node too. Does the API let you do that? Or, rather than adding new nodes (inc Input/Output) to an existing container, should we think of replacing the old container node with a new one, and reparenting the old container's children across to the new container? Ah - no, we can't do the latter: the old container's children can only be transplanted into a new empty container. Hmmm. |
Beta Was this translation helpful? Give feedback.
-
I think this discussion is obsolete. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/CQCL-DEV/hugr/blob/e1053afcb9698039d7464c1bfc5deee2cdaa71a8/specification/hugr.md#L1128-L1131
@acl-cqc
3 May 2023
Are the Init/Term sets actually necessary here, or can we say:
placing n in the first position among children of t(n) if n is an Input node and in last position if n is an Output node
? Ah - basic blocks (entry/exit nodes), hmmm
@cqc-alec
4 May 2023
Yes if entry and exit nodes were distinguished types we could probably do that.
Beta Was this translation helpful? Give feedback.
All reactions