Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: [spec] Remove references to causal cone and Order edges from Input #762

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,13 @@ the following basic dataflow operations are available (in addition to the

- `Input/Output`: input/output nodes, the outputs of `Input` node are
the inputs to the function, and the inputs to `Output` are the
outputs of the function. In a data dependency subgraph, a valid
ordering of operations can be achieved by topologically sorting the
nodes starting from `Input` with respect to the Value and Order
edges.
outputs of the function.
- `Call`: Call a statically defined function. There is an incoming
`Static<Function>` edge to specify the graph being called. The
signature of the node (defined by its incoming and outgoing `Value` edges) matches the function being called.
- `LoadConstant<T>`: has an incoming `Static<T>` edge, where `T` is a `CopyableType`, and a
`Value<Local,T>` output, used to load a static constant into the local
dataflow graph. They also have an incoming `Order` edge connecting
them to the `Input` node, as should all operations that
take no dataflow input, to ensure they lie in the causal cone of the
`Input` node when traversing.
dataflow graph.
- `identity<T>`: pass-through, no operation is performed.
- `DFG`: A nested dataflow graph.
These nodes are parents in the hierarchy.
Expand Down Expand Up @@ -515,10 +509,11 @@ graph:
cycles. The common parent is a CFG-node.

**Dataflow Sibling Graph (DSG)**: nodes are operations, `CFG`,
`Conditional`, `TailLoop` and `DFG` nodes; edges are `Value`, `Order` and `Static`;
and must be acyclic. There is a unique Input node and Output node. All nodes must be
reachable from the Input node, and must reach the Output node. The common parent
may be a `FuncDefn`, `TailLoop`, `DFG`, `Case` or `DFB` node.
`Conditional`, `TailLoop` and `DFG` nodes; edges are `Value`, `Order` and `Static`, and must be acyclic.
(Thus a valid ordering of operations can be achieved by topologically sorting the
nodes.)
There is a unique Input node and Output node.
The common parent may be a `FuncDefn`, `TailLoop`, `DFG`, `Case` or `DFB` node.

| **Edge Kind** | **Locality** |
| -------------- | ------------ |
Expand Down Expand Up @@ -1340,16 +1335,15 @@ remove it. (If there is an non-local edge from `n0` to a descendent of

Given a `Const<T>` node `c`, and optionally `P`, a parent of a DSG, add a new
`LoadConstant<T>` node `n` as a child of `P` with a `Static<T>` edge
from `c` to `n` and no outgoing edges from `n`. Also add an Order edge
from the Input node under `P` to `n`. Return the ID of `n`. If `P` is
from `c` to `n` and no outgoing edges from `n`. Return the ID of `n`. If `P` is
omitted it defaults to the parent of `c` (in this case said `c` will
have to be in a DSG or CSG rather than under the Module Root.) If `P` is
provided, it must be a descendent of the parent of `c`.

###### `RemoveConstIgnore`

Given a `LoadConstant<T>` node `n` that has no outgoing edges, remove
it (and its incoming value and Order edges) from the hugr.
it (and its incoming Static edge and any Order edges) from the hugr.

##### Insertion and removal of const nodes

Expand Down