CQCL/hugr

`LoadConstant` nodes can't have `OrderEdge`s

Closed this issue · 1 comments

At present Nodes are only allowed one kind of other_port_kind. This seems like an artificial restriction, which good taste demands should be lifted, but "LoadConstant nodes can't have OrderEdges" does seem like a limitation.

In my mind LoadConstant is an operation with side effects. Memory side effects being obvious, but also LoadConstant of a Value::Function can be read as compiling that value. As such, users should be able to impose an order on two LoadConstant operations to control the order of their side effects.

Weaker arguments for nodes to have multiple other_port_kinds:

  • Case nodes in a conditional are interpreted with respect to their index into their parent. This is ugly, one could instead demand, or allow, that they have order edges which induce a total order, and use that total order to assign them an index.
  • DataFlowBlocks could get indices in the same was as Case above.

edges spec issue: #848

Not an issue, demonstrated in #1293