-
Notifications
You must be signed in to change notification settings - Fork 7
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 updates #741
Merged
Merged
docs: Spec updates #741
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
370e6dc
Add a bit of intuition about Replace.
cqc-alec 37a5f72
Define an identity node for CFGs.
cqc-alec d0d0940
State that acyclicity is preserved by InsertOrder.
cqc-alec 1c9853e
Use correct terminology.
cqc-alec 2733432
Correct typo.
cqc-alec 207079b
Fix outdated text.
cqc-alec 8f57eae
Merge branch 'main' into spec-updates
cqc-alec 44d2ea3
Make description of "passthrough" DFBs clearer.
cqc-alec 6b20e6a
Merge branch 'main' into spec-updates
cqc-alec 00d6aee
Merge branch 'main' into spec-updates
cqc-alec cf1d9ac
Improve explanation of adoption.
cqc-alec 4f61b7f
Revert "Make description of "passthrough" DFBs clearer."
cqc-alec 90a98fd
Revert "Define an identity node for CFGs."
cqc-alec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1191,7 +1191,19 @@ The new hugr is then derived as follows: | |
|
||
###### `Replace` | ||
|
||
This is the general subgraph-replacement method. | ||
This is the general subgraph-replacement method. Intuitively, it takes a set of | ||
sibling nodes to remove and replace with a new set of nodes. The new set of | ||
nodes is itself a HUGR with some "holes" (edges and nodes that get "filled in" | ||
by the `Replace` operation). To fully specify the operation, some further data | ||
are needed: | ||
|
||
- The replacement may include container nodes with no children, which adopt | ||
the children of removed container nodes and prevent those children being | ||
removed. | ||
- All new incoming edges from the retained nodes to the new nodes, all | ||
outgoing edges from the new nodes to the retained nodes, and any new edges | ||
that bypass the replacement (going between retained nodes) must be | ||
specified. | ||
|
||
Given a set $S$ of nodes in a hugr, let $S^\*$ be the set of all nodes | ||
descended from nodes in $S$ (i.e. reachable from $S$ by following hierarchy edges), | ||
|
@@ -1325,8 +1337,8 @@ successor. | |
|
||
Insert an Order edge from `n0` to `n1` where `n0` and `n1` are distinct | ||
siblings in a DSG such that there is no path in the DSG from `n1` to | ||
`n0`. If there is already an order edge from `n0` to `n1` this does | ||
nothing (but is not an error). | ||
`n0`. (Thus acyclicity is preserved.) If there is already an order edge from | ||
`n0` to `n1` this does nothing (but is not an error). | ||
|
||
###### `RemoveOrder` | ||
|
||
|
@@ -1371,7 +1383,7 @@ nodes. | |
|
||
The most basic case – replacing a convex set of Op nodes in a DSG with | ||
another graph of Op nodes having the same signature – is implemented by | ||
having T map everything to the parent node, and bot(G) is empty. | ||
`SimpleReplace`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hehe! Yes :) |
||
|
||
If one of the nodes in the region is a complex container node that we | ||
wish to preserve in the replacement without doing a deep copy, we can | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to provide an intuition here :)